On Friday 03 September 2004 2:53 am, Toralf Lund wrote:
> 
>    1. The USB 1.1 spec says "String descriptors use UNICODE encodings".
>       Which annoys me a great deal, as it fails to specify *what kind
>       unicode*. Should the string be in UTF-8 format, or 16 or 32-bit?

UTF16-LE, as it says somewhere in the spec.  The host must handle
any version of Unicode though (including 3.0, which starts to use
surrogate pairs).  The encoding (UTF) doesn't affect what kind of
Unicode you use.

By the way ... you should switch to using the 2.0 spec.


>    2. My string is shorter than the wLength (0xff), which is a situation
>       I suppose I need to handle specially, but I'm not sure I
>       understand exactly how. The spec also says (in section 9.4.3): "If
>       the descriptor is shorter than the wLength field, the device
>       indicates the end of the control transfer by sending a short
>       packet when further data is requested," but what exactly does this
>       mean?

When your descriptor is N bytes, and the host requests M bytes,
you must return MIN(N,M) bytes in one or more IN DATA
packets as requested by the host.

That "short packet" rule adds:  If that value is not M,
and it's an exact multiple of ep0 maxpacket size, then
you must also send a zero length IN DATA packet.

Then, as usual, the host sends an empty OUT DATA.


>       Should I assume that "further data is requested" when the 
>       2nd request is received?

No, that's an entirely separate request; when SETUP arrives,
forget about "completing" any previous request.  Even if
you want to send more IN DATA packets, or you're waiting
for the OUT DATA status (etc).





-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to