Question

If I am reconnecting to a connected peripheral is it possible to get the peripheral advertisement data again? In other words, if I call retrieveConnectedPeripherals and receive the didRetrieveConnectedPeripherals event, how can I get the advertisement data for those peripherals?

Was it helpful?

Solution

The advertisement data is not stored by the framework. It can be obtained only by scanning, but you have a couple of options:

  1. If the peripheral is still advertising, then start scanning and capture the advertisement data. (Mind duplicate filtering if you did not stop scanning before connecting.)
  2. Capture the advertisement data keyed by the CBPeripheral object and reuse it when connected.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top