Skip to content

Commit

Permalink
self-review
Browse files Browse the repository at this point in the history
fix minor mistakes
  • Loading branch information
mdabrowski1990 committed Oct 31, 2023
1 parent 91ca794 commit 5e38cad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/source/pages/user_guide/segmentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ segmenter classes. Each concrete segmenter class handles segmentation process fo

.. warning:: A **user shall not use** :class:`~uds.segmentation.abstract_segmenter.AbstractSegmenter` **directly**,
but one is able (and encouraged) to use :class:`~uds.segmentation.abstract_segmenter.AbstractSegmenter`
implementation with any of its children classes.
implementation on any of its children classes.


CanSegmenter
Expand Down
1 change: 1 addition & 0 deletions docs/source/pages/user_guide/transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Transport interfaces are meant to handle Physical (layer 1), Data (layer 2), Net
layers of UDS OSI model which are unique for every communication bus. First two layers (Physical and Data Link) are
usually handled by some external packages. Abstract API that is common for all Transport Interfaces (and therefore buses)
is defined in :class:`~uds.transport_interface.abstract_transport_interface.AbstractTransportInterface` class.
The implementation is located in :mod:`uds.transport_interface` sub-package.

.. toctree::
:maxdepth: 1
Expand Down
27 changes: 18 additions & 9 deletions docs/source/pages/user_guide/transport/can.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
CAN Transport Interfaces
========================
Implementation for Transport Interfaces that can be used with CAN bus.
The implementation for Transport Interfaces that can be used with CAN bus is located in
:mod:`uds.transport_interface.can_transport_interface.py` module.

Common
------
Common implementation for all all CAN Transport Interfaces is included in
:class:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface`.

.. warning:: A **user shall not use** :class:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface`
**directly**, but one is able (and encouraged) to use :class:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface`
implementation on any of its children classes.

Configuration
`````````````
CAN bus specific configuration is set upon calling
:meth:`uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.__init__` method.
The following configuration parameters are set in it:
The following configuration parameters are set then:

- :ref:`Addressing Information <knowledge-base-n-ai>` of this CAN node - attribute
- Addressing Information of this CAN node - attribute
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.addressing_information`
- driver for a CAN bus interface - attribute
:attr:`~uds.transport_interface.abstract_transport_interface.AbstractTransportInterface.bus_manager`
Expand All @@ -26,9 +31,9 @@ The following configuration parameters are set in it:
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.n_ar_timeout`,
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.n_bs_timeout` and
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.n_cr_timeout`
- UDS message segmentation parameters (:ref:`base DLC of a CAN frame <knowledge-base-can-data-field>`
whether to use :ref:`data optimization for CAN frame <knowledge-base-can-data-optimization>`,
value of a :ref:`filler byte <knowledge-base-can-frame-data-padding>` to use for CAN frame data padding) - attributes
- UDS message segmentation parameters (:ref:`base DLC of a CAN frame <knowledge-base-can-data-field>`,
flag whether to use :ref:`data optimization for CAN frame <knowledge-base-can-data-optimization>`,
and the value to use for :ref:`CAN frame data padding <knowledge-base-can-frame-data-padding>`) - attributes
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.dlc`,
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.use_data_optimization`,
:attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.filler_byte`,
Expand All @@ -46,7 +51,9 @@ and transmitting CAN frames.
Configuration
`````````````
Configuration is set upon calling
:meth:`uds.transport_interface.can_transport_interface.PyCanTransportInterface.__init__` method.
:meth:`uds.transport_interface.can_transport_interface.PyCanTransportInterface.__init__` method and from
the user perspective it does not provide any additional features to common_ implementation provided by
:meth:`uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.__init__`.

**Example code:**

Expand Down Expand Up @@ -108,7 +115,8 @@ there are two methods which can be used to transmit CAN packets:
# let's assume that we have `can_transport_interface` already configured as presented in configuration example above
# define some UDS message to send
message = uds.message.UdsMessage(addressing_type=AddressingType.PHYSICAL, payload=[0x10, 0x03])
message = uds.message.UdsMessage(addressing_type=uds.transmission_attributes.AddressingType.PHYSICAL,
payload=[0x10, 0x03])
# segment the message to create a CAN packet
can_packet = can_transport_interface.segmenter.segmentation(message)[0]
Expand All @@ -124,7 +132,8 @@ there are two methods which can be used to transmit CAN packets:
# let's assume that we have `can_transport_interface` already configured as presented in configuration example above
# define some UDS message to send
message = uds.message.UdsMessage(addressing_type=AddressingType.PHYSICAL, payload=[0x10, 0x03])
message = uds.message.UdsMessage(addressing_type=uds.transmission_attributes.AddressingType.PHYSICAL,
payload=[0x10, 0x03])
# segment the message to create a CAN packet
can_packet = can_transport_interface.segmenter.segmentation(message)[0]
Expand Down

0 comments on commit 5e38cad

Please sign in to comment.