mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-09 14:55:22 +00:00
21 lines
653 B
Python
21 lines
653 B
Python
![]() |
#!/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)
|
||
|
|