From: Giles B. <gi...@gm...> - 2008-02-02 16:12:35
|
Hi - I've got PyUSB up and running and giving me basic data on the device I want to read and write to. What I have from the manufacturer is a protocol, basically a list of sequences of bytecodes. For instance, to turn the device on, you need to send: 02H (which I believe means hex, so 0x02) three 0x00 bytes 192 0x00 bytes and finally a 0x02 checksum byte I'm using this really cool USB missile launcher control code to work from: http://blog.taragana.com/index.php/archive/how-to-control-usb-missile-launcher-on-linux/ and that code contains some controlMsg calls. what I can't figure out is the arguments for controlMsg and how they map to to the sequence of bytes I need to transmit. I have this from the pydoc: controlMsg(requestType, request, buffer, value=0, index=0, timeout=100) are requestType and request constants within PyUSB? do I need to separate out the different pieces of my byte sequence or should they all just go in buffer? how do I choose whether my bytes go in buffer or value? -- Giles Bowkett Podcast: http://hollywoodgrit.blogspot.com Blog: http://gilesbowkett.blogspot.com Portfolio: http://www.gilesgoatboy.org Tumblelog: http://giles.tumblr.com |
From: Wander L. <wan...@gm...> - 2008-02-03 00:04:18
|
Hi Gilles, These parameters from controlMsg map directly from libusb parameters, which maps directly from USB control transfer specifications. To resume, most of these parameters go into specific fields into control packet. If your device supports control transfers, should exist some documention how it interprets each field... Wander 2008/2/2, Giles Bowkett <gi...@gm...>: > Hi - I've got PyUSB up and running and giving me basic data on the > device I want to read and write to. What I have from the manufacturer > is a protocol, basically a list of sequences of bytecodes. For > instance, to turn the device on, you need to send: > > 02H (which I believe means hex, so 0x02) > three 0x00 bytes > 192 0x00 bytes > and finally a 0x02 checksum byte > > I'm using this really cool USB missile launcher control code to work from: > > http://blog.taragana.com/index.php/archive/how-to-control-usb-missile-launcher-on-linux/ > > and that code contains some controlMsg calls. > > what I can't figure out is the arguments for controlMsg and how they > map to to the sequence of bytes I need to transmit. I have this from > the pydoc: > > controlMsg(requestType, request, buffer, value=0, index=0, timeout=100) > > are requestType and request constants within PyUSB? do I need to > separate out the different pieces of my byte sequence or should they > all just go in buffer? how do I choose whether my bytes go in buffer > or value? > > -- > Giles Bowkett > > Podcast: http://hollywoodgrit.blogspot.com > Blog: http://gilesbowkett.blogspot.com > Portfolio: http://www.gilesgoatboy.org > Tumblelog: http://giles.tumblr.com > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Giles B. <gi...@gm...> - 2008-02-03 01:35:07
|
On 2/2/08, Wander Lairson <wan...@gm...> wrote: > Hi Gilles, > > These parameters from controlMsg map directly from libusb parameters, > which maps directly from USB control transfer specifications. To > resume, most of these parameters go into specific fields into control > packet. If your device supports control transfers, should exist some > documention how it interprets each field... Hi Wander - awesome, thank you. So the question is basically how to access my device via USB control transfer. The device actually has an internal USB-to-serial converter, hopefully that's no obstacle though. -- Giles Bowkett Podcast: http://hollywoodgrit.blogspot.com Blog: http://gilesbowkett.blogspot.com Portfolio: http://www.gilesgoatboy.org Tumblelog: http://giles.tumblr.com |
From: Sarah M. <iku...@ya...> - 2008-02-03 01:38:32
|
Do a search for the USB and USBTMC specifications - you'll be doing byte-level manipulations to set up and keep track of the transfers. pyusb great works, but assumes you're familiar with the detailed specs. Wander Lairson <wan...@gm...> wrote: Hi Gilles, These parameters from controlMsg map directly from libusb parameters, which maps directly from USB control transfer specifications. To resume, most of these parameters go into specific fields into control packet. If your device supports control transfers, should exist some documention how it interprets each field... Wander 2008/2/2, Giles Bowkett : > Hi - I've got PyUSB up and running and giving me basic data on the > device I want to read and write to. What I have from the manufacturer > is a protocol, basically a list of sequences of bytecodes. For > instance, to turn the device on, you need to send: > > 02H (which I believe means hex, so 0x02) > three 0x00 bytes > 192 0x00 bytes > and finally a 0x02 checksum byte > > I'm using this really cool USB missile launcher control code to work from: > > http://blog.taragana.com/index.php/archive/how-to-control-usb-missile-launcher-on-linux/ > > and that code contains some controlMsg calls. > > what I can't figure out is the arguments for controlMsg and how they > map to to the sequence of bytes I need to transmit. I have this from > the pydoc: > > controlMsg(requestType, request, buffer, value=0, index=0, timeout=100) > > are requestType and request constants within PyUSB? do I need to > separate out the different pieces of my byte sequence or should they > all just go in buffer? how do I choose whether my bytes go in buffer > or value? > > -- > Giles Bowkett > > Podcast: http://hollywoodgrit.blogspot.com > Blog: http://gilesbowkett.blogspot.com > Portfolio: http://www.gilesgoatboy.org > Tumblelog: http://giles.tumblr.com > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Pyusb-users mailing list Pyu...@li... https://lists.sourceforge.net/lists/listinfo/pyusb-users -Sarah --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. |
From: Giles B. <gi...@gm...> - 2008-02-03 02:19:16
|
> Do a search for the USB and USBTMC specifications - you'll be doing > byte-level manipulations to set up and keep track of the transfers. pyusb > great works, but assumes you're familiar with the detailed specs. Googling it. Very much not familiar with the detailed specs, but willing to learn. :-) -- Giles Bowkett Podcast: http://hollywoodgrit.blogspot.com Blog: http://gilesbowkett.blogspot.com Portfolio: http://www.gilesgoatboy.org Tumblelog: http://giles.tumblr.com |