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

Lora: Fix battery_level callback #6875

Merged
merged 1 commit into from May 14, 2018

Conversation

Projects
None yet
8 participants
@kivaisan
Contributor

kivaisan commented May 11, 2018

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
Lora: Fix battery_level callback
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

This comment has been minimized.

Contributor

kivaisan commented May 11, 2018

@cmonr cmonr requested a review from kjbracey-arm May 14, 2018

@cmonr cmonr added the needs: review label May 14, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented May 14, 2018

/morph build

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

This comment has been minimized.

@cmonr

cmonr May 14, 2018

Contributor

Why is this PR marked as a fix if this is a new API?

This comment has been minimized.

@kivaisan

kivaisan May 14, 2018

Contributor

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

This comment has been minimized.

mbed-ci commented May 14, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 14, 2018

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

/morph build

@mbed-ci

This comment has been minimized.

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

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 14, 2018

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

cmonr approved these changes May 14, 2018

@cmonr cmonr merged commit 6db9a8b into ARMmbed:master May 14, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 845 warnings (+0 warnings)
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9586 cycles (+569 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools Local tools testing has passed
Details
@adbridge

This comment has been minimized.

Contributor

adbridge commented May 18, 2018

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