Tag: 核心 蓝牙

如何在iOS中find蓝牙audio设备

好的,我正在做一个有趣的项目,有一个障碍,我需要为我的iOS应用程序启用蓝牙audio支持。 我所处的障碍是我根本无法获得连接的蓝牙audio设备列表。 即使我的iPhone 5S可以识别我的听筒(准确地说是一个3 – 4岁的LG HBM-230 ),并通过它来播放audio以进行通话,但是当我查询两者时, BOTH External Accessory和CoreBluetooth都没有什么用处。 我将自己的代码放在CoreBluetooth和External Accessory框架的问题和答案上。 当我的代码只是试图“ scanForPeripheralsWithServices:nil ”的任何蓝牙设备的设置 – >蓝牙说可见和连接,下面的代码只是不会有一个单一的命中超出控制台的“ CBCentralManagerStatePoweredOn ”消息。 和我的代码中的这一行(与一个有效的EAAccessoryManager实例) NSArray * connectedDevices = [self.eAAccessoryManager connectedAccessories]; 也返回一个零arrays。 我可能做错了什么? 顺便说一句, 我已经把这个代码作为一个GitHub项目 。 @implementation BluetoothManager + (BluetoothManager *)sharedInstance { static dispatch_once_t pred = 0; __strong static id _bluetoothMGR = nil; dispatch_once(&pred, ^{ _bluetoothMGR = [[BluetoothManager alloc] […]