summaryrefslogtreecommitdiff
path: root/tests/api_send_eth0_1s1r/receiver.py
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-09-09 13:16:42 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-09-09 13:16:42 +0200
commitcfa677a0c678f742203aea601c6368768e5467da (patch)
treebe42cf52fc912a6ca78d334039d47cfb591e9e43 /tests/api_send_eth0_1s1r/receiver.py
parent57f020e09d738e283520e8cfc88b4cdd1aeaa551 (diff)
Debug synchronization + add return code
Diffstat (limited to 'tests/api_send_eth0_1s1r/receiver.py')
-rw-r--r--tests/api_send_eth0_1s1r/receiver.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/api_send_eth0_1s1r/receiver.py b/tests/api_send_eth0_1s1r/receiver.py
index ae1169c..b1332af 100644
--- a/tests/api_send_eth0_1s1r/receiver.py
+++ b/tests/api_send_eth0_1s1r/receiver.py
@@ -1,21 +1,22 @@
#!/usr/bin/env python
+from esds import RCode
def execute(api):
##### Simple receive
code, data=api.receive("eth0")
- msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
+ msg="Received: "+data if code == RCode.SUCCESS else "Receive failed code="+str(code)
api.log(msg)
##### Test if we still receive the data when we are not receiving
api.wait(2)
code, data=api.receive("eth0")
- msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
+ msg="Received: "+data if code == RCode.SUCCESS else "Receive failed code="+str(code)
api.log(msg)
##### Ensure data is not receive when turned off but communication must still be ongoing
api.turn_off()
api.wait(1)
api.turn_on()
code, data=api.receivet("eth0",1)
- msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
+ msg="Received: "+data if code == RCode.SUCCESS else "Receive failed code="+str(code)
api.log(msg)
##### Ensure communication get aborted on turned off for the sender
api.wait(28) # Goto t=33s