NordicSemiconductor / Android-BLE-Library

A library that makes working with Bluetooth LE on Android a pleasure. Seriously.
BSD 3-Clause "New" or "Revised" License
1.98k stars 413 forks source link

What would cause GATT services to be invalidated on previously bonded peripherals? #534

Open david-gettins opened 9 months ago

david-gettins commented 9 months ago

After updating to v2.7.2 of the library, I started noticing onServicesInvalidated being called after connection and initialisation. This caused errors in our logic due to the collection of gatt services being emptied in the onServicesInvalidated override.

The peripheral in question had a firmware update by our hardware team using nRF Connect. Could this be the cause? Or is something else going on? The firmware update did not change any of the GATT services or characteristics available on the peripheral.

This has identified issues in our logic. We should re-discover services after they have been invalidated to resolve it. Am I correct that would be a sensible course of action after onServicesInvalidated is called?

Apologies there are a few questions in there...

philips77 commented 9 months ago

Do you have any logs from the log(...) method?

david-gettins commented 9 months ago

Unfortunately not. I am unable to reproduce it now. It only happened the first time I connected the peripherals to v2.7.2 after upgrading from v2.6.1. Like I said in the issue description, our peripherals were updated using a different device (i.e. not DFU on the phone), so I am investigating with our hardware team too.