Get iOS to notice GATT profile update

I'm working on an app that communicates with an external BTLE device via CBCentralManager.


The app is able to DFU the peripheral to update its firmware. Sometimes, though not always, this means that the device's GATT profile changes. The problem I'm having is that after this happens, iOS seems to persist in using cached GATT information. Reconnecting to the device, or killing and relaunching the app, makes no difference.


An example: a characteristic size changes from 3 bytes to 4 bytes. The device sends 4 bytes, the app expects 4 bytes, but when didUpdateValueForCharacteristic is called, only 3 bytes are provided.


What does help is killing the app, then going to Settings --> Bluetooth, turning BT off, and then back on. In the above scenario, the next time the app runs it will get 4 bytes.


Is there anything I can or should be doing to get iOS to notice that things have changed, that it should stop using its cached GATT information?

Are you using the Service Changed characteristic to determine if iOS can rely on previously read (cached) information from the device?


See the Bluetooth 4.0 specification, Volume 3, Part G, Section 7.1 for more info.

Get iOS to notice GATT profile update
 
 
Q