iosexternal-accessorymfi

MFI Accessory communicate with App via USB


How to communicate with MFI Accessory communicate via USB?

Here's what I've got.

  1. My MFI accessory, other company's MFI accessory and protocol names enter image description here

  2. EADemo(An Apple official Accessory Demo)

Here's what I've done.

  1. add protocol name toSupported external accessory protocols in EADemo-Info.plist of the EADemo.

  2. 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?


Solution

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

    1. Add protocols supported by MFI to Info.plist Supported external accessory protocols.

    2. Connect your MFI accessory to iOS device.

    3. 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.