问题
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