summaryrefslogtreecommitdiff
path: root/tests/api_send_eth0_1s1r/receiver.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api_send_eth0_1s1r/receiver.py')
-rw-r--r--tests/api_send_eth0_1s1r/receiver.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/api_send_eth0_1s1r/receiver.py b/tests/api_send_eth0_1s1r/receiver.py
new file mode 100644
index 0000000..96305bf
--- /dev/null
+++ b/tests/api_send_eth0_1s1r/receiver.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+def execute(api):
+ ##### Simple receive
+ code, data=api.receive("eth0")
+ msg="Received: "+data if code == 0 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)
+ api.log(msg)
+ ##### Ensure data is not receive when turned off
+ 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)
+ api.log(msg)
+