how to get list of bluetooth devices using ExternalAccessory.framework

后端 未结 1 1859
走了就别回头了
走了就别回头了 2021-02-11 11:06

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

相关标签:
1条回答
  • 2021-02-11 11:54

    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.

    0 讨论(0)
提交回复
热议问题