February 19th, 2012, 06:08 AM
Thread Author (OP)
Join Date: Nov 2009
Carrier: Not Provided
Thanked 0 Times in 0 Posts
USB Accessory on Android 2.3.4 Error / Not Error
I'm playing with USB Accessory mode and I have an error which is not an error so I'm confused. In the description  it shows that you have to set up a Broadcast Receiver to receive the permission to use the device.
I'm using a Microchip dev board so used their Firmware in the device and their Android app to start with and then branched out to use my own Android App and found that my Broadcast Receiver once it has the accessory in the example  and starts to set up the Comms with the device I get an error. Basically once I have the accessory I try to get a ParcelFileDescriptor to set up the comms.
ParcelFileDescriptor parcelFileDescriptor = deviceManager.openAccessory(accessory);
I'm finding that the ParcelFileDescriptor is null!
I thought it was my App so went back to the App supplied by Microchip and it has exactly the same problem but it is working away happily inspite of this. I'm confused as to why I'm adding this code if it's going to give me an error which I seem to be able to ignore. What is the correct way of establishing comms in this situation?
Anybody has any ideas I'd love to hear them.
 USB Accessory | Android Developers