External Access EAAccessoryManager connectedAccessories infrastructure returns only 1 accessory on iOS 4.2, when there should be more

Calling the connectedAccessories method in EAAccessoryManager returns a list with a single accessory (which is randomly selected from the available connected accessories on the Bluetooth screen) when running on iOS 4.2 using iPhone 3GS.

In retrospect, on iOS 5.0 on iPhone 4, the method returns the correct list of accessories (currently being tested to 2). According to the documentation, iOS 4.0 should return a list of accessories, however it is not mentioned whether this can contain more than one element. (Apparently, in iOS 3.0 only one WAS device is supported).

EAAccessoryDidConnectNotification notification also runs only once for a randomly selected accessory when running on iOS 4.0; Disabling an accessory results in the corresponding EAAccessoryDidDisconnectNotificiation value for this accessory. Re-enabling the accessory does not lead to further notifications without returning to the Bluetooth settings menu and reconnecting the device (but this is another unpleasant problem). A visit to the Bluetooth connection screen shows that the originally connected accessory is not disconnected, and my second accessory is connected, but further calls to the connectedAccessories method still return an empty list.

View console logs from your phone. I see that the Bluetooth system connects and controls both devices, but somewhere along the line it is not displayed through the external infrastructure.

If anyone has useful information on this issue, it would be great - it seems that only a small number of iOS developers who even worked with this structure, so finding something other than copies of the original documentation for Apple is quite difficult: -D.

Summarizing:

Is it possible to detect several accessories from iOS, as well as connect and open sessions for multiple devices. I found this to be possible in iOS 5.0 on iPhone 4.

Thanks a lot Chris

+4
source share

Source: https://habr.com/ru/post/1385519/


All Articles