[chbot] OT: Compiler help

Charles Manning manningc2 at actrix.gen.nz
Thu Jan 6 01:53:39 GMT 2011


On Thursday 06 January 2011 13:01:13 Andrew Errington wrote:
> On Thu, 06 Jan 2011 07:54:40 Charles Manning wrote:
> > That *might* work. It depends on how the code was written.
> >
> > Of course the superior solution is to just use libusb and make a Linux
> > version of the program.
> >
> > libusb should make this problem trial.
>
> Yes and no.  (I presume you mean 'trivial').

Yup, I did mean trivial, but it does seem a trial too :-).

>
> I intend to use PyUSB, which is an easy wrapper for libusb, but the problem
> I have is knowing how to construct the data packet for the device.
>
> I can currently use PyUSB to read from the device and I can see the state
> of the GPIO lines (they are input by default).
>
> To control the GPIO I need to send two bytes, a data-direction byte (one
> bit per GPIO to set input or output) and the output data byte.  I don't
> know the format of this data packet.  Is it two bytes, or are there some
> overhead bytes?  Which byte is the DDR, and which is the output?  I have
> /some/ information from the manufacturer, but not /this/ information. :(
>
> No regular software exists to control the GPIO, since no-one really uses
> the GPIO, so I can't just spy on some packets and parse them manually.  I
> have to run the test program, which will generate packets that control the
> GPIO, which I can then spy on.  I can't run the test program because it was
> compiled with the wrong product ID.  I can't compile the test program
> because I have no compiler.  I can't write my PyUSB program because I don't
> have the format of the data packet.
>
> And yes, I have asked the manufacturer for the specific information I need,
> but it is not forthcoming.  I consider myself lucky to have what I have,
> and actually it's enough if I can get it to work.

I re-read your doc and see the functions were in the library. Sorry, I thought 
those were in the source code.

You use one of those usb snoopers to figure out what is going on.

eg.
 http://benoit.papillault.free.fr/usbsnoop/
http://sourceforge.net/projects/usbsnoop/

-- Charles







More information about the Chchrobotics mailing list