-
Notifications
You must be signed in to change notification settings - Fork 3k
Lora: Fix battery_level callback #6875
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
Conversation
Application can give battery_level callback method what Lora stack uses to query battery level for DevStatusReq MAC command response. The problem was that this callback was never called. This commit fixes this problem and if application does not set battery_level callback at all, value 255 (= The end-device was not able to measure the battery level.) will be returned to lora gateway.
@AnttiKauppila @hasnainvirk @kjbracey-arm please review. |
/morph build |
/** | ||
* Set battery level query callback | ||
*/ | ||
void set_batterylevel_callback(mbed::Callback<uint8_t(void)> battery_level); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this PR marked as a fix if this is a new API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoRaMac.h is LoRa internal API.
Application API for this in defined in lorawan_app_callbacks_t. Callback has been there already but lora stack just never called it.
Build : FAILUREBuild number : 1992 |
@studavekar Please review the failure, clean-up problem? /morph build |
Build : SUCCESSBuild number : 1995 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1648 |
This is built on top of changes targeted to 5.9 and thus will also need to go there. |
Description
Application can give battery_level callback method what Lora stack uses to query battery level for DevStatusReq MAC command response. The problem was that this callback was never called.
This commit fixes this problem and if application does not set battery_level callback at all, value 255 (= The end-device was not able to measure the battery level.) will be returned to lora gateway.
Target of this fix is mbed-os 5.9.
This has been tested with our internal lora tests.
Pull request type