Golioth Firmware SDK v0.23.0

Originally published at: Golioth Firmware SDK v0.23.0 - The Golioth Developer Blog

Today, we released v0.23.0 of the Golioth Firmware SDK. This release removes the synchronous API in favor of a single callback-based one, reworks the firmware update sample, and updates our Zephyr and nRF Connect SDK support. It also includes a long list of fixes, most of them on Zephyr. Several of the changes are breaking, so we recommend reading the changelog before upgrading. One API, No Suffix Until now, most SDK services came in two flavors. The _async functions queued a request and delivered the result to a callback. The _sync functions blocked the calling thread until a response arrived or a timeout expired. Two variants of nearly every function meant twice the surface to document, test and maintain. The synchronous variants also came with a trap: callbacks run on the client thread, so calling a blocking function from inside one could never work. In v0.23.0 the synchronous functions are gone and the _async suffix is dropped from the ones that remain. Code that already used the asynchronous API only needs a rename, since the parameters are unchanged. Code that used the synchronous API replaces the timeout with a callback and a callback argument: /* v0.22.0 / err = golioth_lightdb_set_int_sync(client, “counter”, counter, APP_TIMEOUT_S); / v0.23.0 */ err = golioth_lightdb_set_int(client, “counter”, counter, on_counter_set, NULL); The return value now only reports whether the request was queued. The result of the request itself is passed to the callback. Applications that really need to block can still do so by waiting for the callback, for example with a semaphore, as long as they are not waiting from inside another Golioth callback. A few functions need more than a rename. The typed LightDB State getters…