-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add golioth_rpc_deinit() API #478
Conversation
2e8039d
to
0bcfd12
Compare
Visit the preview URL for this PR (updated for commit 6fa46b1): https://golioth-firmware-sdk-doxygen-dev--pr478-szczys-add-rpc-z2qrnhn3.web.app (expires Tue, 28 May 2024 16:12:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: a9993e61697a3983f3479e468bcb0b616f9a0578 |
Code Coverage
|
83c528d
to
4336422
Compare
161664d
to
26ecaa6
Compare
7adb16d
to
56a80b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5752223
to
19334fc
Compare
@@ -23,5 +23,5 @@ DECLARE_FAKE_VALUE_FUNC(enum golioth_status, | |||
bool, | |||
int32_t); | |||
DECLARE_FAKE_VOID_FUNC(golioth_coap_client_cancel_observations_by_prefix, | |||
struct golioth_client *, | |||
const char *); | |||
struct golioth_client *, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: would be cleaner to fix this in the previous commit.
src/rpc.c
Outdated
@@ -234,6 +234,20 @@ struct golioth_rpc *golioth_rpc_init(struct golioth_client *client) | |||
return grpc; | |||
} | |||
|
|||
enum golioth_status golioth_rpc_deinit(struct golioth_client *client, struct golioth_rpc *grpc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can extract client
from grpc
so this function only needs one argument.
19334fc
to
724cfae
Compare
65aae50
to
89d18f7
Compare
The prefix indicates the type of observation and will be be used by the service APIs to cancel by service. Signed-off-by: Mike Szczys <[email protected]>
The prefix indicates the type of observation and will be be used by the service APIs to cancel by service. Signed-off-by: Mike Szczys <[email protected]>
Implement golioth_coap_client_cancel_observations_by_prefix() to wrap the functions provided by the ports. Signed-off-by: Mike Szczys <[email protected]>
Add golioth_rpc_deinit() function that cancels RPC observations and frees the RPC context struct (used to store the registered RPC paths/methods). Signed-off-by: Mike Szczys <[email protected]>
Update the test to use the RPC deinit API instead of the internal cancel observations function. Signed-off-by: Mike Szczys <[email protected]>
89d18f7
to
6fa46b1
Compare
resolves https://github.com/golioth/firmware-issue-tracker/issues/520