简体   繁体   English

列出我的蓝牙设备iOS

[英]Listing My Bluetooth Devices iOS

I would like to know if there is a way to write an app to identify the Bluetooth devices under My Devices on my iPhone. 我想知道是否可以编写一种应用程序来识别iPhone上“我的设备”下的蓝牙设备。 Additionally, I would like to list which devices are currently connected or not. 另外,我想列出当前已连接或未连接的设备。

I have worked a bit with a developer and he claims it is not available in any SDK. 我曾与一位开发人员合作过,他声称它在任何SDK中均不可用。 I find this difficult to believe. 我觉得很难相信。

I know I can scan for all Bluetooth devices near me and I have developed an app to do that but I still want to also list the apps on my phone and their connection status. 我知道我可以扫描附近的所有蓝牙设备,并且我已经开发了一个应用程序来执行此操作,但是我仍然想列出手机上的应用程序及其连接状态。

Thanks for your time. 谢谢你的时间。

You can do something like, 你可以做类似的事情,

  NSArray *connectedAccessories = [[EAAccessoryManager sharedAccessoryManager] connectedAccessories];

For scan you can do, 您可以进行扫描

CBUUID *heartRate = [CBUUID UUIDWithString:@"180D"];


NSDictionary *scanOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];


[cm scanForPeripheralsWithServices:[NSArray arrayWithObject:heartRate] options:scanOptions]

You can refer This SO Post or This SO Post . 您可以参考此SO帖子此SO帖子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM