2022-06-09 21:48:32 +02:00
|
|
|
#!/usr/bin/env python
|
2022-09-09 13:16:42 +02:00
|
|
|
from esds import RCode
|
2022-06-09 21:48:32 +02:00
|
|
|
|
|
|
|
def receivet(node,timeout):
|
|
|
|
##### Simple receive
|
|
|
|
code, data=node.receivet("eth0",timeout)
|
2022-09-09 13:16:42 +02:00
|
|
|
msg="Received: "+data if code == RCode.SUCCESS else "Receive failed code="+str(code)
|
2022-06-09 21:48:32 +02:00
|
|
|
node.log(msg)
|
|
|
|
|
|
|
|
def execute(api):
|
|
|
|
# Should works
|
|
|
|
receivet(api,2)
|
|
|
|
# Should failed
|
|
|
|
receivet(api,0.5) # At t=1.5s
|
|
|
|
# Should works (priorities says that communications should occurs before timeout)
|
|
|
|
receivet(api,0.5) # At t=2s (timeout+receive should occur)
|