【问题标题】:Listing My Bluetooth Devices iOS列出我的蓝牙设备 iOS
【发布时间】:2017-01-10 14:31:58
【问题描述】:

我想知道是否有办法编写一个应用程序来识别我 iPhone 上“我的设备”下的蓝牙设备。此外,我想列出当前连接或未连接的设备。

我曾与一位开发人员合作过,他声称它在任何 SDK 中都不可用。我觉得这很难相信。

我知道我可以扫描我附近的所有蓝牙设备,并且我已经开发了一个应用程序来做到这一点,但我仍然想列出我手机上的应用程序及其连接状态。

感谢您的宝贵时间。

【问题讨论】:

  • 没有得到正确的问题!!!你到底想要什么?您范围内启用蓝牙的设备列表?
  • 我想在“我的设备”下列出我手机上的蓝牙设备,并可以选择一个来监控其连接状态。

标签: ios bluetooth sdk


【解决方案1】:

你可以这样做,

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

你可以做扫描,

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


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


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

您可以参考This SO PostThis SO Post

【讨论】:

  • 谢谢科坦。我会看看这是否对我的开发人员有帮助。
猜你喜欢
  • 1970-01-01
  • 2013-01-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-26
  • 2018-02-27
  • 1970-01-01
  • 2017-03-17
相关资源
最近更新 更多