Skip to content

Commit 264ff4f

Browse files
Merge pull request #158 from rasmuspeders1/nmtslave-update-heartbeat-on-command
Added on_command method in NmtSlave which calls update_heartbeat
2 parents 484c22d + 7d33ef9 commit 264ff4f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

canopen/nmt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ def __init__(self, node_id, local_node):
197197
self._heartbeat_time_ms = 0
198198
self._local_node = local_node
199199

200+
def on_command(self, can_id, data, timestamp):
201+
super(NmtSlave, self).on_command(can_id, data, timestamp)
202+
self.update_heartbeat()
203+
200204
def send_command(self, code):
201205
"""Send an NMT command code to the node.
202206

0 commit comments

Comments
 (0)