From c2e6aad09f893e4c8cb5cb9243c32a0d6d0d1e12 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 9 Jun 2022 21:48:32 +0200 Subject: Init ESDS repository --- tests/simple_send_wlan0_1s2r/receiver.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/simple_send_wlan0_1s2r/receiver.py (limited to 'tests/simple_send_wlan0_1s2r/receiver.py') diff --git a/tests/simple_send_wlan0_1s2r/receiver.py b/tests/simple_send_wlan0_1s2r/receiver.py new file mode 100644 index 0000000..5b86500 --- /dev/null +++ b/tests/simple_send_wlan0_1s2r/receiver.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +def receive(node): + ##### Simple receive + code, data=node.receive("wlan0") + msg="Received: "+data if code == 0 else "Receive failed code="+str(code) + node.log(msg) + + +def execute(api): + # Should works for all receivers + receive(api) + + if api.node_id == 1: + receive(api) # Should works + else: + api.turn_off() + api.wait(1) # Node 2 should not receive anything during 1s + api.turn_on() + + + if api.node_id == 1: + receive(api) # Should works + else: + api.wait(0.5) # Check if started communication get cancelled on turning off + api.turn_off() # Node 2 should not receive anything + api.wait(0.5) # Node 2 should not receive anything during 0.5s + api.turn_on() + -- cgit v1.2.3