Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-sdk-tools by
Diff: host_tests/serial_nc_rx_auto.py
- Revision:
- 13:ab47a20b66f0
- Parent:
- 0:66f3b5499f7f
diff -r f2e8a005c7d3 -r ab47a20b66f0 host_tests/serial_nc_rx_auto.py
--- a/host_tests/serial_nc_rx_auto.py Tue Jun 14 11:33:06 2016 +0100
+++ b/host_tests/serial_nc_rx_auto.py Thu Jul 14 20:21:19 2016 +0100
@@ -25,6 +25,29 @@
def test(self, selftest):
selftest.mbed.flush();
+ # Wait 0.5 seconds to ensure mbed is listening
+ time.sleep(0.5)
+
+ #handshake with target to sync test start
+ selftest.mbed.serial_write("S");
+
+ strip_chars = string.whitespace + "\0"
+
+ out_str = selftest.mbed.serial_readline()
+
+ if not out_str:
+ selftest.notify("HOST: No output detected")
+ return selftest.RESULT_IO_SERIAL
+
+ out_str_stripped = out_str.strip(strip_chars)
+
+ if out_str_stripped != "RX OK - Start NC test":
+ selftest.notify("HOST: Unexpected output. Expected 'RX OK - Expected' but received '%s'" % out_str_stripped)
+ return selftest.RESULT_FAILURE
+
+ # Wait 0.5 seconds to ensure mbed is listening
+ time.sleep(0.5)
+
selftest.mbed.serial_write("E");
strip_chars = string.whitespace + "\0"
