Skip to content

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

Merged
merged 1 commit into from
May 14, 2018
Merged

Lora: Fix battery_level callback #6875

merged 1 commit into from
May 14, 2018

Conversation

kivaisan
Copy link
Contributor

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

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

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.
@kivaisan
Copy link
Contributor Author

@AnttiKauppila @hasnainvirk @kjbracey-arm please review.

@cmonr cmonr requested a review from kjbracey May 14, 2018 04:26
@cmonr
Copy link
Contributor

cmonr commented May 14, 2018

/morph build

/**
* Set battery level query callback
*/
void set_batterylevel_callback(mbed::Callback<uint8_t(void)> battery_level);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented May 14, 2018

@studavekar Please review the failure, clean-up problem?

/morph build

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

Build : SUCCESS

Build number : 1995
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6875/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

@cmonr cmonr merged commit 6db9a8b into ARMmbed:master May 14, 2018
@adbridge
Copy link
Contributor

This is built on top of changes targeted to 5.9 and thus will also need to go there.

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

Successfully merging this pull request may close these issues.

8 participants