Of course, sorry I didn't do that before. Here it is
import usb.core
import usb.util
import usb
# find our device
dev = usb.core.find(idVendor=0x0590, idProduct=0x0028)
dev.baudrate=4800
#detach kernel (this was necessary sometimes with the other device)
try:
dev.detach_kernel_driver(0)
except Exception, e:
pass # already unregistered
# check if it was found
if dev is None:
raise ValueError('Device not found')
st1=[0x07,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] #Command
dev.set_configuration()
#Find endpoints (i know they are right because their addresses match the
manufacturer specifications)
ep_out = usb.util.find_descriptor(
dev.get_interface_altsetting(), # first interface
# match the first OUT endpoint
custom_match = \
lambda e: \
usb.util.endpoint_direction(e.bEndpointAddress) == \
usb.util.ENDPOINT_OUT
)
ep_in = usb.util.find_descriptor(
dev.get_interface_altsetting(), # first interface
# match the first IN endpoint
custom_match = \
lambda e: \
usb.util.endpoint_direction(e.bEndpointAddress) == \
usb.util.ENDPOINT_IN
)
a=ep_out.write(st1, timeout=2000)
And here after 2000 I get "timeout exception", so it is not able to write
the command in the endpoint.
Thank you again.
*
--
Begoña Fuentes*
2010/11/2 wander.lairson <wander.lair...@gmail.com>
> > Do you think that it could be related with the fact that the cables from
> > both devices are different?
>
> I don't think so. Could you please post the source code in the list?
>
> --
> Best Regards,
> Wander Lairson Costa
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users