检索在iOS中通过蓝牙连接的配对设备 [英] Retrieve paired devices which are connected through bluetooth in iOS
问题描述
我已连接条形码扫描仪设备
I have connected Barcode Scanner device
我想知道它的配对状态.是否与设备连接.
I want to know the paired status of it. Whether it is connected with device or not.
- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
self.connectingPeripheral = peripheral;
NSLog(@"@@@@@@Peripheral Name is:%@ Identifier:%@ Services:%@",peripheral.name,peripheral.identifier,peripheral.services);
[self.bluetoothManager connectPeripheral: self.connectingPeripheraloptions: nil];
}
我正在获取附近且已启用的Mac的信息.但是我没有通过此方法获取条形码扫描仪信息.
I am getting information about Mac's which are nearby and enabled. But I am not getting Barcode Scanner information in this Method.
我需要是否将条形码扫描仪连接到设备.
I need whether barcode scanner is connected to device or not.
任何人都可以建议如何找到条形码扫描仪的连接性.
can anyone suggest how to find connectivity of barcode scanner.
感谢您的回复,谢谢.
推荐答案
阅读以下答案:
https://stackoverflow.com/a/11128869/5178107
可能会帮助您.而且,CoreBluetooth仅允许您访问低功耗蓝牙设备.如果需要加密,则可以配对这些设备,但通常不需要.但是,没有API可以列出已配对的设备-您需要发现提供感兴趣的服务的设备并列出列表,如果需要,可以在应用程序中使用自己的UI.确定目标设备后,即可启动连接.
Might help you. More over, CoreBluetooth only allows you to access Bluetooth Low Energy devices. You can pair these devices if you need encryption but typically you don't. However, there is no API to list the paired devices - you need to discover the device(s) that are offering the service you are interested in and present a list, if necessary using your own UI in your app. Once you have identified the target device you can initiate a connection.
这篇关于检索在iOS中通过蓝牙连接的配对设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!