From 3d7fd906321ed3549068891f8a5177d3189658f5 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Wed, 25 Oct 2023 15:27:38 +0200 Subject: [PATCH 01/23] move examples Move examples to different directory (change structure of examples) --- .../kvaser}/config.wcc | 0 .../kvaser}/python_can_timing_issue.py | 0 .../kvaser}/receive_packets.py | 7 ++++++- .../kvaser}/receive_packets_asyncio.py | 0 .../kvaser}/send_packets.py | 0 .../kvaser}/send_packets_asyncio.py | 0 6 files changed, 6 insertions(+), 1 deletion(-) rename examples/can/{kvaser with python-can => python-can/kvaser}/config.wcc (100%) rename examples/can/{kvaser with python-can => python-can/kvaser}/python_can_timing_issue.py (100%) rename examples/can/{kvaser with python-can => python-can/kvaser}/receive_packets.py (98%) rename examples/can/{kvaser with python-can => python-can/kvaser}/receive_packets_asyncio.py (100%) rename examples/can/{kvaser with python-can => python-can/kvaser}/send_packets.py (100%) rename examples/can/{kvaser with python-can => python-can/kvaser}/send_packets_asyncio.py (100%) diff --git a/examples/can/kvaser with python-can/config.wcc b/examples/can/python-can/kvaser/config.wcc similarity index 100% rename from examples/can/kvaser with python-can/config.wcc rename to examples/can/python-can/kvaser/config.wcc diff --git a/examples/can/kvaser with python-can/python_can_timing_issue.py b/examples/can/python-can/kvaser/python_can_timing_issue.py similarity index 100% rename from examples/can/kvaser with python-can/python_can_timing_issue.py rename to examples/can/python-can/kvaser/python_can_timing_issue.py diff --git a/examples/can/kvaser with python-can/receive_packets.py b/examples/can/python-can/kvaser/receive_packets.py similarity index 98% rename from examples/can/kvaser with python-can/receive_packets.py rename to examples/can/python-can/kvaser/receive_packets.py index 6f53fda2..0b301d22 100644 --- a/examples/can/kvaser with python-can/receive_packets.py +++ b/examples/can/python-can/kvaser/receive_packets.py @@ -6,7 +6,8 @@ from uds.transport_interface import PyCanTransportInterface from uds.can import CanAddressingInformation, CanAddressingFormat -if __name__ == "__main__": + +def main(): # configure CAN interfaces kvaser_interface_1 = Bus(interface="kvaser", channel=0, fd=True, receive_own_messages=True) kvaser_interface_2 = Bus(interface="kvaser", channel=1, fd=True, receive_own_messages=True) @@ -44,3 +45,7 @@ sleep(0.1) # wait to make sure all tasks are closed kvaser_interface_1.shutdown() kvaser_interface_2.shutdown() + + +if __name__ == "__main__": + main() diff --git a/examples/can/kvaser with python-can/receive_packets_asyncio.py b/examples/can/python-can/kvaser/receive_packets_asyncio.py similarity index 100% rename from examples/can/kvaser with python-can/receive_packets_asyncio.py rename to examples/can/python-can/kvaser/receive_packets_asyncio.py diff --git a/examples/can/kvaser with python-can/send_packets.py b/examples/can/python-can/kvaser/send_packets.py similarity index 100% rename from examples/can/kvaser with python-can/send_packets.py rename to examples/can/python-can/kvaser/send_packets.py diff --git a/examples/can/kvaser with python-can/send_packets_asyncio.py b/examples/can/python-can/kvaser/send_packets_asyncio.py similarity index 100% rename from examples/can/kvaser with python-can/send_packets_asyncio.py rename to examples/can/python-can/kvaser/send_packets_asyncio.py From 9ae2349d4763b8c5772fa5ca2a791357a5073102 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Wed, 25 Oct 2023 16:24:04 +0200 Subject: [PATCH 02/23] examples added Add examples page to documentation. --- docs/source/index.rst | 1 + docs/source/pages/examples.rst | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/source/pages/examples.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index 09dfb85b..bb762d3c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,6 +6,7 @@ Welcome to UDS documentation! Home pages/installation.rst pages/user_guide.rst + pages/examples.rst autoapi/index.rst pages/knowledge_base.rst pages/contribution.rst diff --git a/docs/source/pages/examples.rst b/docs/source/pages/examples.rst new file mode 100644 index 00000000..af12aea6 --- /dev/null +++ b/docs/source/pages/examples.rst @@ -0,0 +1,24 @@ +Examples +======== +Location of all example files: https://github.com/mdabrowski1990/uds/tree/main/examples + + +CAN +--- +Code examples of UDS protocol communication over CAN bus. + + +Python-CAN +`````````` +Examples with `python-can`_ package being used for controlling CAN bus. + +Kvaser interface +'''''''''''''''' +The newest version of examples for `Kvaser CAN interfaces`_ hardware are available under this +`link `_. + + + +.. _python-can: https://github.com/hardbyte/python-can + +.. _Kvaser CAN interfaces: https://www.kvaser.com/products-services/our-products/#/?descriptors=pc_int From 6f3d4a07bf8cebf0f378227c42062695e87a6579 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Wed, 25 Oct 2023 17:29:27 +0200 Subject: [PATCH 03/23] update CAN segmenter - update CAN Segmenter functionality documentation - leave TODO marks in sections to update --- docs/source/pages/user_guide/segmentation.rst | 36 +++++++++++++------ .../source/pages/user_guide/transport/can.rst | 2 +- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/docs/source/pages/user_guide/segmentation.rst b/docs/source/pages/user_guide/segmentation.rst index 1c5ec065..49512320 100644 --- a/docs/source/pages/user_guide/segmentation.rst +++ b/docs/source/pages/user_guide/segmentation.rst @@ -16,15 +16,15 @@ segmenter classes. Each concrete segmenter class handles segmentation process fo CanSegmenter ------------ -:class:`~uds.segmentation.can_segmenter.CanSegmenter` handles segmentation process on CAN bus. +:class:`~uds.segmentation.can_segmenter.CanSegmenter` handles segmentation process specific for CAN bus. Following functionalities are provided by :class:`~uds.segmentation.can_segmenter.CanSegmenter`: - Configuration of the segmenter: As a user, you are able to configure :class:`~uds.segmentation.can_segmenter.CanSegmenter` parameters which determines - the format (e.g. Addressing Format), the content (e.g. Filler Byte) of CAN Packets and how they are created - (e.g. whether to use CAN Frame Data Optimization). + the addressing (Addressing Format and Addressing Information of input and output CAN packets) and the content + (e.g. Filler Byte value and whether to use CAN Frame Data Optimization) of CAN Packets. **Example code:** @@ -32,17 +32,27 @@ Following functionalities are provided by :class:`~uds.segmentation.can_segmente import uds - # configure CAN Segmenter - can_segmenter = uds.segmentation.CanSegmenter(addressing_format=uds.can.CanAddressingFormat.NORMAL_11BIT_ADDRESSING, - physical_ai={"can_id": 0x601}, - functional_ai={"can_id": 0x6FF}, + # define Addressing Information for a CAN Node + can_node_addressing_information = uds.can.CanAddressingInformation( + addressing_format=uds.can.CanAddressingFormat.NORMAL_11BIT_ADDRESSING, + tx_physical={"can_id": 0x611}, + rx_physical={"can_id": 0x612}, + tx_functional={"can_id": 0x6FF}, + rx_functional={"can_id": 0x6FE}) + + # configure CAN Segmenter for this CAN Node + can_segmenter = uds.segmentation.CanSegmenter(addressing_information=can_node_addressing_information, dlc=8, use_data_optimization=False, filler_byte=0xFF) - # change CAN Segmenter configuration (note: you cannot change addressing_format, create new segmenter instead) - can_segmenter.physical_ai = {"can_id": 0x610} - can_segmenter.functional_ai = {"can_id": 0x7FF} + # change CAN Segmenter configuration + can_segmenter.addressing_information = uds.can.CanAddressingInformation( + uds.can.CanAddressingFormat.NORMAL_11BIT_ADDRESSING, + tx_physical={"can_id": 0x612}, + rx_physical={"can_id": 0x611}, + tx_functional={"can_id": 0x6FE}, + rx_functional={"can_id": 0x6FF}) can_segmenter.dlc=0xF can_segmenter.use_data_optimization = True can_segmenter.filler_byte = 0xAA @@ -130,3 +140,9 @@ Following functionalities are provided by :class:`~uds.segmentation.can_segmente .. warning:: Desegmentation performs only sanity check of CAN Packets content, therefore some inconsistencies with Diagnostic on CAN standard might be silently accepted as long as a message can be unambiguously decoded out of provided CAN packets. + + .. note:: Desegmentation can be perform for any CAN Packets (not only those targeting this CAN Node) in any format. + + +- Checking whether a CAN packet targets this CAN Node: + # TODO: explain the functionality, provide code examples diff --git a/docs/source/pages/user_guide/transport/can.rst b/docs/source/pages/user_guide/transport/can.rst index 27dc3c1e..8d4b4675 100644 --- a/docs/source/pages/user_guide/transport/can.rst +++ b/docs/source/pages/user_guide/transport/can.rst @@ -1,3 +1,3 @@ -CAN Transport Interface +CAN Transport Interface TODO: rework ======================= CAN FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file From bc029727800515e06e15d7691fd8a485db083b10 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 12:49:48 +0200 Subject: [PATCH 04/23] cosmetic changes --- .github/workflows/ci.yml | 6 +++--- docs/source/pages/user_guide/segmentation.rst | 4 ---- pyproject.toml | 1 + uds/can/abstract_addressing_information.py | 4 ++-- uds/segmentation/can_segmenter.py | 15 ++++++++++----- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b1c72d9..26f76c49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -109,7 +109,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -138,7 +138,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/docs/source/pages/user_guide/segmentation.rst b/docs/source/pages/user_guide/segmentation.rst index 49512320..1e522149 100644 --- a/docs/source/pages/user_guide/segmentation.rst +++ b/docs/source/pages/user_guide/segmentation.rst @@ -142,7 +142,3 @@ Following functionalities are provided by :class:`~uds.segmentation.can_segmente out of provided CAN packets. .. note:: Desegmentation can be perform for any CAN Packets (not only those targeting this CAN Node) in any format. - - -- Checking whether a CAN packet targets this CAN Node: - # TODO: explain the functionality, provide code examples diff --git a/pyproject.toml b/pyproject.toml index 728f2a55..02ef158b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Natural Language :: English", diff --git a/uds/can/abstract_addressing_information.py b/uds/can/abstract_addressing_information.py index 22d5945b..04057099 100644 --- a/uds/can/abstract_addressing_information.py +++ b/uds/can/abstract_addressing_information.py @@ -22,10 +22,10 @@ class PacketAIParamsAlias(TypedDict): address_extension: Optional[int] -class AbstractCanAddressingInformation(ABC): +class AbstractCanAddressingInformation(ABC): # TODO: consider defining abstract class for all buses """Abstract definition of CAN Entity (either server or client) Addressing Information.""" - ADDRESSING_FORMAT_NAME: str = "addressing_format" # noqa: F841 + ADDRESSING_FORMAT_NAME: str = "addressing_format" """Name of :ref:`CAN Addressing Format ` parameter in Addressing Information.""" ADDRESSING_TYPE_NAME: str = CanIdHandler.ADDRESSING_TYPE_NAME """Name of :ref:`Addressing Type ` parameter in Addressing Information.""" diff --git a/uds/segmentation/can_segmenter.py b/uds/segmentation/can_segmenter.py index 23163b1c..cd4e233f 100644 --- a/uds/segmentation/can_segmenter.py +++ b/uds/segmentation/can_segmenter.py @@ -146,6 +146,7 @@ def filler_byte(self, value: int): validate_raw_byte(value) self.__filler_byte: int = value + # TODO: consider moving this method to AbstractAddressingInformation (if defined) def is_input_packet(self, can_id: int, data: RawBytesAlias) -> Optional[AddressingType]: # type: ignore # noqa """ Check if provided frame attributes belong to a UDS CAN packet which is an input for this CAN Segmenter. @@ -161,14 +162,18 @@ def is_input_packet(self, can_id: int, data: RawBytesAlias) -> Optional[Addressi addressing_format=self.addressing_format, can_id=can_id, ai_data_bytes=data[:self.addressing_information.AI_DATA_BYTES_NUMBER]) - decoded_frame_ai.update(can_id=can_id, addressing_format=self.addressing_format) # type: ignore except ValueError: return None - decoded_frame_ai[AbstractCanAddressingInformation.ADDRESSING_TYPE_NAME] = AddressingType.PHYSICAL # type: ignore # noqa - if self.rx_packets_physical_ai == decoded_frame_ai: + frame_ai = { + AbstractCanAddressingInformation.CAN_ID_NAME: can_id, + AbstractCanAddressingInformation.ADDRESSING_FORMAT_NAME: self.addressing_format, + **decoded_frame_ai + } + frame_ai[AbstractCanAddressingInformation.ADDRESSING_TYPE_NAME] = AddressingType.PHYSICAL + if self.rx_packets_physical_ai == frame_ai: return AddressingType.PHYSICAL - decoded_frame_ai[AbstractCanAddressingInformation.ADDRESSING_TYPE_NAME] = AddressingType.FUNCTIONAL # type: ignore # noqa - if self.rx_packets_functional_ai == decoded_frame_ai: + frame_ai[AbstractCanAddressingInformation.ADDRESSING_TYPE_NAME] = AddressingType.FUNCTIONAL + if self.rx_packets_functional_ai == frame_ai: return AddressingType.FUNCTIONAL return None From b9e1cce06de668ae4561cd28aa05a6c7e0a35e28 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 12:57:55 +0200 Subject: [PATCH 05/23] Update .readthedocs.yaml adjust readthedocs configuration so it builds again --- .readthedocs.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3807ff08..bda63d58 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -2,6 +2,13 @@ version: 2 +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + + # Build documentation in the docs/ directory with Sphinx sphinx: builder: html @@ -17,7 +24,6 @@ formats: # Optionally set the version of Python and requirements required to build your docs python: - version: "3.8" install: - requirements: docs/requirements_for_docs.txt - requirements: requirements.txt From a6748fd3ef2cfe46ccee2331d011c4a8ad79f439 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 13:05:53 +0200 Subject: [PATCH 06/23] Update can.rst fix to make a test build --- docs/source/pages/user_guide/transport/can.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/pages/user_guide/transport/can.rst b/docs/source/pages/user_guide/transport/can.rst index 8d4b4675..be3836a2 100644 --- a/docs/source/pages/user_guide/transport/can.rst +++ b/docs/source/pages/user_guide/transport/can.rst @@ -1,3 +1,3 @@ -CAN Transport Interface TODO: rework +CAN Transport Interface ======================= -CAN FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file +TODO: rework From b9ce61cb07e85891318067a008bfb9295027fefd Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 13:18:39 +0200 Subject: [PATCH 07/23] Update conf.py try to solve graphviz issue --- docs/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index d6fa4bcc..ee93b8a4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,7 +50,8 @@ extensions = ["sphinx.ext.autodoc", "autoapi.extension", - "sphinx.ext.viewcode"] + "sphinx.ext.viewcode", + "sphinx.ext.graphviz"] autodoc_typehints = "description" autodoc_typehints_description_target = "all" From cf36f78cb36ee90d8629c7178b638f97e01cfbb4 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 13:22:28 +0200 Subject: [PATCH 08/23] Update .readthedocs.yaml try to fix graphviz issue --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index bda63d58..1fc26121 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,6 +7,9 @@ build: os: ubuntu-22.04 tools: python: "3.11" + jobs: + pre_install: + - sudo apt-get install graphviz # Build documentation in the docs/ directory with Sphinx From 33081d74a0f066fb81956ada409a0ce6ed617032 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 13:24:44 +0200 Subject: [PATCH 09/23] Update .readthedocs.yaml hopefully sudo is avaialble although I doubt that =/ --- .readthedocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1fc26121..d25d83ab 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,6 +9,7 @@ build: python: "3.11" jobs: pre_install: + - sudo apt-get update - sudo apt-get install graphviz From 4776594a882d9547abd316b4c9b7420729fe521e Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 13:26:38 +0200 Subject: [PATCH 10/23] Update .readthedocs.yaml --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d25d83ab..f171919e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,8 +9,8 @@ build: python: "3.11" jobs: pre_install: - - sudo apt-get update - - sudo apt-get install graphviz + - apt-get update + - apt-get install graphviz # Build documentation in the docs/ directory with Sphinx From ef18f7d259bc27c8ec663efa7f0064b3a9d35afa Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 26 Oct 2023 14:24:42 +0200 Subject: [PATCH 11/23] Update .readthedocs.yaml test --- .readthedocs.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f171919e..85a5a804 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,11 +9,12 @@ build: python: "3.11" jobs: pre_install: - - apt-get update - - apt-get install graphviz + - whoami + - sudo apg-get update + - sudo apg-get install graphviz -# Build documentation in the docs/ directory with Sphinx + # Build documentation in the docs/ directory with Sphinx sphinx: builder: html fail_on_warning: true From f31338535a4280b0bdda3c9ca0b144d509be9460 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Fri, 27 Oct 2023 11:38:21 +0200 Subject: [PATCH 12/23] test build seems like I found a fix for graphviz issue --- .readthedocs.yaml | 9 ++--- docs/source/pages/user_guide/transport.rst | 6 +-- .../source/pages/user_guide/transport/can.rst | 37 +++++++++++++++++-- .../pages/user_guide/transport/custom.rst | 4 +- .../pages/user_guide/transport/ethernet.rst | 4 +- .../pages/user_guide/transport/flexray.rst | 4 +- .../pages/user_guide/transport/kline.rst | 4 +- .../source/pages/user_guide/transport/lin.rst | 4 +- 8 files changed, 50 insertions(+), 22 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 85a5a804..0ea46a0c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,14 +7,11 @@ build: os: ubuntu-22.04 tools: python: "3.11" - jobs: - pre_install: - - whoami - - sudo apg-get update - - sudo apg-get install graphviz + apt_packages: + - graphviz - # Build documentation in the docs/ directory with Sphinx +# Build documentation in the docs/ directory with Sphinx sphinx: builder: html fail_on_warning: true diff --git a/docs/source/pages/user_guide/transport.rst b/docs/source/pages/user_guide/transport.rst index 619b1886..71cf7c81 100644 --- a/docs/source/pages/user_guide/transport.rst +++ b/docs/source/pages/user_guide/transport.rst @@ -3,12 +3,12 @@ Transport Interfaces Transport interfaces are meant to handle Physical (layer 1), Data (layer 2), Network (layer 3) and Transport (layer 4) layers of UDS OSI model which are unique for every communication bus. First two layers (Physical and Data Link) are usually handled by external packages (e.g. `python-can `_ handles -first two layers for CAN bus). - +first two layers for CAN bus). Abstract API that is common for all Transport Interfaces (and therefore buses) +is defined in :class:`~uds.transport_interface.abstract_transport_interface.AbstractTransportInterface` class. .. toctree:: :maxdepth: 1 - :caption: Transport Interface Implementations: + :caption: Implementation of Transport Interface: transport/can.rst transport/ethernet.rst diff --git a/docs/source/pages/user_guide/transport/can.rst b/docs/source/pages/user_guide/transport/can.rst index be3836a2..44f38e10 100644 --- a/docs/source/pages/user_guide/transport/can.rst +++ b/docs/source/pages/user_guide/transport/can.rst @@ -1,3 +1,34 @@ -CAN Transport Interface -======================= -TODO: rework +CAN Transport Interfaces +======================== +TODO: some general info + +Common +------ +Common CAN implementation for all CAN :class:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface` + +Configuration +````````````` +TODO: __init__ explanation + + +Python-CAN +---------- +TODO: :class:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface` + +Configuration +````````````` +TODO: __init__ explanation (only diff) + +Send Packet +``````````` +TODO: +:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.send_packet` +and +:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_send_packet` + +Receive Packet +`````````````` +TODO: +:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.receive_packet` +and +:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_receive_packet` diff --git a/docs/source/pages/user_guide/transport/custom.rst b/docs/source/pages/user_guide/transport/custom.rst index 14aa0ebd..ad481d6f 100644 --- a/docs/source/pages/user_guide/transport/custom.rst +++ b/docs/source/pages/user_guide/transport/custom.rst @@ -1,3 +1,3 @@ -Custom Transport Interface -========================== +Custom Transport Interfaces +=========================== THIS FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file diff --git a/docs/source/pages/user_guide/transport/ethernet.rst b/docs/source/pages/user_guide/transport/ethernet.rst index 3fff44ee..79e9a7f5 100644 --- a/docs/source/pages/user_guide/transport/ethernet.rst +++ b/docs/source/pages/user_guide/transport/ethernet.rst @@ -1,3 +1,3 @@ -Ethernet Transport Interface -============================ +Ethernet Transport Interfaces +============================= Ethernet FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file diff --git a/docs/source/pages/user_guide/transport/flexray.rst b/docs/source/pages/user_guide/transport/flexray.rst index 6982b487..cae2022b 100644 --- a/docs/source/pages/user_guide/transport/flexray.rst +++ b/docs/source/pages/user_guide/transport/flexray.rst @@ -1,3 +1,3 @@ -FlexRay Transport Interface -=========================== +FlexRay Transport Interfaces +============================ FlexRay FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file diff --git a/docs/source/pages/user_guide/transport/kline.rst b/docs/source/pages/user_guide/transport/kline.rst index c8a9881b..c6d50adc 100644 --- a/docs/source/pages/user_guide/transport/kline.rst +++ b/docs/source/pages/user_guide/transport/kline.rst @@ -1,3 +1,3 @@ -K-Line Transport Interface -========================== +K-Line Transport Interfaces +=========================== K-Line FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file diff --git a/docs/source/pages/user_guide/transport/lin.rst b/docs/source/pages/user_guide/transport/lin.rst index af958e08..dbb6ef8c 100644 --- a/docs/source/pages/user_guide/transport/lin.rst +++ b/docs/source/pages/user_guide/transport/lin.rst @@ -1,3 +1,3 @@ -LIN Transport Interface -======================= +LIN Transport Interfaces +======================== LIN FEATURE IS PLANNED BUT NOT IMPLEMENTED YET, THEREFORE THERE ARE NO MORE INFORMATION TO DISPLAY. \ No newline at end of file From f703660a3d3b4c82addbdefe4867d19019f2bf43 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Fri, 27 Oct 2023 13:18:49 +0200 Subject: [PATCH 13/23] update to features status Update tables with implementation statuses. --- docs/source/index.rst | 14 +++++++++----- docs/source/pages/examples.rst | 2 +- docs/source/tables/bus_implementation_status.tgn | 2 +- .../tables/features_implementation_status.tgn | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index bb762d3c..b24cf76f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -41,16 +41,20 @@ Current implementation status of package features: | UDS Messages and Packets | Available since version `0.0.2 | | | `_ | +----------------------------------------------+--------------------------------------------+ -| UDS Packets Reception | Ongoing | +| UDS Packets Reception and Transmission | Available since version `0.3.0 | +| | `_ | +----------------------------------------------+--------------------------------------------+ -| UDS Packets Transmission | Planned | +| UDS Messages Reception and Transmission | Planned | +----------------------------------------------+--------------------------------------------+ -| Segmentation | Available since version `0.2.0 | +| Messages Segmentation | Available since version `0.2.0 | +| | `_ | ++----------------------------------------------+--------------------------------------------+ +| UDS Packets Desegmentation | Available since version `0.2.0 | | | `_ | +----------------------------------------------+--------------------------------------------+ | Support for Services with multiple responses | Planned | +----------------------------------------------+--------------------------------------------+ -| Client Simulation | Ongoing | +| Client Simulation | Planned | +----------------------------------------------+--------------------------------------------+ | Server Simulation | Planned | +----------------------------------------------+--------------------------------------------+ @@ -65,7 +69,7 @@ Current implementation status of support for communication buses: +----------+-----------------------+ | Bus | Implementation Status | +==========+=======================+ -| CAN | Ongoing | +| CAN | Partial | +----------+-----------------------+ | FlexRay | Planned | +----------+-----------------------+ diff --git a/docs/source/pages/examples.rst b/docs/source/pages/examples.rst index af12aea6..6430c6e9 100644 --- a/docs/source/pages/examples.rst +++ b/docs/source/pages/examples.rst @@ -10,7 +10,7 @@ Code examples of UDS protocol communication over CAN bus. Python-CAN `````````` -Examples with `python-can`_ package being used for controlling CAN bus. +Examples with `python-can`_ package being used for controlling CAN bus (handling CAN frames transmission and reception). Kvaser interface '''''''''''''''' diff --git a/docs/source/tables/bus_implementation_status.tgn b/docs/source/tables/bus_implementation_status.tgn index 1c883701..5e837c7d 100644 --- a/docs/source/tables/bus_implementation_status.tgn +++ b/docs/source/tables/bus_implementation_status.tgn @@ -1 +1 @@ -{"rows_views":[[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"Bus","cspan":1,"rspan":1,"markup":[1,3]},{"value":"Implementation Status","cspan":1,"rspan":1,"markup":[1,21]}],[{"value":"CAN","cspan":1,"rspan":1,"markup":[1,3]},{"value":"Ongoing","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"FlexRay","cspan":1,"rspan":1,"markup":[1,7]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Ethernet","cspan":1,"rspan":1,"markup":[1,8]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"K-Line","cspan":1,"rspan":1,"markup":[1,6]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"LIN","cspan":1,"rspan":1,"markup":[1,3]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}}]},"options":{}} \ No newline at end of file +{"rows_views":[[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"Bus","cspan":1,"rspan":1,"markup":[1,3]},{"value":"Implementation Status","cspan":1,"rspan":1,"markup":[1,21]}],[{"value":"CAN","cspan":1,"rspan":1,"markup":[1,3]},{"value":"Partial","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"FlexRay","cspan":1,"rspan":1,"markup":[1,7]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Ethernet","cspan":1,"rspan":1,"markup":[1,8]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"K-Line","cspan":1,"rspan":1,"markup":[1,6]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"LIN","cspan":1,"rspan":1,"markup":[1,3]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}}]},"options":{}} \ No newline at end of file diff --git a/docs/source/tables/features_implementation_status.tgn b/docs/source/tables/features_implementation_status.tgn index 5fc87448..419ffa5a 100644 --- a/docs/source/tables/features_implementation_status.tgn +++ b/docs/source/tables/features_implementation_status.tgn @@ -1 +1 @@ -{"rows_views":[[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"Feature","cspan":1,"rspan":1,"markup":[1,7]},{"value":"Implementation Status","cspan":1,"rspan":1,"markup":[1,21]}],[{"value":"UDS Messages and Packets","cspan":1,"rspan":1,"markup":[1,24]},{"value":"Available since version `0.0.2\n`_","cspan":1,"rspan":1,"markup":[1,73]}],[{"value":"UDS Packets Reception","cspan":1,"rspan":1,"markup":[1,21]},{"value":"Ongoing","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"UDS Packets Transmission","cspan":1,"rspan":1,"markup":[1,24]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Segmentation","cspan":1,"rspan":1,"markup":[1,12]},{"value":"Available since version `0.2.0\n`_","cspan":1,"rspan":1,"markup":[1,73]}],[{"value":"Support for Services with multiple responses","cspan":1,"rspan":1,"markup":[1,44]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Client Simulation","cspan":1,"rspan":1,"markup":[1,17]},{"value":"Ongoing","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Server Simulation","cspan":1,"rspan":1,"markup":[1,17]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Support for Messages Databases","cspan":1,"rspan":1,"markup":[1,30]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}},null]},"options":{}} \ No newline at end of file +{"rows_views":[[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"Feature","cspan":1,"rspan":1,"markup":[1,7]},{"value":"Implementation Status","cspan":1,"rspan":1,"markup":[1,21]}],[{"value":"UDS Messages and Packets","cspan":1,"rspan":1,"markup":[1,24]},{"value":"Available since version `0.0.2\n`_","cspan":1,"rspan":1,"markup":[1,73]}],[{"value":"UDS Packets Reception and Transmission","cspan":1,"rspan":1,"markup":[1,38]},{"value":"Available since version `0.3.0\n`_","cspan":1,"rspan":1,"markup":[1,73]}],[{"value":"UDS Messages Reception and Transmission","cspan":1,"rspan":1,"markup":[1,39]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Messages Segmentation","cspan":1,"rspan":1,"markup":[1,21]},{"value":"Available since version `0.2.0\n`_","cspan":1,"rspan":1,"markup":[1,73]}],[{"value":"UDS Packets Desegmentation","cspan":1,"rspan":1,"markup":[1,26]},{"value":"Available since version `0.2.0\n`_","cspan":1,"rspan":1,"markup":[1,73]}],[{"value":"Support for Services with multiple responses","cspan":1,"rspan":1,"markup":[1,44]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Client Simulation","cspan":1,"rspan":1,"markup":[1,17]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Server Simulation","cspan":1,"rspan":1,"markup":[1,17]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}],[{"value":"Support for Messages Databases","cspan":1,"rspan":1,"markup":[1,30]},{"value":"Planned","cspan":1,"rspan":1,"markup":[1,7]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}},null]},"options":{}} \ No newline at end of file From 45115909ba8706b9cbbd78f7c8d316db09bede95 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Fri, 27 Oct 2023 15:37:07 +0200 Subject: [PATCH 14/23] Update installation.rst add development version installation command --- docs/source/pages/installation.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/source/pages/installation.rst b/docs/source/pages/installation.rst index 7f17c952..954fceaa 100644 --- a/docs/source/pages/installation.rst +++ b/docs/source/pages/installation.rst @@ -14,3 +14,10 @@ If you have already installed the package, you can update it using the following UDS package is distributed via `PyPI `_. You can visit distribution page of UDS package using the following hyperlink: https://pypi.org/project/py-uds/. + +For people who likes risk, but looking for features that are currently in the development, the following command +will help with installing version of the package that is currently stored on `main` branch: + +:shell:`pip install git+https://github.com/mdabrowski1990/uds.git@main` + +.. warning:: Use this command on your own responsibility. From 95c579d01e176f8fbe2d7f985a40805658ffe49c Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Tue, 31 Oct 2023 14:19:46 +0100 Subject: [PATCH 15/23] Big update for docs - include code in examples section - rework installation page - adjust current status of features - provide user guide for python-can transport interface - --- docs/source/pages/examples.rst | 30 ++- docs/source/pages/installation.rst | 21 ++- .../source/pages/knowledge_base/osi_model.rst | 86 ++++----- docs/source/pages/user_guide.rst | 6 +- docs/source/pages/user_guide/transport.rst | 7 +- .../source/pages/user_guide/transport/can.rst | 178 ++++++++++++++++-- .../tables/OSI_model_functionalities.tgn | 2 +- pyproject.toml | 6 +- uds/__init__.py | 4 +- .../can_transport_interface.py | 8 +- 10 files changed, 269 insertions(+), 79 deletions(-) diff --git a/docs/source/pages/examples.rst b/docs/source/pages/examples.rst index 6430c6e9..f7c20dfa 100644 --- a/docs/source/pages/examples.rst +++ b/docs/source/pages/examples.rst @@ -7,16 +7,42 @@ CAN --- Code examples of UDS protocol communication over CAN bus. +.. seealso:: https://github.com/mdabrowski1990/uds/tree/main/examples/can + + +.. _example-python-can: Python-CAN `````````` Examples with `python-can`_ package being used for controlling CAN bus (handling CAN frames transmission and reception). +.. seealso:: https://github.com/mdabrowski1990/uds/tree/main/examples/can/python-can + + Kvaser interface '''''''''''''''' -The newest version of examples for `Kvaser CAN interfaces`_ hardware are available under this -`link `_. +- Send CAN packets (synchronous implementation): + +.. include:: ../../../examples/can/python-can/kvaser/send_packets.py + :code: python + +- Send CAN packets (asynchronous implementation): + +.. include:: ../../../examples/can/python-can/kvaser/send_packets_asyncio.py + :code: python + +- Receive CAN packets (synchronous implementation): + +.. include:: ../../../examples/can/python-can/kvaser/receive_packets.py + :code: python + +- Receive CAN packets (asynchronous implementation): + +.. include:: ../../../examples/can/python-can/kvaser/receive_packets_asyncio.py + :code: python + +.. seealso:: https://github.com/mdabrowski1990/uds/tree/main/examples/can/python-can/kvaser .. _python-can: https://github.com/hardbyte/python-can diff --git a/docs/source/pages/installation.rst b/docs/source/pages/installation.rst index 954fceaa..12dd009c 100644 --- a/docs/source/pages/installation.rst +++ b/docs/source/pages/installation.rst @@ -4,20 +4,27 @@ Installation .. role:: shell(code) :language: shell -To install the package, run the following command in your command line interface: +Released versions +----------------- +It is **recommended to use released versions** as they were fully tested and are considered as stable. +UDS package is distributed via `PyPI `_. All versions and other distribution related details +can be found on https://pypi.org/project/py-uds/ page. + +- To install the package, run the following command in your command line interface: :shell:`pip install py-uds` -If you have already installed the package, you can update it using the following command: +- To update your installation to the newest version of the package, run the following command: :shell:`pip install -U py-uds` -UDS package is distributed via `PyPI `_. -You can visit distribution page of UDS package using the following hyperlink: https://pypi.org/project/py-uds/. -For people who likes risk, but looking for features that are currently in the development, the following command -will help with installing version of the package that is currently stored on `main` branch: +Development version +------------------- +For people who likes risk, but looking for features that are currently under the development, the following command +will help with installing the development version of the package that is currently stored on `main` branch of +`github repository `_: :shell:`pip install git+https://github.com/mdabrowski1990/uds.git@main` -.. warning:: Use this command on your own responsibility. +.. warning:: Use this code on your own responsibility. diff --git a/docs/source/pages/knowledge_base/osi_model.rst b/docs/source/pages/knowledge_base/osi_model.rst index f57692aa..ab2e1db6 100644 --- a/docs/source/pages/knowledge_base/osi_model.rst +++ b/docs/source/pages/knowledge_base/osi_model.rst @@ -51,48 +51,50 @@ UDS Functionalities ------------------- An overview of features that are required to fully implement UDS protocol is presented in the table below: -+--------------+-------------------------------------------+----------------------------------------------+ -| OSI Layer | Functionalities | Implementation | -+==============+===========================================+==============================================+ -| Layer 7 | - diagnostic messages support | - :mod:`uds.message` | -| Application | | | -+--------------+-------------------------------------------+----------------------------------------------+ -| Layer 6 | - diagnostic messages data interpretation | *To be provided with Database feature.* | -| Presentation | | | -| | - messaging database import from a file | | -| | | | -| | - messaging database export to a file | | -+--------------+-------------------------------------------+----------------------------------------------+ -| Layer 5 | - Client simulation | *To be provided with Client feature.* | -| Session | | | -| | - Server simulation | *To be provided with Server feature.* | -+--------------+-------------------------------------------+----------------------------------------------+ -| Layer 4 | - UDS packet support | - :mod:`uds.packet` | -| Transport | | | -| | - bus specific segmentation | - :mod:`uds.segmentation` | -| | | | -| | - bus specific packets transmission | - :mod:`uds.transport_interface` | -| | | | -| | | - :mod:`uds.can` | -| | | | -| | | *Currently under development.* | -+--------------+ | | -| Layer 3 | | *To be extended with support for:* | -| Network | | | -| | | - *Ethernet* | -| | | | -| | | - *LIN* | -| | | | -| | | - *K-Line* | -| | | | -| | | - *FlexRay* | -+--------------+-------------------------------------------+----------------------------------------------+ -| Layer 2 | - frames transmission | External python packages for bus handling: | -| Data | | | -+--------------+ - frames receiving | - `CAN `_ | -| Layer 1 | | | -| Physical | | *More packages to be decided.* | -+--------------+-------------------------------------------+----------------------------------------------+ ++--------------+-------------------------------------------+-------------------------------------------------------+ +| OSI Layer | Functionalities | Implementation | ++==============+===========================================+=======================================================+ +| Layer 7 | - diagnostic messages support | - :mod:`uds.message` | +| Application | | | ++--------------+-------------------------------------------+-------------------------------------------------------+ +| Layer 6 | - diagnostic messages data interpretation | *To be provided with Database feature.* | +| Presentation | | | +| | - messaging database import from a file | | +| | | | +| | - messaging database export to a file | | ++--------------+-------------------------------------------+-------------------------------------------------------+ +| Layer 5 | - Client simulation | *To be provided with Client feature.* | +| Session | | | +| | - Server simulation | *To be provided with Server feature.* | ++--------------+-------------------------------------------+-------------------------------------------------------+ +| Layer 4 | - UDS packet support | - :mod:`uds.packet` | +| Transport | | | +| | - bus specific segmentation | - :mod:`uds.segmentation` | +| | | | +| | - bus specific packets transmission | - :mod:`uds.transport_interface` | +| | | | +| | | - :mod:`uds.can` | +| | | | +| | | *Currently under development.* | ++--------------+ | | +| Layer 3 | | *To be extended with support for:* | +| Network | | | +| | | - *Ethernet* | +| | | | +| | | - *LIN* | +| | | | +| | | - *K-Line* | +| | | | +| | | - *FlexRay* | ++--------------+-------------------------------------------+-------------------------------------------------------+ +| Layer 2 | - frames transmission | External python packages for bus handling: | +| Data | | | +| | - frames receiving | - CAN: | ++--------------+ | | +| Layer 1 | | - `python-can `_ | +| Physical | | | +| | | *More packages to be decided.* | ++--------------+-------------------------------------------+-------------------------------------------------------+ Where: - OSI Layer - considered OSI Model Layer diff --git a/docs/source/pages/user_guide.rst b/docs/source/pages/user_guide.rst index b3e0e260..30d29754 100644 --- a/docs/source/pages/user_guide.rst +++ b/docs/source/pages/user_guide.rst @@ -5,8 +5,8 @@ User Guide .. toctree:: :caption: Table of Content - user_guide/client_simulation.rst - user_guide/server_simulation.rst user_guide/message.rst - user_guide/transport.rst user_guide/segmentation.rst + user_guide/transport.rst + user_guide/client_simulation.rst + user_guide/server_simulation.rst diff --git a/docs/source/pages/user_guide/transport.rst b/docs/source/pages/user_guide/transport.rst index 71cf7c81..39bb426e 100644 --- a/docs/source/pages/user_guide/transport.rst +++ b/docs/source/pages/user_guide/transport.rst @@ -2,8 +2,7 @@ Transport Interfaces ==================== Transport interfaces are meant to handle Physical (layer 1), Data (layer 2), Network (layer 3) and Transport (layer 4) layers of UDS OSI model which are unique for every communication bus. First two layers (Physical and Data Link) are -usually handled by external packages (e.g. `python-can `_ handles -first two layers for CAN bus). Abstract API that is common for all Transport Interfaces (and therefore buses) +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. .. toctree:: @@ -11,8 +10,8 @@ is defined in :class:`~uds.transport_interface.abstract_transport_interface.Abst :caption: Implementation of Transport Interface: transport/can.rst - transport/ethernet.rst - transport/lin.rst transport/flexray.rst + transport/ethernet.rst transport/kline.rst + transport/lin.rst transport/custom.rst diff --git a/docs/source/pages/user_guide/transport/can.rst b/docs/source/pages/user_guide/transport/can.rst index 44f38e10..83d3235f 100644 --- a/docs/source/pages/user_guide/transport/can.rst +++ b/docs/source/pages/user_guide/transport/can.rst @@ -1,34 +1,186 @@ CAN Transport Interfaces ======================== -TODO: some general info +Implementation for Transport Interfaces that can be used with CAN bus. Common ------ -Common CAN implementation for all CAN :class:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface` +Common implementation for all all CAN Transport Interfaces is included in +:class:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface`. Configuration ````````````` -TODO: __init__ explanation +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: + +- 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` +- timing parameters (:ref:`N_Br `, :ref:`N_Cs `) - attributes + :attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.n_br` and + :attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.n_cs` +- communication timeout parameters (:ref:`N_As `, :ref:`N_Ar `, + :ref:`N_Bs `, :ref:`N_Cr `) - attributes + :attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.n_as_timeout`, + :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 ` + whether to use :ref:`data optimization for CAN frame `, + value of a :ref:`filler byte ` to use for 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`, + +Most of these attributes (all except :attr:`~uds.transport_interface.can_transport_interface.AbstractCanTransportInterface.addressing_information`) +can be changed after object is created. Python-CAN ---------- -TODO: :class:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface` +Class :class:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface` contains the implementation +of CAN Transport Interface that uses `python-can `_ package for receiving +and transmitting CAN frames. Configuration ````````````` -TODO: __init__ explanation (only diff) +Configuration is set upon calling +:meth:`uds.transport_interface.can_transport_interface.PyCanTransportInterface.__init__` method. + +**Example code:** + +.. code-block:: python + + import uds + from can import Bus + + # define example python-can bus interface (https://python-can.readthedocs.io/en/stable/bus.html#bus-api) + python_can_interface = Bus(interface="kvaser", channel=0, fd=True, receive_own_messages=True) + + # define Addressing Information for a CAN Node + can_node_addressing_information = uds.can.CanAddressingInformation( + addressing_format=uds.can.CanAddressingFormat.NORMAL_11BIT_ADDRESSING, + tx_physical={"can_id": 0x611}, + rx_physical={"can_id": 0x612}, + tx_functional={"can_id": 0x6FF}, + rx_functional={"can_id": 0x6FE}) + + # configure CAN Transport Interface for this CAN Node + can_transport_interface = uds.transport_interface.PyCanTransportInterface( + can_bus_manager=python_can_interface, + addressing_information=can_node_addressing_information, + n_as_timeout=50, + n_ar_timeout=900, + n_bs_timeout=50, + n_br=10, + n_cs=0, + n_cr_timeout = 900, + dlc=0xF, + use_data_optimization=True, + filler_byte=0x55) + + # change CAN Transport Interface configuration + can_transport_interface.n_as_timeout = uds.transport_interface.PyCanTransportInterface.N_AS_TIMEOUT + can_transport_interface.n_ar_timeout = uds.transport_interface.PyCanTransportInterface.N_AR_TIMEOUT + can_transport_interface.n_bs_timeout = uds.transport_interface.PyCanTransportInterface.N_BS_TIMEOUT + can_transport_interface.n_br = uds.transport_interface.PyCanTransportInterface.DEFAULT_N_BR + can_transport_interface.n_cs = uds.transport_interface.PyCanTransportInterface.DEFAULT_N_CS + can_transport_interface.n_cr_timeout = uds.transport_interface.PyCanTransportInterface.N_CR_TIMEOUT + can_transport_interface.dlc = 8 + can_transport_interface.use_data_optimization = False + can_transport_interface.filler_byte = 0xAA Send Packet ``````````` -TODO: -:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.send_packet` -and -:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_send_packet` +Once an object of :class:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface` class is created, +there are two methods which can be used to transmit CAN packets: + +- :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.send_packet` - for synchronous + implementation +- :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_send_packet` - for asynchronous + implementation + +**Example synchronous code:** + +.. code-block:: python + + # 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]) + + # segment the message to create a CAN packet + can_packet = can_transport_interface.segmenter.segmentation(message)[0] + + # send CAN packet and receive CAN packet record with historic information about the transmission and the transmitted CAN packet + can_packet_record = can_transport_interface.send_packet(can_packet) + + +**Example asynchronous code:** + +.. code-block:: python + + # 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]) + + # segment the message to create a CAN packet + can_packet = can_transport_interface.segmenter.segmentation(message)[0] + + # send CAN packet and receive CAN packet record with historic information about the transmission and the transmitted CAN packet + can_packet_record = await can_transport_interface.async_send_packet(can_packet) + +.. note:: In the example above, only a coroutine code was presented. If you need a manual how to run an asynchronous + program, visit https://docs.python.org/3/library/asyncio-runner.html#running-an-asyncio-program. + +.. warning:: Synchronous and asynchronous implementation shall not be mixed, so use either + :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.send_packet` and + :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.receive_packet` (synchronous) + or :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_send_packet` and + :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_receive_packet` (asynchronous) + methods for transmitting and receiving CAN Packets. + +.. seealso:: :ref:`Examples for python-can Transport Interface ` Receive Packet `````````````` -TODO: -:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.receive_packet` -and -:meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_receive_packet` +Once an object of :class:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface` class is created, +there are two methods which can be used to receive CAN packets: + +- :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.receive_packet` - for synchronous + implementation +- :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_receive_packet` - for asynchronous + implementation + +**Example synchronous code:** + +.. code-block:: python + + # let's assume that we have `can_transport_interface` already configured as presented in configuration example above + + # receive a CAN packet with timeout set to 1000 ms + can_packet_record = can_transport_interface.receive_packet(timeout=1000) + + +**Example asynchronous code:** + +.. code-block:: python + + # let's assume that we have `can_transport_interface` already configured as presented in configuration example above + + # receive a CAN packet with timeout set to 1000 ms + can_packet_record = await can_transport_interface.async_receive_packet(timeout=1000) + +.. note:: In the example above, only a coroutine code was presented. If you need a manual how to run an asynchronous + program, visit https://docs.python.org/3/library/asyncio-runner.html#running-an-asyncio-program. + +.. warning:: Synchronous and asynchronous implementation shall not be mixed, so use either + :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.send_packet` and + :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.receive_packet` (synchronous) + or :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_send_packet` and + :meth:`~uds.transport_interface.can_transport_interface.PyCanTransportInterface.async_receive_packet` (asynchronous) + methods for transmitting and receiving CAN Packets. + +.. seealso:: :ref:`Examples for python-can Transport Interface ` diff --git a/docs/source/tables/OSI_model_functionalities.tgn b/docs/source/tables/OSI_model_functionalities.tgn index e21a4062..12e98f15 100644 --- a/docs/source/tables/OSI_model_functionalities.tgn +++ b/docs/source/tables/OSI_model_functionalities.tgn @@ -1 +1 @@ -{"rows_views":[[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"OSI Layer","cspan":1,"rspan":1,"markup":[1,9]},{"value":"Functionalities","cspan":1,"rspan":1,"markup":[1,15]},{"value":"Implementation","cspan":1,"rspan":1,"markup":[1,14]}],[{"value":"Layer 7\nApplication","cspan":1,"rspan":1,"markup":[1,19]},{"value":"- diagnostic messages support","cspan":1,"rspan":1,"markup":[1,29]},{"value":"- :mod:`uds.message`","cspan":1,"rspan":1,"markup":[1,20]}],[{"value":"Layer 6\nPresentation","cspan":1,"rspan":1,"markup":[1,20]},{"value":"- diagnostic messages data interpretation\n\n- messaging database import from a file\n\n- messaging database export to a file","cspan":1,"rspan":1,"markup":[1,121]},{"value":"*To be provided with Database feature.*","cspan":1,"rspan":1,"markup":[1,39]}],[{"value":"Layer 5\nSession","cspan":1,"rspan":1,"markup":[1,15]},{"value":"- Client simulation\n\n- Server simulation","cspan":1,"rspan":1,"markup":[1,40]},{"value":"*To be provided with Client feature.*\n\n*To be provided with Server feature.*","cspan":1,"rspan":1,"markup":[1,76]}],[{"value":"Layer 4\nTransport","cspan":1,"rspan":1,"markup":[1,17]},{"value":"- UDS packet support\n\n- bus specific segmentation\n\n- bus specific packets transmission","cspan":1,"rspan":2,"markup":[1,86]},{"value":"- :mod:`uds.packet`\n\n- :mod:`uds.segmentation`\n\n- :mod:`uds.transport_interface`\n\n- :mod:`uds.can`\n\n*Currently under development.*\n\n*To be extended with support for:*\n\n- *Ethernet*\n\n- *LIN*\n\n- *K-Line*\n\n- *FlexRay*","cspan":1,"rspan":2,"markup":[1,214]}],[{"value":"Layer 3\nNetwork","cspan":1,"rspan":1,"markup":[1,15]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}],[{"value":"Layer 2\nData","cspan":1,"rspan":1,"markup":[1,12]},{"value":"- frames transmission\n\n- frames receiving","cspan":1,"rspan":2,"markup":[1,41]},{"value":"External python packages for bus handling:\n\n- `CAN `_\n\n*More packages to be decided.*","cspan":1,"rspan":2,"markup":[1,120]}],[{"value":"Layer 1\nPhysical","cspan":1,"rspan":1,"markup":[1,16]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}},null]},"options":{}} \ No newline at end of file +{"rows_views":[[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"OSI Layer","cspan":1,"rspan":1,"markup":[1,9]},{"value":"Functionalities","cspan":1,"rspan":1,"markup":[1,15]},{"value":"Implementation","cspan":1,"rspan":1,"markup":[1,14]}],[{"value":"Layer 7\nApplication","cspan":1,"rspan":1,"markup":[1,19]},{"value":"- diagnostic messages support","cspan":1,"rspan":1,"markup":[1,29]},{"value":"- :mod:`uds.message`","cspan":1,"rspan":1,"markup":[1,20]}],[{"value":"Layer 6\nPresentation","cspan":1,"rspan":1,"markup":[1,20]},{"value":"- diagnostic messages data interpretation\n\n- messaging database import from a file\n\n- messaging database export to a file","cspan":1,"rspan":1,"markup":[1,121]},{"value":"*To be provided with Database feature.*","cspan":1,"rspan":1,"markup":[1,39]}],[{"value":"Layer 5\nSession","cspan":1,"rspan":1,"markup":[1,15]},{"value":"- Client simulation\n\n- Server simulation","cspan":1,"rspan":1,"markup":[1,40]},{"value":"*To be provided with Client feature.*\n\n*To be provided with Server feature.*","cspan":1,"rspan":1,"markup":[1,76]}],[{"value":"Layer 4\nTransport","cspan":1,"rspan":1,"markup":[1,17]},{"value":"- UDS packet support\n\n- bus specific segmentation\n\n- bus specific packets transmission","cspan":1,"rspan":2,"markup":[1,86]},{"value":"- :mod:`uds.packet`\n\n- :mod:`uds.segmentation`\n\n- :mod:`uds.transport_interface`\n\n- :mod:`uds.can`\n\n*Currently under development.*\n\n*To be extended with support for:*\n\n- *Ethernet*\n\n- *LIN*\n\n- *K-Line*\n\n- *FlexRay*","cspan":1,"rspan":2,"markup":[1,214]}],[{"value":"Layer 3\nNetwork","cspan":1,"rspan":1,"markup":[1,15]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}],[{"value":"Layer 2\nData","cspan":1,"rspan":1,"markup":[1,12]},{"value":"- frames transmission\n\n- frames receiving","cspan":1,"rspan":2,"markup":[1,41]},{"value":"External python packages for bus handling:\n\n- CAN:\n\n - `python-can `_\n\n*More packages to be decided.*","cspan":1,"rspan":2,"markup":[1,138]}],[{"value":"Layer 1\nPhysical","cspan":1,"rspan":1,"markup":[1,16]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}},null]},"options":{}} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 02ef158b..d450abb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,14 +48,14 @@ dynamic = ["version"] [project.urls] -Homepage = "https://github.com/mdabrowski1990/uds" +"Homepage" = "https://github.com/mdabrowski1990/uds" "User Documentation" = "https://uds.readthedocs.io/en/latest/" -Repository = "https://github.com/mdabrowski1990/uds" +"Repository" = "https://github.com/mdabrowski1990/uds" "Issues Tracking System" = "https://github.com/mdabrowski1990/uds/issues" "Releases and Changelogs" = "https://github.com/mdabrowski1990/uds/releases" "Security Policy" = "https://github.com/mdabrowski1990/uds/security/policy" "PyPI" = "https://pypi.org/project/py-uds/" -Wiki = "https://github.com/mdabrowski1990/uds/wiki" +"Wiki" = "https://github.com/mdabrowski1990/uds/wiki" "Code Download" = "https://github.com/mdabrowski1990/uds/archive/refs/heads/main.zip" diff --git a/uds/__init__.py b/uds/__init__.py index bfba0e4d..46478843 100644 --- a/uds/__init__.py +++ b/uds/__init__.py @@ -26,9 +26,9 @@ __license__ = "MIT" -import uds.transmission_attributes import uds.can -import uds.packet import uds.message +import uds.packet import uds.segmentation +import uds.transmission_attributes import uds.transport_interface diff --git a/uds/transport_interface/can_transport_interface.py b/uds/transport_interface/can_transport_interface.py index b7228b1e..d721ed93 100644 --- a/uds/transport_interface/can_transport_interface.py +++ b/uds/transport_interface/can_transport_interface.py @@ -299,7 +299,11 @@ def n_cr_measured(self) -> Optional[TimeMillisecondsAlias]: @property def addressing_information(self) -> AbstractCanAddressingInformation: - """Addressing Information of Transport Interface.""" + """ + Addressing Information of Transport Interface. + + .. warning:: Once the value is set, it must not be changed as it might cause communication problems. + """ return self.__addressing_information @property @@ -371,7 +375,7 @@ def __init__(self, :param can_bus_manager: Python-can bus object for handling CAN. - .. warning:: Bus must have capability of receiving transmitted frame (``receive_own_messages=True`` set). + .. warning:: Bus must have capability of receiving transmitted frames (``receive_own_messages=True`` set). :param addressing_information: Addressing Information of CAN Transport Interface. :param kwargs: Optional arguments that are specific for CAN bus. From b52c219b892cce2e9e9c528ed55e7c20301575aa Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Tue, 31 Oct 2023 14:38:22 +0100 Subject: [PATCH 16/23] Update can.rst add link to knowledge base --- docs/source/pages/user_guide/transport/can.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/pages/user_guide/transport/can.rst b/docs/source/pages/user_guide/transport/can.rst index 83d3235f..a5e6d659 100644 --- a/docs/source/pages/user_guide/transport/can.rst +++ b/docs/source/pages/user_guide/transport/can.rst @@ -13,7 +13,7 @@ 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: -- Addressing Information of this CAN node - attribute +- :ref:`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` From 5e25fb4ce73794a4052032e8dc32f3f8e5796ad7 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Tue, 31 Oct 2023 15:20:51 +0100 Subject: [PATCH 17/23] Update ci.yml Remove python 3.12 from static code analysis as it is not stable at the moment --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26f76c49..485d2a52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11"] # TODO: Add "3.12" when stable steps: - uses: actions/checkout@v4 From 45d6747e2c35fadf508f304c5f6e5aa0b6e387bb Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Tue, 31 Oct 2023 15:22:57 +0100 Subject: [PATCH 18/23] Update conf.py test if graphviz extension needs to be specified --- docs/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index ee93b8a4..d6fa4bcc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,8 +50,7 @@ extensions = ["sphinx.ext.autodoc", "autoapi.extension", - "sphinx.ext.viewcode", - "sphinx.ext.graphviz"] + "sphinx.ext.viewcode"] autodoc_typehints = "description" autodoc_typehints_description_target = "all" From 06b8f0cf9679ab71fc7b5d7158cca242e15a979a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20D=C4=85browski?= <51504507+mdabrowski1990@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:38:36 +0100 Subject: [PATCH 19/23] Update segmentation.rst --- docs/source/pages/user_guide/segmentation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/pages/user_guide/segmentation.rst b/docs/source/pages/user_guide/segmentation.rst index 1e522149..3236346f 100644 --- a/docs/source/pages/user_guide/segmentation.rst +++ b/docs/source/pages/user_guide/segmentation.rst @@ -24,7 +24,7 @@ Following functionalities are provided by :class:`~uds.segmentation.can_segmente As a user, you are able to configure :class:`~uds.segmentation.can_segmenter.CanSegmenter` parameters which determines the addressing (Addressing Format and Addressing Information of input and output CAN packets) and the content - (e.g. Filler Byte value and whether to use CAN Frame Data Optimization) of CAN Packets. + (e.g. Filler Byte value and whether to use CAN Frame Data Optimization) of CAN packets. **Example code:** @@ -137,8 +137,8 @@ Following functionalities are provided by :class:`~uds.segmentation.can_segmente uds_message_1 = can_segmenter.desegmentation(can_packets_1) uds_message_2 = can_segmenter.desegmentation(can_packets_2) - .. warning:: Desegmentation performs only sanity check of CAN Packets content, therefore some inconsistencies + .. warning:: Desegmentation performs only sanity check of CAN packets content, therefore some inconsistencies with Diagnostic on CAN standard might be silently accepted as long as a message can be unambiguously decoded out of provided CAN packets. - .. note:: Desegmentation can be perform for any CAN Packets (not only those targeting this CAN Node) in any format. + .. note:: Desegmentation can be performed for any CAN packets (not only those targeting this CAN Node) in any format. From 386599a62b28578106c9246f6b75ca13d8d72581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20D=C4=85browski?= <51504507+mdabrowski1990@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:40:38 +0100 Subject: [PATCH 20/23] Update pyproject.toml adjust link to readthedocs --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d450abb3..53f3ae91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ dynamic = ["version"] [project.urls] "Homepage" = "https://github.com/mdabrowski1990/uds" -"User Documentation" = "https://uds.readthedocs.io/en/latest/" +"User Documentation" = "https://uds.readthedocs.io" "Repository" = "https://github.com/mdabrowski1990/uds" "Issues Tracking System" = "https://github.com/mdabrowski1990/uds/issues" "Releases and Changelogs" = "https://github.com/mdabrowski1990/uds/releases" From dcd443f33990ad896358dc8fda624bbfcbe0e708 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Tue, 31 Oct 2023 15:45:48 +0100 Subject: [PATCH 21/23] OSI Model update functionalities tables --- docs/source/pages/knowledge_base/osi_model.rst | 10 ++++------ docs/source/tables/OSI_model_functionalities.tgn | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/source/pages/knowledge_base/osi_model.rst b/docs/source/pages/knowledge_base/osi_model.rst index ab2e1db6..baa20360 100644 --- a/docs/source/pages/knowledge_base/osi_model.rst +++ b/docs/source/pages/knowledge_base/osi_model.rst @@ -75,11 +75,9 @@ An overview of features that are required to fully implement UDS protocol is pre | | | | | | | - :mod:`uds.can` | | | | | -| | | *Currently under development.* | -+--------------+ | | -| Layer 3 | | *To be extended with support for:* | -| Network | | | -| | | - *Ethernet* | ++--------------+ | *To be extended with support for:* | +| Layer 3 | | | +| Network | | - *Ethernet* | | | | | | | | - *LIN* | | | | | @@ -93,7 +91,7 @@ An overview of features that are required to fully implement UDS protocol is pre +--------------+ | | | Layer 1 | | - `python-can `_ | | Physical | | | -| | | *More packages to be decided.* | +| | | *More packages handling other buses to be decided.* | +--------------+-------------------------------------------+-------------------------------------------------------+ Where: diff --git a/docs/source/tables/OSI_model_functionalities.tgn b/docs/source/tables/OSI_model_functionalities.tgn index 12e98f15..00322cb0 100644 --- a/docs/source/tables/OSI_model_functionalities.tgn +++ b/docs/source/tables/OSI_model_functionalities.tgn @@ -1 +1 @@ -{"rows_views":[[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"OSI Layer","cspan":1,"rspan":1,"markup":[1,9]},{"value":"Functionalities","cspan":1,"rspan":1,"markup":[1,15]},{"value":"Implementation","cspan":1,"rspan":1,"markup":[1,14]}],[{"value":"Layer 7\nApplication","cspan":1,"rspan":1,"markup":[1,19]},{"value":"- diagnostic messages support","cspan":1,"rspan":1,"markup":[1,29]},{"value":"- :mod:`uds.message`","cspan":1,"rspan":1,"markup":[1,20]}],[{"value":"Layer 6\nPresentation","cspan":1,"rspan":1,"markup":[1,20]},{"value":"- diagnostic messages data interpretation\n\n- messaging database import from a file\n\n- messaging database export to a file","cspan":1,"rspan":1,"markup":[1,121]},{"value":"*To be provided with Database feature.*","cspan":1,"rspan":1,"markup":[1,39]}],[{"value":"Layer 5\nSession","cspan":1,"rspan":1,"markup":[1,15]},{"value":"- Client simulation\n\n- Server simulation","cspan":1,"rspan":1,"markup":[1,40]},{"value":"*To be provided with Client feature.*\n\n*To be provided with Server feature.*","cspan":1,"rspan":1,"markup":[1,76]}],[{"value":"Layer 4\nTransport","cspan":1,"rspan":1,"markup":[1,17]},{"value":"- UDS packet support\n\n- bus specific segmentation\n\n- bus specific packets transmission","cspan":1,"rspan":2,"markup":[1,86]},{"value":"- :mod:`uds.packet`\n\n- :mod:`uds.segmentation`\n\n- :mod:`uds.transport_interface`\n\n- :mod:`uds.can`\n\n*Currently under development.*\n\n*To be extended with support for:*\n\n- *Ethernet*\n\n- *LIN*\n\n- *K-Line*\n\n- *FlexRay*","cspan":1,"rspan":2,"markup":[1,214]}],[{"value":"Layer 3\nNetwork","cspan":1,"rspan":1,"markup":[1,15]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}],[{"value":"Layer 2\nData","cspan":1,"rspan":1,"markup":[1,12]},{"value":"- frames transmission\n\n- frames receiving","cspan":1,"rspan":2,"markup":[1,41]},{"value":"External python packages for bus handling:\n\n- CAN:\n\n - `python-can `_\n\n*More packages to be decided.*","cspan":1,"rspan":2,"markup":[1,138]}],[{"value":"Layer 1\nPhysical","cspan":1,"rspan":1,"markup":[1,16]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}},null]},"options":{}} \ No newline at end of file +{"rows_views":[[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"center","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}],[{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}},{"style":{"borders":"lrtb","font_style":{},"text_color":"","bg_color":"","halign":"left","valign":"top","padding":{"top":10,"right":5,"bottom":10,"left":5},"border_color":""}}]],"model":{"rows":[[{"value":"OSI Layer","cspan":1,"rspan":1,"markup":[1,9]},{"value":"Functionalities","cspan":1,"rspan":1,"markup":[1,15]},{"value":"Implementation","cspan":1,"rspan":1,"markup":[1,14]}],[{"value":"Layer 7\nApplication","cspan":1,"rspan":1,"markup":[1,19]},{"value":"- diagnostic messages support","cspan":1,"rspan":1,"markup":[1,29]},{"value":"- :mod:`uds.message`","cspan":1,"rspan":1,"markup":[1,20]}],[{"value":"Layer 6\nPresentation","cspan":1,"rspan":1,"markup":[1,20]},{"value":"- diagnostic messages data interpretation\n\n- messaging database import from a file\n\n- messaging database export to a file","cspan":1,"rspan":1,"markup":[1,121]},{"value":"*To be provided with Database feature.*","cspan":1,"rspan":1,"markup":[1,39]}],[{"value":"Layer 5\nSession","cspan":1,"rspan":1,"markup":[1,15]},{"value":"- Client simulation\n\n- Server simulation","cspan":1,"rspan":1,"markup":[1,40]},{"value":"*To be provided with Client feature.*\n\n*To be provided with Server feature.*","cspan":1,"rspan":1,"markup":[1,76]}],[{"value":"Layer 4\nTransport","cspan":1,"rspan":1,"markup":[1,17]},{"value":"- UDS packet support\n\n- bus specific segmentation\n\n- bus specific packets transmission","cspan":1,"rspan":2,"markup":[1,86]},{"value":"- :mod:`uds.packet`\n\n- :mod:`uds.segmentation`\n\n- :mod:`uds.transport_interface`\n\n- :mod:`uds.can`\n\n*To be extended with support for:*\n\n- *Ethernet*\n\n- *LIN*\n\n- *K-Line*\n\n- *FlexRay*","cspan":1,"rspan":2,"markup":[1,182]}],[{"value":"Layer 3\nNetwork","cspan":1,"rspan":1,"markup":[1,15]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}],[{"value":"Layer 2\nData","cspan":1,"rspan":1,"markup":[1,12]},{"value":"- frames transmission\n\n- frames receiving","cspan":1,"rspan":2,"markup":[1,41]},{"value":"External python packages for bus handling:\n\n-  CAN:\n\n  - `python-can `_\n\n*More packages handling other buses to be decided.*","cspan":1,"rspan":2,"markup":[1,159]}],[{"value":"Layer 1\nPhysical","cspan":1,"rspan":1,"markup":[1,16]},{"value":"","cspan":1,"rspan":-1,"markup":[]},{"value":"","cspan":1,"rspan":-1,"markup":[]}]]},"theme":null,"fixed_layout":false,"markup":{"instances":[{},{"style":{"fontWeight":"","fontStyle":"","textDecoration":"","color":"","backgroundColor":""}},null]},"options":{}} \ No newline at end of file From 5e38cadbf9376efd84c67e7fca610895cf6d5ca9 Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Tue, 31 Oct 2023 16:41:35 +0100 Subject: [PATCH 22/23] self-review fix minor mistakes --- docs/source/pages/user_guide/segmentation.rst | 2 +- docs/source/pages/user_guide/transport.rst | 1 + .../source/pages/user_guide/transport/can.rst | 27 ++++++++++++------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/source/pages/user_guide/segmentation.rst b/docs/source/pages/user_guide/segmentation.rst index 3236346f..d204368c 100644 --- a/docs/source/pages/user_guide/segmentation.rst +++ b/docs/source/pages/user_guide/segmentation.rst @@ -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 diff --git a/docs/source/pages/user_guide/transport.rst b/docs/source/pages/user_guide/transport.rst index 39bb426e..2260c0af 100644 --- a/docs/source/pages/user_guide/transport.rst +++ b/docs/source/pages/user_guide/transport.rst @@ -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 diff --git a/docs/source/pages/user_guide/transport/can.rst b/docs/source/pages/user_guide/transport/can.rst index a5e6d659..d57c2933 100644 --- a/docs/source/pages/user_guide/transport/can.rst +++ b/docs/source/pages/user_guide/transport/can.rst @@ -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 ` 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` @@ -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 ` - whether to use :ref:`data optimization for CAN frame `, - value of a :ref:`filler byte ` to use for CAN frame data padding) - attributes +- UDS message segmentation parameters (:ref:`base DLC of a CAN frame `, + flag whether to use :ref:`data optimization for CAN frame `, + and the value to use for :ref:`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`, @@ -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:** @@ -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] @@ -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] From c88c178920f1987c605eaf449acd804d6b43283a Mon Sep 17 00:00:00 2001 From: Maciej Dabrowski Date: Thu, 2 Nov 2023 15:13:01 +0100 Subject: [PATCH 23/23] Update .readthedocs.yaml Add link to documentation --- .readthedocs.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0ea46a0c..7266c2fe 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,3 +1,5 @@ +# Documentation: https://docs.readthedocs.io/en/stable/config-file/v2.html#configuration-file-v2-readthedocs-yaml + # Required version: 2 @@ -27,5 +29,5 @@ formats: # Optionally set the version of Python and requirements required to build your docs python: install: - - requirements: docs/requirements_for_docs.txt - requirements: requirements.txt + - requirements: docs/requirements_for_docs.txt