Skip to content

Commit e535a61

Browse files
committed
tests: Add simple CAN test.
1 parent 3550de4 commit e535a61

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

tests/pyb/can.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pyb import CAN
2+
3+
can = CAN(1)
4+
print(can)
5+
can.init(CAN.LOOPBACK)
6+
print(can.any(0))
7+
can.send('abcd', 123)
8+
print(can.any(0))
9+
print(can.recv(0))

tests/pyb/can.py.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CAN(1)
2+
False
3+
True
4+
(123, 0, 0, b'abcd')

0 commit comments

Comments
 (0)