how to get list of bluetooth devices using ExternalAccessory.framework

别来无恙 提交于 2020-01-12 06:23:52

问题


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


回答1:


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

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.

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);
}

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.



来源:https://stackoverflow.com/questions/11202161/how-to-get-list-of-bluetooth-devices-using-externalaccessory-framework

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!