A DTR line is used to signal that the host has configured a terminal and
is ready to transmit and receive data from the USB CDC/Serial device.
When this test suite is run with the use of a Linux host, a workaround has
to be used to overcome some platform specific DTR line behavior.
Every time the serial port file descriptor is opened, the DTR line is
asserted until the terminal attributes are set.
As a consequence, the device receives a premature DTR signal with a
duration of 200-500 us before the correct, long-lasting DTR signal set by
the host-side test script. (tested on the Linux kernel 4.15.0)
The solution is to wait for the first DTR spike, ignore it, and wait for
the correct DTR signal again.
Despite having ECHO and ECHOCTL POSIX lflags disabled by default by
pyserial, a delay is needed for host to properly handle data received
from USB serial/CDC device.
With no delay host would echo 0x00-0x31 characters prefixed with '^'.
Although the USB spec sets the upper limit on FS isochronous endpoint
payloads to 1023 B, this value is hard to test in practice. Moreover,
not all the targets Mbed OS supports (like NUCLEO_F207ZG) are able to
handle all the endpoints set to max.
Fix the host script issues present on Windows machines.
Add 0 B payload size to bulk endpoints test.
Update halt and abort tests according to PR comments.
Add an explicit request to start reading on OUT endpoints.
Remove the endpoint parameter from endpoint callbacks. This
information is redundant because endpoints are known at
construction time because they must be in the configuration
descriptor.
Fix the following warnings:
-[Warning] USBTester.cpp@45,0: #1299-D: members and base-classes will
be initialized in declaration order, not in member initialisation
list order
-[Warning] USBTester.h@41,0: #1300-D: ~USBTester inherits implicit
virtual
-[Warning] USBAudio.cpp@345,0: #1035-D: single-precision operand
implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0: #1300-D: ~AsyncSend inherits implicit
virtual
-[Warning] USBHID.cpp@61,0: #1300-D: ~AsyncRead inherits implicit
virtual
-[Warning] USBHID.cpp@93,0: #1300-D: ~AsyncWait inherits implicit
virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
you mean '<' ? [-Wint-in-bool-context]
Create the define MIN_DISCONNECT_TIME_US to be used as the amount of
time that must pass between connect and disconnect for the host to
reliably detect reconnection. Replace the wait calls delaying for this
value to wait_us to indicate the precision required. Finally, remove
the unnecessary calls to wait_ms in
repeated_construction_destruction_test.