Skip to content

Commit

Permalink
[dispatcher][pylibs][script] removing code that was mistakenly insert…
Browse files Browse the repository at this point in the history
…ed by Git during rebase to ot-ns/main.
  • Loading branch information
EskoDijk committed Sep 24, 2024
1 parent 0de3e3b commit 094757c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 47 deletions.
45 changes: 3 additions & 42 deletions dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,20 +696,9 @@ func (d *Dispatcher) advanceNodeTime(node *Node, timestamp uint64, force bool) {
return
}

msg := make([]byte, 11)
binary.LittleEndian.PutUint64(msg[:8], elapsed)
msg[8] = eventTypeAlarmFired
binary.LittleEndian.PutUint16(msg[9:11], 0)
node.SendMessage(msg)
node.CurTime = timestamp
if timestamp > oldTime {
node.failureCtrl.OnTimeAdvanced(oldTime)
}

d.alarmMgr.SetNotified(id)
d.setAlive(id)
if d.isWatching(id) {
simplelogger.Infof("Node %d >>> advance time %v -> %v", id, oldTime, timestamp)
msg := &Event{
Type: EventTypeAlarmFired,
Timestamp: timestamp,
}
node.sendEvent(msg) // move the OT-node's virtual-time to new time using an alarm msg.
}
Expand Down Expand Up @@ -875,34 +864,6 @@ func (d *Dispatcher) sendOneRadioFrame(evt *Event, srcnode *Node, dstnode *Node)
// send the event plus time keeping - moves dstnode's time to the current send-event's time.
dstnode.sendEvent(&evt2)
}

dstnode.Send(elapsed, sit.Data)
dstnode.CurTime = timestamp
if timestamp > oldTime {
dstnode.failureCtrl.OnTimeAdvanced(oldTime)
}

dstnodeid := dstnode.Id
d.alarmMgr.SetNotified(dstnodeid)
d.setAlive(dstnodeid)

if d.IsWatching(dstnodeid) {
if dstnode == srcnode {
simplelogger.Infof("Node %d >>> TX DONE", dstnodeid)
} else {
simplelogger.Infof("Node %d >>> received message from node %d", dstnodeid, srcnode.Id)
}
}
}

func (d *Dispatcher) newNode(nodeid NodeId, x, y int, radioRange int) (node *Node) {
node = newNode(d, nodeid, x, y, radioRange)
d.nodes[nodeid] = node
d.alarmMgr.AddNode(nodeid)
d.setAlive(nodeid)

d.vis.AddNode(nodeid, x, y, radioRange)
return
}

func (d *Dispatcher) sendMsgToHost(node *Node, evt *Event) {
Expand Down
4 changes: 0 additions & 4 deletions pylibs/otns/proto/visualize_grpc_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion script/setup-dev
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
PROTOBUF_VERSION=3.19.4
PROTOC_GEN_GO_VERSION=1.5.2
PROTO_GEN_GRPC_WEB_VERSION=1.3.1
GRPCIO_TOOLS_VERSION=1.46.3
GRPCIO_TOOLS_VERSION=1.53.0
GO_BINDATA_VERSION=3.0.7

skip_update='true'
Expand Down

0 comments on commit 094757c

Please sign in to comment.