I am working on a project, in which our embedded system support both Android open accessory protocol and USB MTP. We came across a problem, where USB MTP doesn't work when AOAP session is established with Android device. I am lost basically, I don't know if it's even possible to have both working at the same time. Can anyone tell me, if it's possible to have both USB MTP and AOA session active? Also, I am looking for a AOA 2.0 specification? We currently have AOA stack from third party. From where can I get AOA specification? Thank you.
it is not possible to have two USB sessions simultaneously because of the internal USB protocol structure. USB devices like android phones can implement multiple device classes like mass storage class, RNDIS host (CDC class),.... often these device classes are defined on interface level . if you use linux check the output of lsusb -v
to see what interfaces are available and what interface is active.
in USB protocol only one interface can be active (afaik ! ). this is why you can not access the phone memory (mass storage class) or use ADB (ADB interface) when you are tethering (CDC class, defined on interface level), you have to switch the interface before. what you can do is switching the interface by code however then the host has to unload the kernel module / driver and load the new kernel module / driver, i.e if you switch from MTP USB interface to AOAP USB interface.
in general in USB protocol any communication is initiated by the host device (the accessory in this case) if you switch the USB interface on the device the host has to react and load the fitting kernel module / driver, see http://www.beyondlogic.org/usbnutshell/usb5.shtml. maybe check on the accessory what kernel modules / drivers are loaded