Documentation for USB interface


I dont understand the USB interface regarding for eks this line of code…

controlConnection.controlTransfer(0x40, command, value, channel, null, 0, 5000);

<- picked fro this demo project (and same as for .net sdk code)

Where is the documentation for this interface. I cant figure according to normal sdk documentation. How is this connected to the documented serial protocol ?

regards Leif H.

Hello, Leif.

We did not write the code you are looking at, but it is similar to some of the code in the Pololu USB SDK. The code there serves as our main documentation of the Maestro’s USB interface.

Here is a link to the line you found: …

If you look up in that file you can see that “controlConnection” is of type UsbDeviceConnection, and looking at the imports at the top of the file the full name of that class is probably “android.hardware.usb.UsbDeviceConnection”. Using a search engine I was able to find the documentation of that function:

Basically it just performs a control transfer on the device. A control transfer is a specific type of interaction with a USB device that can be started by the host, and it includes some data going back and forth between the host and the device, depending on what type it is.

These control transfers form the native USB interface of the Maestro servo controllers. Some of them behave similarly to serial commands but there is no simple mapping between serial command codes and native USB command codes.


Thank you for explaining. I suspected this was the case to, but had to ask.

btw: I am trying to make some application sending servopositions from remote via a mobilphone (the phone act as a remote receiver) (i.e I have som nice software for commuication peer to peer between mobilephones / pc, etc over IP)

Can I use you code as a basis for sending commands between the receiver mobile and the servo controller?

(I maybe have to ask pryan1068)

Leif H.

Yes, I cannot give you permission to use that code you found; you would have to ask pryan1068. You could try making an Issue on github, or if you clone the repository to your computer with git then you can see if he put his email address in the commits as people usually do.