如何使用 GameKit.framework 获取蓝牙范围内的设备列表?
我尝试使用 GameKit.framework 获取附近打开蓝牙的设备列表,这仅表明它正在搜索设备,但从未找到任何设备,并给出如下错误
BTM:附加到 BTServer
<强><<<会话>> +[GKBluetoothSupport _defineBluetoothStatus]:BT 不可用 - 稍后重试。
BTM:发布通知 BluetoothAvailabilityChangedNotification
知道这里发生了什么吗?
谢谢。
I have trying to get the list of devices nearby having their bluetooth ON using GameKit.framework, which just shows that it is searching for devices but never finds any and gives error as follows
BTM: attaching to BTServer
<<< Session >>> +[GKBluetoothSupport _determineBluetoothStatus]: BT not available - try again later.
BTM: posting notification BluetoothAvailabilityChangedNotification
Any idea whats happening here ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您无法搜索任何打开蓝牙的设备。
您需要创建一个带有会话 ID 的会话。运行该特定会话的任何设备都会显示。
检查来自 Apple 的代码游戏套件样本:
GKAuthenticate
GKRocket
<一个href="http://developer.apple.com/library/ios/#samplecode/GKTank/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008918" rel="nofollow">GKTank
<一个href="http://developer.apple.com/library/ios/#samplecode/GKTapper/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010283" rel="nofollow">GKTapper
i dont think you can search for any devices with their bluetooth on.
you need to create a session with a session id. Any devices withthat particular session running will show up.
Check code game kit samplesfrom apple:
GKAuthenticate
GKRocket
GKTank
GKTapper