Skip to content

Commit 56e40d2

Browse files
committed
Implement CANProtocol for the slcanBus
1 parent 091572b commit 56e40d2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

can/interfaces/slcan.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22
Interface for slcan compatible interfaces (win32/linux).
33
"""
44

5-
from typing import Any, Optional, Tuple
6-
75
import io
8-
import time
96
import logging
7+
import time
8+
from typing import Any, Optional, Tuple
109

11-
from can import BusABC, Message
10+
from can import BusABC, Message, CANProtocol
11+
from can import typechecking
1212
from ..exceptions import (
1313
CanInterfaceNotImplementedError,
1414
CanInitializationError,
1515
CanOperationError,
1616
error_check,
1717
)
18-
from can import typechecking
19-
2018

2119
logger = logging.getLogger(__name__)
2220

@@ -120,7 +118,12 @@ def __init__(
120118
self.open()
121119

122120
super().__init__(
123-
channel, ttyBaudrate=115200, bitrate=None, rtscts=False, **kwargs
121+
channel,
122+
ttyBaudrate=115200,
123+
bitrate=None,
124+
rtscts=False,
125+
protocol=CANProtocol.CAN_20,
126+
**kwargs,
124127
)
125128

126129
def set_bitrate(self, bitrate: int) -> None:

0 commit comments

Comments
 (0)