Re: [PATCH] USB: add USB test and measurement class driver - round 2

From: Oliver Neukum
Date: Fri Aug 29 2008 - 04:33:20 EST


Am Freitag 29 August 2008 10:14:46 schrieb stefan_kopp@xxxxxxxxxxx:
> USBTMC has a different concept, the "termination character". If this is enabled and set to the appropriate character (usually /n), the read operation will be terminated by the device automatically. The last character in the response will be the termination character. Note, however, this capability is optional (not every vendor supports it) and even if it is supported, is might be deactivated (for good reason, e.g. for transfer of binary data).
>
> If you are not using the termination character, the device will typically send its full output buffer contents. Usually, this works just fine because communication with the device is transactional, one query followed by a response, then another query, followed by another response, and so on.
>
> The driver does return the number of characters received in both cases (with or without use of the term character feature).

But how do you learn in user space how many characters the device actually
did send? Using read() you'll only learn that the answer was shorter than
you asked for. If you get the amount you expected the answer may have
been as long as you expected or longer. How do you find out whether the answer
was longer?

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/