-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Gap deprecation cleanup/rework #12730
Conversation
@LDong-Arm, thank you for your changes. |
daa67a1
to
05d83b8
Compare
rebased |
05d83b8
to
3480405
Compare
@pan- @evedon As per discussion, I have already made one agreed changed (remove get/set preferred connection params API) and created a ticket to reintroduce it in the correct form in the future. As for the other change (use new address types), it's being worked on but should not take too long. I've marked this PR as WIP in the title. |
8cf9023
to
2856adc
Compare
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.
Thanks Lingkai, it is very promising. I've noticed few improvements that could be applied here and there.
} | ||
break; | ||
case peer_address_type_t::RANDOM: | ||
if (!is_random_static_address(entry.address) |
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.
The condition can be replace by a test to is_random_private_non_resolvable_address
.
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.
Checking is_random_private_non_resolvable_address
alone doesn't guard against the scenario where the address value isn't even random.
It brings in another question: the old code only allowed public and random static, whereas the documentation of setWhitelist suggests resolvable private should also work. Were there any limitation that prevented us from whitelisting resolvable private addresses?
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.
There's not much reason of adding a resolvable private address to the list as it change very regularly, you want to put the real address obtained during pairing in the whitelist, the controller should ensure derived resolvable addresses are check against this address.
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.
I'll change it. With real addresses things would be simpler here.
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.
done
features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h
Show resolved
Hide resolved
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.
@pan- Thanks for the review, I'm working on addressing your comments.
} | ||
break; | ||
case peer_address_type_t::RANDOM: | ||
if (!is_random_static_address(entry.address) |
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.
Checking is_random_private_non_resolvable_address
alone doesn't guard against the scenario where the address value isn't even random.
It brings in another question: the old code only allowed public and random static, whereas the documentation of setWhitelist suggests resolvable private should also work. Were there any limitation that prevented us from whitelisting resolvable private addresses?
Test run: FAILEDSummary: 3 of 3 test jobs failed Failed test jobs:
|
CI lts not related to this PR, will be cleared and proper CI restarted after 5.15 PRs are all integrated |
Thanks. I'm still working on this PR and it's not ready for testing either. |
@pan- I've addressed your comments, please re-review (the few commits since last review). Regarding |
In ARMmbed/mbed-os#12730 we have removed legacy address-related types (BLEProtocol:: namespace) in favour of new once in ble:: namespace. This commit updates examples so they continue to work the latest Mbed OS.
In ARMmbed/mbed-os#12730 we have removed legacy address-related types (BLEProtocol:: namespace) in favour of new once in ble:: namespace. This commit updates examples so they continue to work the latest Mbed OS.
In ARMmbed/mbed-os#12730 we have removed legacy address-related types (BLEProtocol:: namespace) in favour of new once in ble:: namespace. This commit updates examples so they continue to work the latest Mbed OS.
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.
Thanks @LDong-Arm that looks very good, did you had the change to try it with ble-cliapp and the test suite ?
features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h
Show resolved
Hide resolved
The callback on_connected() in ConnectionEventMonitorEventHandler contains a parameter ConnectionParams_t which is superceded by ConnectionParameters. Since it's not used, remove it.
For actual connections, full ConnectionParameters is used. But as per BLE specification, Generic Access Service can display preferred connection parameters which is a smaller subset and ConnectionParams_t matches exactly. Thus we rename/repurpose it to PreferredConnectionParams_t.
9d4e9b1
to
50928fb
Compare
Rebased. As said before, this is pending manual testing. |
@0xc0170 Could we run CI while we are doing manual tests? |
CI started |
Test run: FAILEDSummary: 2 of 3 test jobs failed Failed test jobs:
|
@adbridge @0xc0170 CI failed because this PR has a "chicken-and-egg" dependency on ARMmbed/mbed-os-example-ble#290 |
I have tested the individual APIs using an updated |
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.
It looks good from all perspectives, thanks @LDong-Arm for your efforts on the test app and test suite!
This PR can be merged when CI pass.
ARMmbed/mbed-os-example-ble#290 is now merged, can we run CI on this PR and get it in so future tests won't break? Thanks |
CI started |
Test run: FAILEDSummary: 2 of 3 test jobs failed Failed test jobs:
|
Just fixed an issue in one of the examples: https://github.com/ARMmbed/mbed-os-example-ble/pull/294/files (merged). |
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
In ARMmbed/mbed-os#12730 we have removed legacy address-related types (BLEProtocol:: namespace) in favour of new once in ble:: namespace. This commit updates examples so they continue to work the latest Mbed OS.
Preceding PRs:
Remove Maxim and SoftDevice BLE stacks which do not support the latest APIs #12674Fix deprecated Gap type usages mbed-os-example-ble#289 - examples update that can and should get in before this major PR.(merged)In conjunction with
Summary of changes
LegacyGap
class and implementations. Mapble::Gap
to globalGap
.LegacyGap
) toGap
and implementations intoGenericGap
.BLEProtocol::
and replaceAddressType_t
withown_address_type_t
/peer_address_type_t
,AddressByte_t
withaddress_t
, etc.BLE::Address_t
(for accessing address types + values in whitelists) with the new equivalentwhitelist_t::entry_t
.ConnectionParams_t
->PreferredConnectionParams_t
and use it only for Generic Access Service.central_privay_configuration_t
->central_privacy_configuration_t
Notes:
setDeviceName()
,getDeviceName()
,setAppearance()
,getAppearance()
fromLegacyGap
are removed, as device name and appearance can be set viaAdvertisingDataBuilder
and saved by the application. But there were previously no deprecation warnings for them.get/setPreferredConnectionParams()
are dropped fromGap
- updated versions will be added to Gatt where they should belong to.Impact of changes
Legacy BLE Gap APIs and related type definitions are no longer available.
Some APIs have been updated to take parameters of new type definitions of address types + values.
Migration actions required
AdvertisingDataBuilder
and internally remember their values as needed, since APIs to get/set them are removed as explained above.Documentation
API documentation is generated with Doxygen. Examples quoted in documentation (e.g. this) are based on ARMmbed/mbed-os-example-ble which requires an update.
Pull request type
Test results
Manual testing
ble-cliapp
is updated to work with this PR and used to manually test APIs (by referencing Gap tests inble-tests
)Reviewers