Craig, in that case, what should the changed attributes range be? My new firmware has no idea what the old GATT database looked like.
Thanks
Nick Brook
It is correct behavior to send a service changed indication after reconnection if the services/characteristics have changed while disconnected. Your device should send the indication as quickly as possible after a reconnection to prevent apps from receiving the cached service database.
- Craig On Feb 6, 2017, at 10:56 AM, Nick Brook < email@hidden> wrote:
Ah, a bit more Googling and I think I have found the answer.
The answer is that the accessory needs to support the GATT Service Changed characteristic - please read the specification, specifically Vol 3, Part G, 2.5.2, and Vol 3, Part G, 7.1.
The spec says:
If GATT based services on the
server cannot be changed during the usable lifetime of the device, the Services
Changed characteristic shall not exist on the server and the client does not
need to ever perform service discovery after the initial service discovery for that
server.
My initial testing is showing that the presence of this characteristic is disabling the cache, however I’m hesitant to remove our ‘toggle bluetooth’ requirement unless I know for sure I won’t see problems with caching in the field. Could anyone confirm that the presence of this characteristic does in fact disable the attribute cache?
Thanks
Nick Brook
Hi,
After completing an OTA firmware update to my device, the device restarts and iOS reconnects. If the GATT attributes change in the update, reconnection sometimes fails as iOS is using a cache of the attributes from before the update. Currently our solution is asking the user to turn Bluetooth off and on – not ideal.
Is there any way to force iOS to clear this cache? I can’t use the Service Changed characteristic (0x2a05) in the Generic Attribute Service (0x1801) as the service ‘changes' when the device is disconnected.
Thanks
Nick Brook
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|