@@ -35,7 +35,7 @@ These steps are a guideline on how to add a new backend to python-can.
3535- Create a module (either a ``*.py `` or an entire subdirectory depending
3636 on the complexity) inside ``can.interfaces ``
3737- Implement the central part of the backend: the bus class that extends
38- :class: `can.BusABC `. See below for more info on this one!
38+ :class: `can.BusABC `. See :ref: ` businternals ` for more info on this one!
3939- Register your backend bus class in ``can.interface.BACKENDS `` and
4040 ``can.interfaces.VALID_INTERFACES `` in ``can.interfaces.__init__.py ``.
4141- Add docs where appropriate. At a minimum add to ``doc/interfaces.rst `` and add
@@ -44,53 +44,6 @@ These steps are a guideline on how to add a new backend to python-can.
4444- Add tests in ``test/* `` where appropriate.
4545
4646
47- About the ``BusABC `` class
48- --------------------------
49-
50- Concrete implementations *have to * implement the following:
51- * :meth: `~can.BusABC.send ` to send individual messages
52- * :meth: `~can.BusABC._recv_internal ` to receive individual messages
53- (see note below!)
54- * set the :attr: `~can.BusABC.channel_info ` attribute to a string describing
55- the underlying bus and/or channel
56-
57- They *might * implement the following:
58- * :meth: `~can.BusABC.flush_tx_buffer ` to allow discarding any
59- messages yet to be sent
60- * :meth: `~can.BusABC.shutdown ` to override how the bus should
61- shut down
62- * :meth: `~can.BusABC._send_periodic_internal ` to override the software based
63- periodic sending and push it down to the kernel or hardware.
64- * :meth: `~can.BusABC._apply_filters ` to apply efficient filters
65- to lower level systems like the OS kernel or hardware.
66- * :meth: `~can.BusABC._detect_available_configs ` to allow the interface
67- to report which configurations are currently available for new
68- connections.
69- * :meth: `~can.BusABC.state ` property to allow reading and/or changing
70- the bus state.
71-
72- .. note ::
73-
74- *TL;DR *: Only override :meth: `~can.BusABC._recv_internal `,
75- never :meth: `~can.BusABC.recv ` directly.
76-
77- Previously, concrete bus classes had to override :meth: `~can.BusABC.recv `
78- directly instead of :meth: `~can.BusABC._recv_internal `, but that has
79- changed to allow the abstract base class to handle in-software message
80- filtering as a fallback. All internal interfaces now implement that new
81- behaviour. Older (custom) interfaces might still be implemented like that
82- and thus might not provide message filtering:
83-
84- This is the entire ABC bus class with all internal methods:
85-
86- .. autoclass :: can.BusABC
87- :private-members:
88- :special-members:
89- :noindex:
90-
91-
92- Concrete instances are created by :class: `can.Bus `.
93-
9447
9548Code Structure
9649--------------
0 commit comments