0
votes

I have an app ("APP A") that connects to a Bluetooth device and discovers all of the services and characteristics required. I have another app ("APP B") that will attempt to call

 NSArray *connectedPeripheralArray = [centralManager retrieveConnectedPeripheralsWithServices:@[requiredUUID]];

and will retrieve the connected Bluetooth device (CBPeripheral) from the iOS system. Considering I previously discovered all the services and characteristics in "APP A", do I need to do it once again in "APP B" or can I just start using the services/characteristics as I wish?

P.S. The Bluetooth device is connected to iOS system the entire time after connects to "APP A".

Thanks!

1

1 Answers

1
votes

Yes, you need to perform the full discovery. I assume your plan was to hard-code the various device identifiers into App B? This will be unreliable as IDs can change over time.

You can rely on the underlying CoreBluetooth framework to cache information where appropriate.