File: bcm.rst

package info (click to toggle)
python-can 3.0.0%2Bgithub-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,892 kB
  • sloc: python: 8,014; makefile: 29; sh: 12
file content (55 lines) | stat: -rw-r--r-- 1,470 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.. _bcm:

Broadcast Manager
=================

.. module:: can.broadcastmanager

The broadcast manager allows the user to setup periodic message jobs.
For example sending a particular message at a given period. The broadcast
manager supported natively by several interfaces and a software thread
based scheduler is used as a fallback.

This example shows the socketcan backend using the broadcast manager:

.. literalinclude:: ../examples/cyclic.py
    :language: python
    :linenos:


Message Sending Tasks
~~~~~~~~~~~~~~~~~~~~~

The class based api for the broadcast manager uses a series of
`mixin classes <https://www.ianlewis.org/en/mixins-and-python>`_.
All mixins inherit from :class:`~can.broadcastmanager.CyclicSendTaskABC`
which inherits from :class:`~can.broadcastmanager.CyclicTask`.

.. autoclass:: can.broadcastmanager.CyclicTask
    :members:

.. autoclass:: can.broadcastmanager.CyclicSendTaskABC
    :members:

.. autoclass:: LimitedDurationCyclicSendTaskABC
    :members:

.. autoclass:: MultiRateCyclicSendTaskABC
    :members:

.. autoclass:: can.ModifiableCyclicTaskABC
    :members:

.. autoclass:: can.RestartableCyclicTaskABC
    :members:


Functional API
--------------

.. warning::
    The functional API in :func:`can.broadcastmanager.send_periodic` is now deprecated
    and will be removed in version 4.0.
    Use the object oriented API via :meth:`can.BusABC.send_periodic` instead.

.. autofunction:: can.broadcastmanager.send_periodic