怎样用ExternalAccessory.framework蓝牙设备的列表 [英] how to get list of bluetooth devices using ExternalAccessory.framework

查看:1210
本文介绍了怎样用ExternalAccessory.framework蓝牙设备的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

怎样用ExternalAccessory.framework不使用Gamekid架构,核心架构蓝牙蓝牙设备的列表。请给我写code的examp0le

how to get list of bluetooth devices using ExternalAccessory.framework not using Gamekid framework, core bluetooth framework. please write me examp0le of code

推荐答案

外部附件框架只得到列表苹果设备...苹果

The External Accessory framework is only get list apple devices...By Apple

外部附件框架被设计为允许iOS应用程序
  以只与下制定的五金配件沟通
  苹果MFI许可程序。 MFI配件兼容可
  作为有线设备实现的,这意味着它们插入到iOS设备的
  30针连接器,或者作为无线设备,由此它们使用蓝牙
  作为通信信道。无论哪种方式,使用该应用程序
  外部附件框架将不会通知附件的的
  presence除非附件自身标识为是MFI
  柔顺的,即,它是专门设计使用iOS接口
  应用程序。

The External Accessory framework is designed to allow iOS applications to communicate only with hardware accessories that are developed under Apple's MFi licensee program. MFi compliant accessories can be implemented as wired devices, meaning they plug in to the iOS device's 30-pin connector, or as wireless devices, whereby they use Bluetooth as the communication channel. Either way, an application that uses the External Accessory framework will not be notified of an accessory's presence unless the accessory identifies itself as being MFi compliant, i.e., it was specifically designed to interface with an iOS application.

如果你想只得到列表中的苹果设备使用示例code

if you want get the list only apple device use sample code

NSArray *accessories = [[EAAccessoryManager sharedAccessoryManager] 
                        connectedAccessories]; 
for (EAAccessory *obj in accessories)
{ 
    NSLog(@"Found accessory named: %@", obj.name);
}

您必须在您的应用程序的Info.plist文件中UISupportedExternalAccessoryProtocols键。

you must include the UISupportedExternalAccessoryProtocols key in your app’s Info.plist file.

<key>UISupportedExternalAccessoryProtocols</key>

此键包含标识通信协议的字符串数组,你的应用程序支持。

This key contains an array of strings that identify the communications protocols that your app supports.

这篇关于怎样用ExternalAccessory.framework蓝牙设备的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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