You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/source/index.rst
+12-2
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ It also contains a wrapper for a simplified usage of the `Linux SocketCAN IsoTP
17
17
18
18
.. note:: You are looking at the isotp v2.x documentation. The legacy `v1.x documentation <https://can-isotp.readthedocs.io/en/v1.x>`_ is still online.
19
19
20
-
V2.x changes
20
+
v2.x changes
21
21
------------
22
22
23
23
V2.x addressed several flaws that were present in v1.x. The main change is regarding the timing capabilities of the module. V2.x can achieve much better timing performance than
@@ -34,6 +34,16 @@ Here is the major API changes to v2.x that might make an application designed wi
34
34
35
35
- The transport layer can perform blocking sends, allowing an UDS layer to better handle its timeouts (P2/P2* vs P6 timeouts)
36
36
- Some methods dedicated to internal usage have been prefixed with an underscore (``_``) to indicates that they are internals
37
-
- The CanStack object uses a Notifier instead of performing ``bus.recv()`` solving the popular issue of a CanStack depleting the receive queue and starving other modules from their incoming messages
38
37
- The ``isotp.socket.recv()`` method does not return ``None`` on timeout anymore.
39
38
The API now comply with the Python socket API and will raise the proper exception in case of timeout.
39
+
- The error handler is called from a different thread
40
+
- The :class:`TransportLayer<isotp.TransportLayer>` object is now an extension of the legacy v1.x TransportLayer, which has been renamed to ``TransportLayerLogic``. See :ref:`Backward Compatibility<backward_compatibility>` and :ref:`Legacy Methods<legacy_methods>`
41
+
42
+
On top of that, some improvement makes v2.x preferable over v1.x
43
+
44
+
- The :class:`NotifierBasedCanStack<isotp.NotifierBasedCanStack>` object has been introduced and uses a notifier instead of calling ``bus.recv()``, solving the popular issue of a CanStack depleting the receive queue and starving other modules from their incoming messages
45
+
- :ref:`Asymmetric addressing<asymmetric_addresses>` is possible (different address for reception than transmission)
46
+
- Sending data with a generator is now possible, accommodating use cases with large payloads
47
+
- The module is fully type-hinted
48
+
- It is possible to use a busy-wait to achieve even more precise timings. See the :ref:`wait_func parameter<param_wait_func>`
Copy file name to clipboardexpand all lines: doc/source/isotp/addressing.rst
+3-2
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,7 @@ Example :
161
161
162
162
------
163
163
164
+
.. _asymmetric_addresses:
164
165
165
166
Asymmetric addresses
166
167
--------------------
@@ -170,7 +171,7 @@ It is possible to send and receive with different address schemes. The :class:`A
170
171
.. autoclass:: isotp.AsymmetricAddress
171
172
172
173
When using an asymmetric, both ``tx_addr`` and ``rx_addr`` must be partial addresses, meaning that either ``tx_only=True`` or ``rx_only=True`` is set.
173
-
Address object instantiated with ``rx_only=True`` will not expect parameter meant for transmission and conversely, when instantiated with ``tx_only=True``
174
+
Address objects instantiated with ``rx_only=True`` will not expect the parameters meant for transmission and conversely, when instantiated with ``tx_only=True``
174
175
parameters required for reception won't be needed.
Copy file name to clipboardexpand all lines: doc/source/isotp/implementation.rst
+8-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
Implementation
2
-
==============
1
+
Pure Python Implementation
2
+
==========================
3
3
4
4
This sections explains the python implementation of the IsoTP protocol.
5
5
@@ -14,8 +14,10 @@ In such case, the :class:`isotp.TransportLayer<isotp.TransportLayer>` will be th
14
14
15
15
If python-can must be used as CAN layer, one can use the :class:`isotp.CanStack<isotp.CanStack>` and :class:`isotp.NotifierBasedCanStack<isotp.NotifierBasedCanStack>` which extends the TransportLayer object with predefined functions that calls python-can.
16
16
17
-
.. autoclass:: isotp.CanStack
18
17
.. autoclass:: isotp.NotifierBasedCanStack
18
+
.. autoclass:: isotp.CanStack
19
+
20
+
.. note:: The :class:`CanStack<isotp.CanStack>` exists mainly for backward compatibility with v1.x. It is suggested to use the :class:`NotifierBasedCanStack<isotp.NotifierBasedCanStack>` to avoid starvation issues and achieve better performances.
19
21
20
22
The CAN messages going in and out from the transport layer are defined with :class:`isotp.CanMessage<isotp.CanMessage>`.
21
23
@@ -95,6 +97,7 @@ The transport layer ``params`` parameter must be a dictionary with the following
95
97
.. _param_rx_flowcontrol_timeout:
96
98
97
99
.. attribute:: rx_flowcontrol_timeout
100
+
:annotation: (int)
98
101
99
102
**default: 1000**
100
103
@@ -318,6 +321,8 @@ The :class:`isotp.TransportLayer<isotp.TransportLayer>` object has the following
The IsoTP transport layer preconfigured to use `python-can <https://python-can.readthedocs.io>`__ as CAN layer. python-can must be installed in order to use this class.
1666
+
The IsoTP transport layer pre configured to use `python-can <https://python-can.readthedocs.io>`__ as CAN layer. python-can must be installed in order to use this class.
1660
1667
All parameters except the ``bus`` parameter will be given to the :class:`TransportLayer<isotp.TransportLayer>` constructor
1661
1668
1662
1669
This class directly calls ``bus.recv``, consuming the message from the receive queue, potentially starving other application. Consider using the :class:`NotifierBasedCanStack<isotp.NotifierBasedCanStack>`
The IsoTP transport layer preconfigured to use `python-can <https://python-can.readthedocs.io>`__ as CAN layer and reading through a ``can.Notifier``. python-can must be installed in order to use this class.
1706
+
The IsoTP transport layer pre configured to use `python-can <https://python-can.readthedocs.io>`__ as CAN layer and reading through a ``can.Notifier``. python-can must be installed in order to use this class.
1700
1707
All parameters except the ``bus`` and the ``notifier`` parameter will be given to the :class:`TransportLayer<isotp.TransportLayer>` constructor
1701
1708
1702
1709
This class reads by registering a listener to the given notifier and sends by calling ``bus.recv``.
0 commit comments