Domanda

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?

È stato utile?

Soluzione

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.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top