blob: 515ff6ae55ff706d4cbaf5e2d1593b68ab4e36ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/env python
def receivet(node,timeout):
##### Simple receive
code, data=node.receivet("eth0",timeout)
msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
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)
|