0

I'm trying to programmatically retrieve a list of paired bluetooth peripherals, the following is my code to do so, the code fires correctly, however it always comes back with an empty list.

[self.centralManager retrieveConnectedPeripherals];

- (void)centralManager:(CBCentralManager *)central didRetrieveConnectedPeripherals:(NSArray *)peripherals
{
    // peripherals is always empty here
}

Is this the correct way to retrieve the list of paired peripherals?

also according to the iOS developer library, the above method is deprecated, and I should be using retrieveConnectedPeripheralsWithServices instead.

the method has a parameter serviceUUIDs what is this, and how do I find out what to use?

Thanks.

George
  • 1,552
  • 1
  • 17
  • 26
  • Are you sure you want to work with Bluetooth Low-Energy ? Since you don't know what's a Service UUID, I guess you want "Classical Bluetooth", and that's not with CoreBluetooth.framework, but with ExternalAccesory.framework. – Larme Jan 29 '14 at 17:23
  • I'm using an open source plugin that is not doing what I expected. It is already using CoreBluetooth.framework, and I have no reason not to use it yet. what's the difference? – George Jan 29 '14 at 18:22
  • Bluetooth Low-Energy and "Classical Bluetooth" don't work the same way. CoreBluetooth.framework is ONLY for BLE. Same for ExternalAccessory and "Classical" Bluetooth (and MFI). See this: http://stackoverflow.com/questions/13469773/bluetooth-framework-for-older-ios-devices/13473954#13473954 – Larme Jan 29 '14 at 18:46

0 Answers0