USB Serial Driver – detect consumer on the other end?
Posted: Fri Aug 09, 2013 12:11 am
In my current project I'm quite successfully using the USB Serial Driver; apart from using it for a shell the system also emits various log messages. Now as long as there's a program consuming the transmitted bytes on the other ends everything is well. But it nothing reads from the USB Serial port write operations on the serial driver's sequential stream will block; which is a problem, because if message printing blocks the whole system eventually comes to a standstill.
Now I was wondering if there might be some way to detect if there's actually some program consuming the transmitted bytes on the USB host computer? The next best solution would be, that the USB Serial Driver offered some option to (silently) discard anything queued for submission if the transmit buffer is full (either hard, or by some timeout).
Is either in any way possible?
Now I was wondering if there might be some way to detect if there's actually some program consuming the transmitted bytes on the USB host computer? The next best solution would be, that the USB Serial Driver offered some option to (silently) discard anything queued for submission if the transmit buffer is full (either hard, or by some timeout).
Is either in any way possible?