External Accessory Framework bluetooth pair. connectedAccessories every time count 0

天大地大妈咪最大 提交于 2019-12-11 13:36:43

问题


I want try read/write data with bluetooth

I try pairs:

Mac Book <-> iPod 4

custom device <-> iPod 4

I try this Apple sample (EADemo) https://developer.apple.com/library/ios/samplecode/EADemo/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010079

I created pair in the settings->bluetooth:

Mac Book <-> iPod 4 - ok (connected)

custom device <-> iPod 4 - ok (connected)

But

[[EAAccessoryManager sharedAccessoryManager] connectedAccessories]

always get array with count 0.

Any ideas?

Thanks.


回答1:


The EADemo is using the External Accessory framework and therefore needs a protocol string added into the info.plist of your project. This is what apple use to lock down connections to non MFi accessories. For more info check out the MFi program



来源:https://stackoverflow.com/questions/24474938/external-accessory-framework-bluetooth-pair-connectedaccessories-every-time-cou

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