summaryrefslogtreecommitdiff
path: root/tests/api_receivet_eth0_1s1r/receiver.py
blob: 3869830c31de6c6b664bdfcbb06a3de583c672e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
from esds import RCode

def receivet(node,timeout):
    ##### Simple receive
    code, data=node.receivet("eth0",timeout)
    msg="Received: "+data if code == RCode.SUCCESS 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)