Commit Graph

12 Commits (feature-hal-spec-usb-device)

Author SHA1 Message Date
Filip Jagodzinski aab52fc2a6 Tests: USB: DTR fix for Linux hosts
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.
2019-01-29 12:27:32 -06:00
Russ Butler 3b4dd6b385 Tests: USB: Increase serial open retries
Double the number of attempts that are made to open a serial port.
This makes tests run more reliably on Windows.
2019-01-29 12:27:32 -06:00
Russ Butler bcca3ed2a5 Tests: USB: Use DTR to make Serial tests reliable
Update the serial host test to set DTR low before opening a serial
port. Set DTR high once the serial object is ready. This ensures that
no data is sent by the device until the host is ready.
2019-01-29 12:27:32 -06:00
Filip Jagodzinski 13ab89337e Tests: USB: Increas the size of RX CDC test data
This ensures the flow control is tested.
2019-01-29 12:27:32 -06:00
Filip Jagodzinski e954f7866e Tests: USB: Fix Windows USB SN handling 2019-01-29 12:27:32 -06:00
Filip Jagodzinski 9387165f8c Tests: USB: Update code comments 2019-01-29 12:27:32 -06:00
Filip Jagodzinski 7684ffd8b9 Tests: USB: Use SN generated by the host machine 2019-01-29 12:27:32 -06:00
Filip Jagodzinski b6ed7aaab1 Tests: USB: Wait before closing host's port
This delay eliminates the possibility of the device detecting the port
being closed when still waiting for data.
2019-01-29 12:27:31 -06:00
Filip Jagodzinski 0f5c285182 Tests: USB: Add Serial test for line coding change 2019-01-29 12:27:31 -06:00
Filip Jagodzinski 30af468d86 Tests: USB: Use the serial number to find device
Use the USB device SN instead of VID & PID to find the device port name
on the host system.
2019-01-29 12:27:31 -06:00
Filip Jagodzinski 776167a55f Tests: USB: Add tests for Serial class. 2019-01-29 12:27:31 -06:00
Filip Jagodzinski ba44260fe7 Tests: USB: Add tests for CDC class. 2019-01-29 12:27:31 -06:00