如何在iOS中通过蓝牙获取配对设备列表? [英] How to get the list of the paired devices through Bluetooth in iOS?

查看:1978
本文介绍了如何在iOS中通过蓝牙获取配对设备列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是AppStore,所以我不想要任何私有框架。

It's for AppStore, so I don't want any private framework.

我想获得配对列表(甚至没有连接)。

I want to get the list of the paired(even not connected).

iOS中有核心蓝牙和外部附件框架。
我尝试了这两个,但没有列出任何内容。

There are Core Bluetooth and External Accessary frameworks in iOS. I tried both of these, but nothing listed.

推荐答案

Tyr使用这个,但我不确定它是否适用于离线设备。

Tyr to use this one but i'm not sure its working or not for offline devices.

创建EAAccessory对象并对其进行初始化。然后调用附件对象上的属性名称

Create EAAccessory object and initialize it. And then call the property name on your accessory object

NSArray *accessories = [[EAAccessoryManager sharedAccessoryManager] 
                        connectedAccessories]; 
EAAccessory *accessory = nil; 

for (EAAccessory *obj in accessories)
{ 
    NSLog(@"Found accessory named: %@", obj.name);
}

这篇关于如何在iOS中通过蓝牙获取配对设备列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆