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

Add means for application to influence battery response to device status request #576

Closed
terrillmoore opened this issue May 12, 2020 · 0 comments
Assignees

Comments

@terrillmoore
Copy link
Member

Per @altishchenko in #560, we need a way to provide proper data for battery level in the DeviceStatusAns message.

The proposed approach (from here):

  • add LMIC_setBatteryLevel() (and LMIC_getBatteryLevel()) in header file (note slightly different name to os_getBattLevel()
  • add a private LMIC field to hold the recorded value
  • change LMIC initializations to initialize the default value of the private field to 0xFF (the value that indicates that the battery level is not known). Client is required to call LMIC_setBatteryLevel() after a re-initialization. I'm avoiding the question of "what happens at LMIC_reset()", because it's used internally as well as externally -- sorting that out requires some analysis.
  • change os_getBattLevel() so that it returns the private field. (The change to LMIC initialization ensures that behavior is unchanged for existing applications.)
  • update the documentation

Footprint impact of this would be minimal -- a byte of RAM and a few bytes of code for init and the change to os_getBattLevel().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant