3
3
Bus
4
4
---
5
5
6
- The :class: `~ can.Bus ` class, as the name suggests, provides an abstraction of a CAN bus.
6
+ The :class: `can.BusABC ` class, as the name suggests, provides an abstraction of a CAN bus.
7
7
The bus provides an abstract wrapper around a physical or virtual CAN Bus.
8
8
9
9
A thread safe bus wrapper is also available, see `Thread safe bus `_.
10
10
11
11
12
- Filtering
13
- '''''''''
14
-
15
- Message filtering can be set up for each bus. Where the interface supports it, this is carried
16
- out in the hardware or kernel layer - not in Python.
17
-
18
-
19
12
API
20
13
''''
21
14
22
15
.. autoclass :: can.BusABC
23
16
:members:
24
17
:special-members: __iter__
25
18
26
- .. autoclass :: can.interface.Bus
27
- :members:
28
- :special-members: __iter__
29
-
30
19
31
20
Transmitting
32
21
''''''''''''
33
22
34
- Writing to the bus is done by calling the :meth: `~can.BusABC.send() ` method and
35
- passing a :class: `~can.Message ` object .
23
+ Writing to the bus is done by calling the :meth: `~can.BusABC.send ` method and
24
+ passing a :class: `~can.Message ` instance .
36
25
37
26
38
27
Receiving
@@ -48,14 +37,21 @@ Alternatively the :class:`~can.Listener` api can be used, which is a list of :cl
48
37
subclasses that receive notifications when new messages arrive.
49
38
50
39
40
+ Filtering
41
+ '''''''''
42
+
43
+ Message filtering can be set up for each bus. Where the interface supports it, this is carried
44
+ out in the hardware or kernel layer - not in Python.
45
+
46
+
51
47
Thread safe bus
52
48
---------------
53
49
54
- This thread safe version of the :class: `~can.Bus ` class can be used by multiple threads at once.
55
- Sending and receiving is locked seperatly to avoid unnessesary delays.
50
+ This thread safe version of the :class: `~can.BusABC ` class can be used by multiple threads at once.
51
+ Sending and receiving is locked separately to avoid unnecessary delays.
56
52
Conflicting calls are executed by blocking until the bus is accessible.
57
53
58
- It can be used exactly like the normal :class: `~can.Bus `:
54
+ It can be used exactly like the normal :class: `~can.BusABC `:
59
55
60
56
# 'socketcan' is only an exemple interface, it works with all the others too
61
57
my_bus = can.ThreadSafeBus(interface='socketcan', channel='vcan0')
@@ -64,3 +60,11 @@ It can be used exactly like the normal :class:`~can.Bus`:
64
60
65
61
.. autoclass :: can.ThreadSafeBus
66
62
:members:
63
+
64
+ Autoconfig Bus
65
+ --------------
66
+
67
+ .. autoclass :: can.interface.Bus
68
+ :members:
69
+ :special-members: __iter__
70
+
0 commit comments