Protocol String name in EADemo Code

混江龙づ霸主 提交于 2020-01-12 19:07:12

问题


Whenever I connect the MFi accessory for the first time which protocols do I need to declare in the plist file and from where can I get it`s name?
Even after connecting my MFi accessory and running the EADemo code still it says that No Accessory Connected ?
I assume that the EADemo code will not work unless and until some proper accessory related protocol strings would be written instead of com.apple.p1 and com.apple.p2.

I know there is a class called EAAccessory and using the property protocolString, I can know the protocol String name.But in the first place even that requires a protocol string name listed in plist file in order to run the code.

Do I need to ask the manufacturer to know about the protocol string or is there any universal protocol that can work for all MFi accessories?


回答1:


MFI have a complicated process with Apple device, and sometimes the manufacturer didn't finished all the process. And base on your describe, the problem not just the protocolString is not right. the manufacturer needed much work to do. you should try another manufacturer's accessory.




回答2:


I tested deleting the Supported Accessories (which contains com.apple.p1 and com.apple.p2) and the EADemo sample app still detected connected accessories and allowed me to view the protocols that they support.

I didn't test sending data but as far as the above mentioned functionality is concerned, I saw identical behavior.

To answer your general question, yes, if you want to communicate with an ExternalAccessory you should specify the protocol of the accessory in your info plist.

I did some more googling but couldn't find many mentions of com.apple.p1. The only place I could find was in this project on GitHub. However, I think this may be a case of Cargo Cult Programming.

Or maybe the protocols do something and I just wasn't able to see a difference in behavior.



来源:https://stackoverflow.com/questions/8397538/protocol-string-name-in-eademo-code

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