Hi,

I look back to the tutorial and I write the programme to get the
endpoint instances,
one is in and another is out.

 ep_in = usb.util.find_descriptor(

    intf,

    custom_match = \

    lambda e: \

        usb.util.endpoint_direction(e.bEndpointAddress) == \

        usb.util.ENDPOINT_IN

)

ep_out = usb.util.find_descriptor(

    intf,

    # match the first OUT endpoint

    custom_match = \

    lambda e: \

        usb.util.endpoint_direction(e.bEndpointAddress) == \

        usb.util.ENDPOINT_OUT

)

And when I try this:

 print(ep_out.read(64))

it does work and get some data from usb device. But when I try to write
something into the device, like this:

 buf = struct.pack("b",7)

 ep_in.write(buf)

it still got the timeout problem.


Cheers,

Tony



On 22 February 2013 01:05, Wander Lairson Costa <wander.lair...@gmail.com>wrote:

> 2013/2/21 Tony Liu <tonynoth...@gmail.com>:
> > Yes I put it after the find() function.
> > Do I need add other configuration functions?
> >
>
> I mean, the set_configuration method from Device class. Please, refer
> to the tutorial if you are in doubt.
>
> --
> Best Regards,
> Wander Lairson Costa
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>



-- 

*Tony*

Yinhua LIU

Electronic & Computer Engineering

University of Nottingham
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to