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

Feature: Add user callable agent cycler #441

Merged
merged 10 commits into from
Jun 21, 2022
Merged

Conversation

dachalco
Copy link
Contributor

@dachalco dachalco commented Jun 10, 2022

Description

Some users may not want to spawn a new thread just to run ota agent. To accommodate, a single-cycle function has been added that effectively runs a single iteration of the loop in OTA_EventProcessingTask.

Currently OtaAgentStateReady is used by the library to know when the ota processor task has started. This notion of task readiness is retained with the new function, where the agent is not OtaAgentStateReady until the OTA_EventProcess has been called for the first time in it's new, user defined, daemon.

State is returned from OTA_EventProcess as a potential for users to react to, or perhaps log, the ota agent state upon OTA_EventProcess return.

Caveats

Unfortunately, the library does not provide thread sync mechanisms in its PAL OSAL, so using both OTA_EventProcess and OTA_EventProcessingTask in an application is not thread safe. Perhaps an OTA user config should be added to make the two mutually exclusive in builds?

Checklist:

  • I have tested my changes. No regression in existing tests.
  • My code is formatted using Uncrustify.
  • I have read and applied the rules stated in CONTRIBUTING.md. n/a No such file.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dachalco dachalco marked this pull request as ready for review June 15, 2022 16:53
@dachalco dachalco force-pushed the feat-ota-process branch 2 times, most recently from 3852291 to 8cd029b Compare June 16, 2022 22:05
@dachalco dachalco requested a review from ravibhagavandas June 16, 2022 23:50
@dachalco dachalco added the enhancement New feature or request label Jun 16, 2022
@dachalco dachalco requested a review from ActoryOu June 16, 2022 23:53
@dachalco dachalco merged commit 042cabb into aws:main Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants