Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions can/interfaces/usb2can/usb2canInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from can import BusABC, Message, CanInitializationError, CanOperationError
from .usb2canabstractionlayer import Usb2CanAbstractionLayer, CanalMsg, CanalError
from .usb2canabstractionlayer import (
flags_t,
Comment thread
felixdivo marked this conversation as resolved.
IS_ERROR_FRAME,
IS_REMOTE_FRAME,
IS_ID_TYPE,
Expand Down Expand Up @@ -95,7 +94,7 @@ def __init__(
channel=None,
dll="usb2can.dll",
flags=0x00000008,
*args,
*_,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional style change, this documents that all additional positional arguments get ignored but won't throw an exception when passed in.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's fine. We don't have a unified handling of that case anyways.

bitrate=500000,
**kwargs,
):
Expand All @@ -118,11 +117,9 @@ def __init__(
self.channel_info = f"USB2CAN device {device_id}"

connector = f"{device_id}; {baudrate}"
self.handle = self.can.open(connector, flags_t)
self.handle = self.can.open(connector, flags)

super().__init__(
channel=channel, dll=dll, flags_t=flags_t, bitrate=bitrate, *args, **kwargs
)
super().__init__(channel=channel, **kwargs)

def send(self, msg, timeout=None):
tx = message_convert_tx(msg)
Expand Down