You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading NMT messages under the heartbeat protocol, occasionally the highest bit is set for state. I believe this is resulting in a crash because bit 8 is set for the state (PRE-OPERATIONAL state is 0xFF instead of 0x7F for example):
File "/home/user/miniconda2/envs/abc/lib/python2.7/site-packages/canopen/nmt.py", line 103, in state
self.send_command(code)
File "/home/user/miniconda2/envs/abc/lib/python2.7/site-packages/canopen/nmt.py", line 138, in send_command
super(NmtMaster, self).send_command(code)
File "/home/user/miniconda2/envs/abc/lib/python2.7/site-packages/canopen/nmt.py", line 72, in send_command
NMT_STATES[self._state], NMT_STATES[new_state])
KeyError: 255
The CANopen docs in section 7.2.8.3.2.2 Protocol heartbeat say that bit 8 of slave state is a toggle bit which is toggled with two consecutive NMT messages, so seeing a slave send 0xFF for PRE-OPERATIONAL state could be expected.
If I understand the issue correctly, can we have the above error mask out the toggle bit?
The text was updated successfully, but these errors were encountered:
Hi, great library, thanks for the effort.
When reading NMT messages under the heartbeat protocol, occasionally the highest bit is set for state. I believe this is resulting in a crash because bit 8 is set for the state (PRE-OPERATIONAL state is
0xFF
instead of0x7F
for example):nmt.py
defines the codes for states as below 128The CANopen docs in section
7.2.8.3.2.2 Protocol heartbeat
say that bit 8 of slave state is a toggle bit which is toggled with two consecutive NMT messages, so seeing a slave send0xFF
for PRE-OPERATIONAL state could be expected.If I understand the issue correctly, can we have the above error mask out the toggle bit?
The text was updated successfully, but these errors were encountered: