Project Updates for 3/14/2013

So, for the past couple of days, I've been focusing on the Android code. There's a lot of learning to do, but as I gain a better understanding, I also understand new concepts that previously looked foreign to me.

Yesterday, I took some USB examples I found and figured how to integrate them into my code. It's not working yet (I had to comment out a bunch of the code), but it's closer. I ended up adding some code to request permission to use the device and that went ok.

Today, I ended up figuring out about interfaces and endpoints. You have devices, interfaces and endpoints that are in a tree hierarchy. By specifying Vendor ID and Product ID, you narrow down the specific device. From there, the device may have 1 or more interfaces. Each interface is like talking to a section of the board. For the Arduino Mega, I believe Interface 0 is to talk to the USB transfer chip and Interface 1 is to talk to the microcontroller itself, which is what I want.

From there, each interface has 1 or more endpoints. I've only seen 1-2, so I'm not sure if there are more. For my interfaces that have 2 endpoints, 1 is an input interface and the other is an output. I think you use these interfaces for sending and receiving data between the devices. Because the interfaces and endpoints are quite different in layout between the devices, I wrote some code that queries the arduino to get the information. I need to further write it to traverse the interfaces and endpoints and search for two endpoints that have a type of USB_ENDPOINT_XFER_BULK with one being USB_DIR_IN and the other being USB_DIR_OUT. That's about as far as I've researched. I still need to figure out how to actually use the endpoints to communicate with the Arduino, but I have some material to read to help me figure that out.

Posted in Old Posts 14 Mar 2013