Skip to content

Commit

Permalink
Do not incorrectly reset CANMsg.MSGTYPE on remote frame.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
craffert0 authored and hardbyte committed Aug 17, 2019
1 parent 1f0fb8b commit 1d4c6a7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions can/interfaces/pcan/pcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,7 @@ def send(self, msg, timeout=None):
CANMsg.MSGTYPE = msgType

# if a remote frame will be sent, data bytes are not important.
if msg.is_remote_frame:
CANMsg.MSGTYPE = msgType.value | PCAN_MESSAGE_RTR.value
else:
if not msg.is_remote_frame:
# copy data
for i in range(CANMsg.LEN):
CANMsg.DATA[i] = msg.data[i]
Expand Down

0 comments on commit 1d4c6a7

Please sign in to comment.