Try this: > handle = dev.open() > handle.setConfiguration(1) > handle.interruptWrite(2,"hello world")
But probably your device doesn't know what "hello world" means, some expect no side effect... Wander 2009/11/4 J.D. Main <jdm...@comcast.net>: > Hi folks, > > I was hoping to get a little snippet of code to help me query a USB > temperature sensor with Python. I have installed libusb-win32 (v1.12.2) and > pyusb (v0.4.2). I can sucessfully enumerate the device. Here's what it > looks like: > > Device: \\.\libusb0-0008--0x1dfd-0x0002 > Device class: 0 > Device sub class: 0 > Device protocol: 0 > Max packet size: 8 > idVendor: 7677 (0x1dfd) > idProduct: 2 (0x0002) > Device Version: 01.10 > Configuration: 1 > Total length: 41 > selfPowered: 0 > remoteWakeup: 0 > maxPower: 200 > Interface: 0 > Alternate Setting: 0 > Interface class: 3 > Interface sub class: 0 > Interface protocol: 0 > Endpoint: 0x81L > Type: 3 > Max packet size: 16 > Interval: 10 > Endpoint: 0x2L > Type: 3 > Max packet size: 16 > Interval: 10 > > I'm more used to working with serial ports than usb so I was hoping for a > very minimal amount of code to: > > 1. Instantiate the device > 2. Write a string ("hello world") > 3. Read the response > > I have gotten as far as: > > handle = dev.open() > handle.bulkWrite(0x81,"hello world") > > but then get an error: invalid endpoint 0x81 > > I'm clearly missing some steps or doing something wrong. Any help would > be greatly appreciated. > > Best Regards, > > J.D. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Pyusb-users mailing list > Pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Pyusb-users mailing list Pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users