Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightdb: require content type when registering an observation #493

Merged
merged 2 commits into from
May 23, 2024

Conversation

szczys
Copy link
Contributor

@szczys szczys commented May 15, 2024

Allow user to specify the LightDB State serialization format returned by the server when an observation is registerd. Prior to this change, JSON was being used by default while the server is also capable of returning CBOR.

Copy link

github-actions bot commented May 15, 2024

Visit the preview URL for this PR (updated for commit 32c227d):

https://golioth-firmware-sdk-doxygen-dev--pr493-szczys-lightdb-8agzixd3.web.app

(expires Wed, 29 May 2024 21:39:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578

Copy link

github-actions bot commented May 15, 2024

Code Coverage

Type Coverage
lines 58.7% (1264 of 2152 lines)
functions 66.0% (126 of 191 functions)

Copy link
Contributor

@sam-golioth sam-golioth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change!

@@ -395,7 +395,11 @@ static void test_lightdb_invalid(struct golioth_client *client)

static void test_lightdb_observe_setup(struct golioth_client *client)
{
golioth_lightdb_observe_async(client, "hil/lightdb/observed/int", int_cb, NULL);
golioth_lightdb_observe_async(client,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a test for CBOR observations too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a commit to test both CBOR and JSON observation types.

@szczys szczys requested a review from sam-golioth May 22, 2024 21:32
Allow user to specify the LightDB State serialization format returned by
the server when an observation is registerd. Prior to this change, JSON was
being used by default while the server is also capable of returning CBOR.

Signed-off-by: Mike Szczys <[email protected]>
@szczys szczys force-pushed the szczys/lightdb_observe_use_content_type branch from 8daffa7 to e86f740 Compare May 22, 2024 21:36
@szczys szczys force-pushed the szczys/lightdb_observe_use_content_type branch from e86f740 to 32c227d Compare May 22, 2024 21:38
@szczys szczys merged commit ccfbc79 into main May 23, 2024
33 of 42 checks passed
@szczys szczys deleted the szczys/lightdb_observe_use_content_type branch May 23, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants