Skip to content

Commit 51301fe

Browse files
committed
Implement CanProtocol for robotellBus
1 parent da89d35 commit 51301fe

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

can/interfaces/robotell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"""
44

55
import io
6-
import time
76
import logging
7+
import time
88
from typing import Optional
99

10-
from can import BusABC, Message
10+
from can import BusABC, Message, CanProtocol
1111
from ..exceptions import CanInterfaceNotImplementedError, CanOperationError
1212

1313
logger = logging.getLogger(__name__)
@@ -96,7 +96,7 @@ def __init__(
9696
)
9797
logger.info("Using device: %s", self.channel_info)
9898

99-
super().__init__(channel=channel, **kwargs)
99+
super().__init__(channel=channel, protocol=CanProtocol.CAN_20, **kwargs)
100100

101101
def set_bitrate(self, bitrate):
102102
"""

test/test_robotell.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

33
import unittest
4+
45
import can
56

67

@@ -14,6 +15,9 @@ def setUp(self):
1415
def tearDown(self):
1516
self.bus.shutdown()
1617

18+
def test_protocol(self):
19+
self.assertEqual(self.bus.protocol, can.CanProtocol.CAN_20)
20+
1721
def test_recv_extended(self):
1822
self.serial.write(
1923
bytearray(

0 commit comments

Comments
 (0)