February 19th, 2012, 06:08 AM
|
#1 (permalink)
|
|
New Member
Thread Author (OP)
Join Date: Nov 2009
Posts: 5
Device(s):
Carrier: Not Provided
Thanks: 0
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 [1] 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 [1] 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.
import android.os.ParcelFileDescriptor;
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.
Thanks
[1] USB Accessory | Android Developers
|
|
|