PORTS Forum

Ports and Interfaces => USB => Topic started by: erich on November 23, 2011, 11:45:35 am

Title: Writing to USB device with Python using ioctl
Post by: erich on November 23, 2011, 11:45:35 am
Using Python, I am trying to write to a USB sensor using ioctl. I have loads of examples of reading from devices either directly or via pyusb, or simple file writes, but anything more complicated disappears off the radar.

I need to use a control_transfer to write Feature Report message

The command is ioctl(devicehandle, Operation, Args) The issue I have is determining the correct Operation. The Args, I believe should be a buffer containing the Feature Report for the device? plus a Mutable flag set to true

Any help or advice would be greatly received

I should add; the reason for using Python is the code must be device independent
Title: Re: Writing to USB device with Python using ioctl
Post by: Jan Axelson on November 23, 2011, 03:48:47 pm
You may need to ask here:

https://lists.sourceforge.net/lists/listinfo/pyusb-users

Jan
Title: Re: Writing to USB device with Python using ioctl
Post by: erich on November 23, 2011, 05:39:33 pm
Thanks - I already did. And on Twitter and Stackoverflow ;D

I just can't get my head around the  initiation of the message.
Title: Re: Writing to USB device with Python using ioctl
Post by: Jan Axelson on November 23, 2011, 06:39:22 pm
Show the source code you have so far.

Jan