Closed szczys closed 1 year ago
Visit the preview URL for this PR (updated for commit 8741fb7):
https://golioth-zephyr-sdk-doxygen-dev--pr354-szczys-add-async-7dwul4nl.web.app
(expires Wed, 12 Apr 2023 16:28:03 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: a389eefadf4b4b68a539327b3459dd66c142cf49
@szczys I've merged first commit, which introduces async API. Second commit is still there. The issue I have with it is that it changes sync to async API use, so one is tested instead of the other. I think for this sample sync API makes more sense.
The issue I have with it is that it changes sync to async API use, so one is tested instead of the other.
This was also a concern of mine that both the sync and async be tested. In this commit, I have changed the initial firmware report to async, but sync is still used when reporting the other other states (DOWNLOADING
, DOWNLOADED
, UPDATING
).
The issue I have with this change is that it makes what is already a somewhat complex sample and adds more complexity, really just for the purpose of testing the async function. (It also demonstrates the function, but my intent was to include the new code into the existing testing routine.)
Maybe we should think about automated OTA testing (Hardware in the Loop via CI/CD) and move this change there?
The issue I have with this change is that it makes what is already a somewhat complex sample and adds more complexity,
Agree. Let's leave this sample minimal (and even simplify if possible).
Maybe we should think about automated OTA testing (Hardware in the Loop via CI/CD) and move this change there?
Definitely a good idea. We have a LightDB specific tests application, which invokes various APIs for that service: https://github.com/golioth/golioth-zephyr-sdk/tree/main/tests/lightdb. An equivalent for DFU would be great. In such dedicated application we can focus on using and testing all APIs, without keeping it easy for first-time users to understand.
This PR adds an asynchronous API that is safe to call from the system_client thread. This way the firmware state report can be made from the
golioth_on_connect()
callback.