Skip to content

Commit 1d4c6a7

Browse files
craffert0hardbyte
authored andcommitted
Do not incorrectly reset CANMsg.MSGTYPE on remote frame.
In `PcanBus.send()`, we initially set `msgType` based on all the flags of `msg`, including RTR. In the if/else for `self.fd`, we are incorrectly resetting it if rtr. We should not, and so we are no longer doing it.
1 parent 1f0fb8b commit 1d4c6a7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

can/interfaces/pcan/pcan.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,7 @@ def send(self, msg, timeout=None):
385385
CANMsg.MSGTYPE = msgType
386386

387387
# if a remote frame will be sent, data bytes are not important.
388-
if msg.is_remote_frame:
389-
CANMsg.MSGTYPE = msgType.value | PCAN_MESSAGE_RTR.value
390-
else:
388+
if not msg.is_remote_frame:
391389
# copy data
392390
for i in range(CANMsg.LEN):
393391
CANMsg.DATA[i] = msg.data[i]

0 commit comments

Comments
 (0)