mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-19 12:09:44 +00:00
Simplify the API: Now wired transmission are never aborted if receiver turned off. It will just not receive the data
This commit is contained in:
parent
1eee1ac81a
commit
33ffa0b6e0
5 changed files with 29 additions and 60 deletions
|
@ -3,13 +3,10 @@
|
|||
[t=1.000,src=n1] Received: Hello World!
|
||||
[t=1.000,src=n0] Send 1 bytes to n1 on eth0
|
||||
[t=2.000,src=n1] Receive 1 bytes on eth0
|
||||
[t=3.000,src=n0] Send 1 bytes to n1 on eth0
|
||||
[t=3.000,src=n0] Send 15 bytes to n1 on eth0
|
||||
[t=3.000,src=n1] Received: Hello World!
|
||||
[t=3.000,src=n1] Turned off
|
||||
[t=4.000,src=n1] Turned on
|
||||
[t=4.000,src=n0] Send 10 bytes to n1 on eth0
|
||||
[t=5.000,src=n1] Receive failed code=-1
|
||||
[t=5.000,src=n1] Turned off
|
||||
[t=6.000,src=n1] Turned on
|
||||
[t=7.000,src=n1] Receive failed code=-1
|
||||
[t=14.000,src=esds] Simulation ends
|
||||
[t=18.000,src=n0] End
|
||||
[t=18.000,src=esds] Simulation ends
|
||||
|
|
|
@ -10,17 +10,12 @@ def execute(api):
|
|||
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)
|
||||
##### Ensure data is not receive turned off but communication is not cancel
|
||||
##### Ensure data is not receive when turned off but communication must still be ongoing
|
||||
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)
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
def execute(api):
|
||||
api.send("eth0","Hello World!",1,1)
|
||||
api.send("eth0","Hello World!",1,1)
|
||||
api.wait(1) # Goto 3 seconds
|
||||
api.send("eth0","Hello World!",1,1)
|
||||
api.send("eth0","Hello World!",10,1,False) # Now communication should not be aborted even if receiver turned_off (e.g UDP)
|
||||
api.wait(1) # Goto t=3s
|
||||
api.send("eth0","Hello World!",15,1) # Communication should not be aborted even if receiver turned_off (e.g UDP)
|
||||
api.log("End") # Should be printed at t=18s
|
Loading…
Add table
Add a link
Reference in a new issue