Hey everyone,

I'm trying to write my first program with pyUSB.  I have already figured
out how to identify my device, open it, add it to a handle, close it and
claim it's interface.

Here's my situation:

The kernel recognizes my device ( a linksys cit200) as a device already
and it actually shows up as a plughw device.  The problem is the device is
not "activated"  My question is, do I have to claimInterface this device
to send/receive signals to it?  For now, I just want to see if I can
"enable/activate" it, so the mic/speaker will work on the thing.

Right now, in order for me to claim the interface, I have to
detachKernelDriver each interface (there are 4 of them, 3 alsa/sound, 1
hid), then setConfiguration, then claimInterface.  In doing so, I lose ...
it showing up as those devices.


Example Code:
---------------------------------------------
import usb

# linksys CIT200 Device Info
vendor_id = 5041
product_id = 29

buses = usb.busses()

for bus in buses :
for device in bus.devices :
  if device.idVendor == vendor_id :
    if device.idProduct == product_id :
  # found the CIT200
  linksys = device

# open device
handle = linksys.open()


# setup interface and configs ... there are 4 interfaces for this device...
config = linksys.configurations[0]
interface = config.interfaces[0][0]

# detach kernel drivers
handle.detachKernelDriver(0)
handle.detachKernelDriver(1)
handle.detachKernelDriver(2)
handle.detachKernelDriver(3)

# set configuration and claim interface(s?)
handle.setConfiguration(config)
handle.claimInterface(interface)
handle.setAltInterface(interface)
---------------------------------------------


Any help would be appreciated.  I will probably have a few more questions
to follow :)

Thanks

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pyusb-users mailing list
Pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to