-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lightdb: rework golioth_lightdb_observe*() on top of coap_req
This commit is phasing out direct CoAP dependency and low-level CoAP handling requirement when using lightdb observe API. Remove golioth_lightdb_observe() API, which would be reserved for synchronous equivalent of observations. It might be useful at some point to implement such variant, where first value from lightdb is fetched synchronously, but subsequent updates are handled with registered callback. There are no use-cases for such API now, so leaving it as possible future enhancement. Add new golioth_lightdb_observe_cb() callback based API, which is replacing existing golioth_lightdb_observe() API. This works similar to golioth_lightdb_get_cb() API, with the difference that update notifications are enabled for observed resource, hence registered callback will be executed after each notification is received. Update samples/lightdb/observe and samples/lightdb_led to new API. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
- Loading branch information
Showing
8 changed files
with
71 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.