Skip to content

aioble updates - generic attribute service/service changed #439

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

Closed
wants to merge 5 commits into from

Conversation

andrewleech
Copy link
Contributor

@andrewleech andrewleech commented Aug 17, 2021

This MR includes a few changes in a working branch.

  • aioble: Add support for write-with-update. #437
  • aioble: Add timeout to device.exchange_mtu()
  • aioble/security: Store secrets in list.
    • Ensure newest keys are stored at top to be used/loaded first.
  • aioble/server: Log warning on out-of-order indication.
  • aioble/service_changed: Add support for BLE service_changed.

Service Changed is an important feature for any project where the BLE pairing&bonding is used and services/characteristics could be changed, either from modifying application settings, to rolling out in-field updates.

Most BLE clients (eg android/ios phones) will cache the service discovery when bonded to a device. This means that if these are later changed on the device, the phone doesn't know about it and will send the wrong data to a different characteristic.

The BLE service: Generic Attribute Service contains a characteristic that can be indicated immediately after connection to tell the client that some/all the services/characteristics have changed and should be re-discovered.

For newer (BLE5.1) clients, there's a separate Database Hash characteristic that contains a hash of all services/characteristics configuration which the client can check directly and check against its stored hash for any change, also prompting re-discovery.

Both are supported in this change, however it needs the existing default gatt service entry removed with micropython/micropython#7675

jimmo and others added 4 commits July 23, 2021 15:13
Also present database_hash for newer devices.
@andrewleech
Copy link
Contributor Author

This change has been deprecated in favour of micropython/micropython#7877

@andrewleech andrewleech closed this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants