> From: wander.lair...@gmail.com
> Date: Mon, 14 Jan 2013 21:37:02 -0200
> To: pyusb-users@lists.sourceforge.net
> Subject: Re: [pyusb-users] Overflow in bulkRead
>
> 2013/1/14 Alan Jhonn Aguiar Schwyn <alan...@hotmail.com>:
> >
> > I found the problem: I try to read 2 bytes, and the device was sending 3..
> >
> > And I test that: if you request 3 (and the device gives 2) no generates any
> > problem.. the size of returned package is 2..
> >
> > Why in the other case yes?
> >
>
> The device USB controller has already built a packet with 3 bytes, if
> you request less than that, the device cannot breaks the package down,
> so it fails.
Yes. When I say "2 bytes" i'm saying: 2 bytes + 3 bytes of header)In my code:
dev.read(READ_HEADER_SIZE + lenght)
>If you are not sure about how many bytes you should
> receive, it is often better to try to read "a packet size" bytes.
Ever read 3 bytes? And check if there are 3 or only 2?
> --
> Best Regards,
> Wander Lairson Costa
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users