2011/12/28 Stephen Conley <conle...@me.com>:
> Hi - I have a Python app talking to a Garmin GPS and it's actually working.
> What I am wondering is how should we deal with the read statement, without
> knowing if there is data to read.
>
> Basically I have a loop that continuously polls the in (both interrupt and
> bulk) ports looking for data to read.  If nothing is there an exception is
> generated (timeout exception) which I catch and continue looping.  Is there
> a better way?
>

Regards the timeout, there is not else you can do but catch the
exception and keep going. But you will might have trouble if you try
to send fewer bytes than is available in the device pipe buffer. Try
to read at least one packet size bytes.


-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to