uds.segmentation.abstract_segmenter =================================== .. py:module:: uds.segmentation.abstract_segmenter .. autoapi-nested-parse:: Definition of API for segmentation and desegmentation strategies. Exceptions ---------- .. autoapisummary:: uds.segmentation.abstract_segmenter.SegmentationError Classes ------- .. autoapisummary:: uds.segmentation.abstract_segmenter.AbstractSegmenter Module Contents --------------- .. py:exception:: SegmentationError Bases: :py:obj:`ValueError` .. autoapi-inheritance-diagram:: uds.segmentation.abstract_segmenter.SegmentationError :parts: 1 :private-bases: UDS segmentation or desegmentation process cannot be completed due to input data inconsistency. Initialize self. See help(type(self)) for accurate signature. .. py:class:: AbstractSegmenter Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: uds.segmentation.abstract_segmenter.AbstractSegmenter :parts: 1 :private-bases: Abstract definition of a segmenter class. Segmenter classes defines UDS segmentation and desegmentation duties. They contain helper methods that are essential for successful :ref:`segmentation ` and :ref:`desegmentation ` execution. .. note:: Each concrete segmenter class handles exactly one bus. .. py:property:: supported_packet_class :type: Type[uds.packet.AbstractUdsPacket] :abstractmethod: Class of UDS Packet supported by this segmenter. .. py:property:: supported_packet_record_class :type: Type[uds.packet.AbstractUdsPacketRecord] :abstractmethod: Class of UDS Packet Record supported by this segmenter. .. py:method:: is_supported_packet_type(packet) Check if the argument value is a packet object of a supported type. :param packet: Packet object to check. :return: True if provided value is an object of a supported packet type, False otherwise. .. py:method:: is_input_packet(**kwargs) :abstractmethod: Check if provided frame attributes belong to a UDS packet which is an input for this Segmenter. :param kwargs: Attributes of a frame to check. :return: Addressing Type used for transmission of this UDS packet according to the configuration of this Segmenter (if provided attributes belongs to an input UDS packet), otherwise None. .. py:method:: is_supported_packets_sequence_type(packets) Check if the argument value is a packets sequence of a supported type. :param packets: Packets sequence to check. :return: True if provided value is a packets sequence of a supported type, False otherwise. .. py:method:: is_desegmented_message(packets) :abstractmethod: Check whether provided packets are full sequence of packets that form exactly one diagnostic message. :param packets: Packets sequence to check. :return: True if the packets form exactly one diagnostic message. False if there are missing, additional or inconsistent (e.g. two packets that initiate a message) packets. .. py:method:: desegmentation(packets) :abstractmethod: Perform desegmentation of UDS packets. :param packets: UDS packets to desegment into UDS message. :raise SegmentationError: Provided packets are not a complete packet sequence that form a diagnostic message. :return: A diagnostic message that is carried by provided UDS packets. .. py:method:: segmentation(message) :abstractmethod: Perform segmentation of a diagnostic message. :param message: UDS message to divide into UDS packets. :raise SegmentationError: Provided diagnostic message cannot be segmented. :return: UDS packet(s) that carry provided diagnostic message.