Skip to content

Commit

Permalink
raise exception on attempt to send CANFD on socketcan or pythoncan
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Feb 10, 2022
1 parent 832bce5 commit 680116c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dronecan/driver/python_can.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def receive(self, timeout=None):
except Exception as ex:
logger.error("Receive exception", exc_info=True)

def send(self, message_id, message, extended=False):
def send(self, message_id, message, extended=False, canfd=False):
if canfd:
raise DriverError('CANFD not supported by PythonCAN')
self._check_write_feedback()
try:
self._write_queue.put_nowait(CANFrame(message_id, message, extended))
Expand Down
4 changes: 3 additions & 1 deletion dronecan/driver/socketcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def receive(self, timeout=None):
self._rx_hook(frame)
return frame

def send(self, message_id, message, extended=False):
def send(self, message_id, message, extended=False, canfd=False):
if canfd:
raise DriverError('CANFD not supported by SocketCAN')
self._check_write_feedback()
try:
self._write_queue.put_nowait(CANFrame(message_id, message, extended))
Expand Down

0 comments on commit 680116c

Please sign in to comment.