-
Notifications
You must be signed in to change notification settings - Fork 675
Pass flags instead of flags_t type for USB2CAN #1252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| from can import BusABC, Message, CanInitializationError, CanOperationError | ||
| from .usb2canabstractionlayer import Usb2CanAbstractionLayer, CanalMsg, CanalError | ||
| from .usb2canabstractionlayer import ( | ||
| flags_t, | ||
| IS_ERROR_FRAME, | ||
| IS_REMOTE_FRAME, | ||
| IS_ID_TYPE, | ||
|
|
@@ -95,7 +94,7 @@ def __init__( | |
| channel=None, | ||
| dll="usb2can.dll", | ||
| flags=0x00000008, | ||
| *args, | ||
| *_, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
| ): | ||
|
|
@@ -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) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.