How to communicate with MFI Accessory communicate via USB?
Here's what I've got.
My MFI
accessory, other company's MFI
accessory and protocol names
EADemo(An Apple official Accessory Demo)
Here's what I've done.
add protocol name toSupported external accessory protocols
in EADemo-Info.plist of the EADemo.
Run EADemo with other accessory, send data, text of receivedBytesLabel keep changing.
When I run EADemo with my accessory, click send data, nothing changes in UI.
My colleague(a hardware developer) says I should set interface(like changing a communicate tunnel) after connecting to accessory, so that I can communicate with accessory. But I look up EASession and ExternalAccessory document, I can't find some method that would allow me to change interface. I don't know if it's my problem not setting interface, or it's a problem of the accessory?
How can my App communicate with a MFI accessory?
As nobody has experienced this situation. I'll explain how to communicate with MFI accessory in normal way and what leads to my situation
Usually If you wanna use MFI device, you just need to do the following steps:
Add protocols supported by MFI to Info.plist Supported external accessory protocols
.
Connect your MFI accessory to iOS device.
That's it. You can see data change status on screen.
Note:
Those procedure are base on Apple official project EADemo
, you can download from the official site.
Here's what I've been experienced:
The MFI accessory support 2 protocols, one is for connection event, the other one is data exchange(like my colleague said before, there should be 2 interface). But the manufacture didn't give the specific document. So when I connect one protocol, of course there's no data exchanging. So I connect the first protocol, and step back, connect to the second one. It works, there's data exchange status on screen.