how to get list of bluetooth devices using ExternalAccessory.framework

后端 未结 1 1124
说谎
说谎 2021-02-11 11:19

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:52

    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.

    UISupportedExternalAccessoryProtocols
    

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

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