uds.transport_interface.can.common ================================== .. py:module:: uds.transport_interface.can.common .. autoapi-nested-parse:: Definition of UDS Transport Interface for CAN bus. Classes ------- .. autoapisummary:: uds.transport_interface.can.common.AbstractCanTransportInterface Module Contents --------------- .. py:class:: AbstractCanTransportInterface(can_bus_manager, addressing_information, **kwargs) Bases: :py:obj:`uds.transport_interface.abstract_transport_interface.AbstractTransportInterface` .. autoapi-inheritance-diagram:: uds.transport_interface.can.common.AbstractCanTransportInterface :parts: 1 :private-bases: Abstract definition of Transport Interface for managing UDS on CAN bus. CAN Transport Interfaces are meant to handle UDS middle layers (Transport and Network) on CAN bus. Create Transport Interface (an object for handling UDS Transport and Network layers). :param can_bus_manager: An object that handles CAN bus (Physical and Data layers of OSI Model). :param addressing_information: Addressing Information of CAN Transport Interface. :param kwargs: Optional arguments that are specific for CAN bus. - :parameter n_as_timeout: Timeout value for :ref:`N_As ` time parameter. - :parameter n_ar_timeout: Timeout value for :ref:`N_Ar ` time parameter. - :parameter n_bs_timeout: Timeout value for :ref:`N_Bs ` time parameter. - :parameter n_br: Value of :ref:`N_Br ` time parameter to use in communication. - :parameter n_cs: Value of :ref:`N_Cs ` time parameter to use in communication. - :parameter n_cr_timeout: Timeout value for :ref:`N_Cr ` time parameter. - :parameter dlc: Base CAN DLC value to use for CAN packets. - :parameter use_data_optimization: Information whether to use :ref:`CAN Frame Data Optimization `. - :parameter filler_byte: Filler byte value to use for :ref:`CAN Frame Data Padding `. - :parameter flow_control_parameters_generator: Generator with Flow Control parameters to use. :raise TypeError: Provided Addressing Information value has unexpected type. .. py:attribute:: N_AS_TIMEOUT :type: uds.utilities.TimeMillisecondsAlias :value: 1000 Timeout value of :ref:`N_As ` time parameter according to ISO 15765-2. .. py:attribute:: N_AR_TIMEOUT :type: uds.utilities.TimeMillisecondsAlias :value: 1000 Timeout value of :ref:`N_Ar ` time parameter according to ISO 15765-2. .. py:attribute:: N_BS_TIMEOUT :type: uds.utilities.TimeMillisecondsAlias :value: 1000 Timeout value of :ref:`N_Bs ` time parameter according to ISO 15765-2. .. py:attribute:: N_CR_TIMEOUT :type: uds.utilities.TimeMillisecondsAlias :value: 1000 Timeout value of :ref:`N_Cr ` time parameter according to ISO 15765-2. .. py:attribute:: DEFAULT_N_BR :type: uds.utilities.TimeMillisecondsAlias :value: 0 Default value of :ref:`N_Br ` time parameter. .. py:attribute:: DEFAULT_N_CS :type: Optional[uds.utilities.TimeMillisecondsAlias] :value: None Default value of :ref:`N_Cs ` time parameter. .. py:attribute:: DEFAULT_FLOW_CONTROL_PARAMETERS Default value of :ref:`Flow Control ` parameters (:ref:`Flow Status `, :ref:`Block Size `, :ref:`Separation Time minimum `). .. py:attribute:: __addressing_information :type: uds.can.AbstractCanAddressingInformation .. py:attribute:: __n_bs_measured :type: Optional[Tuple[uds.utilities.TimeMillisecondsAlias, Ellipsis]] :value: None .. py:attribute:: __n_cr_measured :type: Optional[Tuple[uds.utilities.TimeMillisecondsAlias, Ellipsis]] :value: None .. py:property:: n_as_timeout :type: uds.utilities.TimeMillisecondsAlias Timeout value for :ref:`N_As ` time parameter. .. py:property:: n_ar_timeout :type: uds.utilities.TimeMillisecondsAlias Timeout value for :ref:`N_Ar ` time parameter. .. py:property:: n_bs_timeout :type: uds.utilities.TimeMillisecondsAlias Timeout value for :ref:`N_Bs ` time parameter. .. py:property:: n_cr_timeout :type: uds.utilities.TimeMillisecondsAlias Timeout value for :ref:`N_Cr ` time parameter. .. py:property:: n_br :type: uds.utilities.TimeMillisecondsAlias Get the value of :ref:`N_Br ` time parameter which is currently set. .. note:: The actual (observed on the bus) value will be slightly longer as it also includes computation and CAN Interface delays. .. py:property:: n_cs :type: Optional[uds.utilities.TimeMillisecondsAlias] Get the value of :ref:`N_Cs ` time parameter which is currently set. .. note:: The actual (observed on the bus) value will be slightly longer as it also includes computation and CAN Interface delays. .. py:property:: flow_control_parameters_generator :type: uds.can.AbstractFlowControlParametersGenerator Get generator of Flow Control parameters (Flow Status, Block Size, Separation Time minimum). .. py:attribute:: __segmenter .. py:method:: _update_n_bs_measured(message) Update measured values of :ref:`N_Bs ` according to timestamps of CAN packet records. :param message: Record of UDS message transmitted over CAN. .. py:method:: _update_n_cr_measured(message) Update measured values of :ref:`N_Cr ` according to timestamps of CAN packet records. :param message: Record of UDS message transmitted over CAN. .. py:property:: segmenter :type: uds.segmentation.CanSegmenter Value of the segmenter used by this CAN Transport Interface. .. py:property:: n_as_measured :type: Optional[uds.utilities.TimeMillisecondsAlias] :abstractmethod: Get the last measured value of :ref:`N_As ` time parameter. .. note:: The last measurement comes from the last transmission of Single Frame or First Fame CAN Packet using either :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.send_packet` or :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.async_send_packet` method. :return: Time in milliseconds or None if the value was never measured. .. py:property:: n_ar_measured :type: Optional[uds.utilities.TimeMillisecondsAlias] :abstractmethod: Get the last measured value of :ref:`N_Ar ` time parameter. .. note:: The last measurement comes from the last transmission of Flow Control CAN Packet using either :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.send_packet` or :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.async_send_packet` method. :return: Time in milliseconds or None if the value was never measured. .. py:property:: n_bs_measured :type: Optional[Tuple[uds.utilities.TimeMillisecondsAlias, Ellipsis]] Get the last measured values of :ref:`N_Bs ` time parameter. .. note:: The last measurement comes from the last transmission of UDS message using either :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.send_message` or :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.async_send_message` method. :return: Tuple with times in milliseconds or None if the values could not be measured. .. py:property:: n_br_max :type: uds.utilities.TimeMillisecondsAlias Get the maximum valid value of :ref:`N_Br ` time parameter. .. warning:: To assess maximal value of :ref:`N_Br `, the actual value of :ref:`N_Ar ` time parameter is required. Either the latest measured value of :ref:`N_Ar ` would be used, or 0ms would be assumed (if there are no measurement result). .. py:property:: n_cs_max :type: uds.utilities.TimeMillisecondsAlias Get the maximum valid value of :ref:`N_Cs ` time parameter. .. warning:: To assess maximal value of :ref:`N_Cs `, the actual value of :ref:`N_As ` time parameter is required. Either the latest measured value of :ref:`N_As ` would be used, or 0ms would be assumed (if there are no measurement result). .. py:property:: n_cr_measured :type: Optional[Tuple[uds.utilities.TimeMillisecondsAlias, Ellipsis]] Get the last measured values of :ref:`N_Cr ` time parameter. .. note:: The last measurement comes from the last reception of UDS message using either :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.receive_message` or :meth:`~uds.transport_interface.can.AbstractCanTransportInterface.async_receive_message` method. :return: Tuple with times in milliseconds or None if the values could not be measured. .. py:property:: addressing_information :type: uds.can.AbstractCanAddressingInformation Addressing Information of Transport Interface. .. warning:: Once the value is set, it must not be changed as it might cause communication problems. .. py:property:: dlc :type: int Value of base CAN DLC to use for output CAN packets. .. note:: All output CAN packets will have this DLC value set unless :ref:`CAN Frame Data Optimization ` is used. .. py:property:: use_data_optimization :type: bool Information whether to use CAN Frame Data Optimization during CAN packets creation. .. seealso:: :ref:`CAN Frame Data Optimization ` .. py:property:: filler_byte :type: int Filler byte value to use for output CAN Frame Data Padding during segmentation. .. seealso:: :ref:`CAN Frame Data Padding `