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

BLE: fix deprecated API calls in battery and thermometer services #10634

Merged
merged 1 commit into from May 23, 2019

Conversation

Projects
None yet
6 participants
@LDong-Arm
Copy link
Contributor

commented May 22, 2019

Description

Fix deprecated API warnings reported by ARMmbed/mbed-os-example-ble#180 (and a bit more)

Note: There're more warnings from URIBeanconConfig (deprecated) and UART (to be deprecated) services, but those should be simply suppressed instead. Will create a separate/independent PR for that.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@pan- @paul-szczepanek-arm

Release Notes

BLE services: update to use the latest APIs
Update BatterService and HealthThermometerService to use
up-to-date BLE APIs.

Note: HealthThermometerService::updateTemperature() will
not check GAP connection which should be taken care of by
the caller.

@ciarmcom ciarmcom requested review from pan-, paul-szczepanek-arm and ARMmbed/mbed-os-maintainers May 22, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@@ -72,10 +72,8 @@ class HealthThermometerService {
*
*/
void updateTemperature(float temperature) {
if (ble.getGapState().connected) {

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm May 22, 2019

Member

I guess this could be replaced by getConnectionCount()?

This comment has been minimized.

Copy link
@LDong-Arm

LDong-Arm May 22, 2019

Author Contributor

Good point. Unfortunately getConnectionCount() is not available anymore (reverted soon after it was first introduced), but a few deprecation notices still point to/recommend that. I guess it needs to be fixed as well.

This comment has been minimized.

Copy link
@LDong-Arm

LDong-Arm May 22, 2019

Author Contributor

This one removed getConnectionCount(): 61536c3

This comment has been minimized.

Copy link
@paul-szczepanek-arm

paul-szczepanek-arm May 22, 2019

Member

I don't know why it was removed. The variable backing it is still functional. @pan-?

This comment has been minimized.

Copy link
@pan-

pan- May 23, 2019

Member

I'm not sure it was intentionally removed; just a mistake when non backward compatible changes were reverted. #8738 has been wild.

This comment has been minimized.

Copy link
@pan-

pan- May 23, 2019

Member

So that's actually not required and application code doesn't have to ensure that it is connected before calling updateTemperature.

@pan-

pan- approved these changes May 23, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented May 23, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented May 23, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels May 23, 2019

@0xc0170 0xc0170 merged commit 86bd7f0 into ARMmbed:master May 23, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage Success
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8597 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.