diff options
Diffstat (limited to 'tests/simple_send0_eth0_1s1r/receiver.py')
| -rw-r--r-- | tests/simple_send0_eth0_1s1r/receiver.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/simple_send0_eth0_1s1r/receiver.py b/tests/simple_send0_eth0_1s1r/receiver.py new file mode 100644 index 0000000..3f7a7db --- /dev/null +++ b/tests/simple_send0_eth0_1s1r/receiver.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +def receive(api): + ##### Simple receive + code, data=api.receive("eth0") + msg="Received: "+data if code == 0 else "Receive failed code="+str(code) + api.log(msg) + +def execute(api): + receive(api) + # Simulated time t=0s here + receive(api) + # Simulated time t=0s here + receive(api) + # Simulated time t=1s here + receive(api) + # Simulated time t=3s here + code, data=api.receivet("eth0",0) + msg="Received: "+data if code == 0 else "Receive failed code="+str(code) + api.log(msg) + # Simulated time t=3s here + + |
