uds.can.addressing.normal_addressing ==================================== .. py:module:: uds.can.addressing.normal_addressing .. autoapi-nested-parse:: Implementation of Normal CAN Addressing formats. Classes ------- .. autoapisummary:: uds.can.addressing.normal_addressing.NormalCanAddressingInformation uds.can.addressing.normal_addressing.NormalFixedCanAddressingInformation Module Contents --------------- .. py:class:: NormalCanAddressingInformation(rx_physical_params, tx_physical_params, rx_functional_params, tx_functional_params) Bases: :py:obj:`uds.can.addressing.abstract_addressing_information.AbstractCanAddressingInformation` .. autoapi-inheritance-diagram:: uds.can.addressing.normal_addressing.NormalCanAddressingInformation :parts: 1 :private-bases: Addressing Information of CAN Entity (either server or client) that uses Normal Addressing format. Configure Addresses of UDS Entity (either a server or a client) for UDS over CAN communication. :param rx_physical_params: Addressing parameters for incoming physically addressed communication. :param tx_physical_params: Addressing parameters for outgoing physically addressed communication. :param rx_functional_params: Addressing parameters for incoming functionally addressed communication. :param tx_functional_params: Addressing parameters for outgoing functionally addressed communication. .. py:attribute:: ADDRESSING_FORMAT :value: 'Normal Addressing' CAN Addressing Format used. .. py:attribute:: AI_DATA_BYTES_NUMBER :value: 0 Number of CAN frame data bytes that are used to carry Addressing Information. .. py:method:: _validate_addressing_information() Validate Addressing Information parameters. :raise InconsistencyError: Provided values are not consistent with each other. .. py:method:: validate_addressing_params(addressing_type, addressing_format = ADDRESSING_FORMAT, can_id = None, target_address = None, source_address = None, address_extension = None) :classmethod: Validate Addressing Information parameters in Normal Addressing format. :param addressing_type: Addressing type to validate. :param addressing_format: CAN Addressing Format to validate. :param can_id: CAN Identifier value to validate. :param target_address: Target Address value to validate. :param source_address: Source Address value to validate. :param address_extension: Address Extension value to validate. :raise ValueError: Provided Addressing format cannot be handled by this class. :raise UnusedArgumentError: At least one provided parameter is not supported by this Addressing format. :raise InconsistencyError: Provided CAN ID value is incompatible with Normal Addressing format. :return: Normalized dictionary with the provided Addressing Information. .. py:method:: is_compatible_can_id(can_id, addressing_type = None) :staticmethod: Check whether provided CAN ID is consistent with Normal Addressing format. :param can_id: Value of CAN ID to check. :param addressing_type: Addressing type for which consistency to be performed. Leave None to skip crosscheck between CAN Identifier and Addressing Type. :return: True if CAN ID value is compatible with this CAN Addressing Format, False otherwise. .. py:method:: decode_can_id_ai_params(can_id) :staticmethod: Decode Addressing Information parameters from CAN Identifier. :param can_id: Value of a CAN Identifier. :return: Decoded Addressing Information parameters. .. py:method:: decode_data_bytes_ai_params(ai_data_bytes) :staticmethod: Decode Addressing Information parameters from CAN data bytes. :param ai_data_bytes: Data bytes containing Addressing Information. :return: Decoded Addressing Information parameters. .. py:method:: encode_ai_data_bytes(target_address = None, address_extension = None) :classmethod: Generate data bytes that carry Addressing Information. :param target_address: Target Address value used. :param address_extension: Source Address value used. :return: Data bytes that carry Addressing Information in a CAN frame Data field. .. py:class:: NormalFixedCanAddressingInformation(rx_physical_params, tx_physical_params, rx_functional_params, tx_functional_params) Bases: :py:obj:`uds.can.addressing.abstract_addressing_information.AbstractCanAddressingInformation` .. autoapi-inheritance-diagram:: uds.can.addressing.normal_addressing.NormalFixedCanAddressingInformation :parts: 1 :private-bases: Addressing Information of CAN Entity (either server or client) that uses Normal Fixed Addressing format. Configure Addresses of UDS Entity (either a server or a client) for UDS over CAN communication. :param rx_physical_params: Addressing parameters for incoming physically addressed communication. :param tx_physical_params: Addressing parameters for outgoing physically addressed communication. :param rx_functional_params: Addressing parameters for incoming functionally addressed communication. :param tx_functional_params: Addressing parameters for outgoing functionally addressed communication. .. py:attribute:: ADDRESSING_FORMAT :value: 'Normal Fixed Addressing' CAN Addressing format used. .. py:attribute:: AI_DATA_BYTES_NUMBER :value: 0 Number of CAN frame data bytes that are used to carry Addressing Information. .. py:method:: _validate_addressing_information() Validate Addressing Information parameters. :raise InconsistencyError: Provided values are not consistent with each other. .. py:method:: validate_addressing_params(addressing_type, addressing_format = ADDRESSING_FORMAT, can_id = None, target_address = None, source_address = None, address_extension = None) :classmethod: Validate Addressing Information parameters of a CAN packet that uses Normal Fixed Addressing format. :param addressing_type: Addressing type to validate. :param addressing_format: CAN Addressing Format to validate. :param can_id: CAN Identifier value to validate. :param target_address: Target Address value to validate. :param source_address: Source Address value to validate. :param address_extension: Address Extension value to validate. :raise ValueError: Provided Addressing format cannot be handled by this class. :raise UnusedArgumentError: At least one provided parameter is not supported by this Addressing format. :raise InconsistencyError: Provided Target Address, Source Address or CAN ID values are incompatible with each other or Normal Fixed Addressing format. :return: Normalized dictionary with the provided Addressing Information. .. py:method:: is_compatible_can_id(can_id, addressing_type = None) :staticmethod: Check whether provided CAN ID is consistent with Normal Fixed Addressing format. :param can_id: Value of CAN ID to check. :param addressing_type: Addressing type for which consistency to be performed. Leave None to skip crosscheck between CAN Identifier and Addressing Type. :return: True if CAN ID value is compatible with this CAN Addressing Format, False otherwise. .. py:method:: decode_can_id_ai_params(can_id) :classmethod: Decode Addressing Information parameters from CAN Identifier. :param can_id: Value of a CAN Identifier. :return: Decoded Addressing Information parameters. .. py:method:: decode_data_bytes_ai_params(ai_data_bytes) :staticmethod: Decode Addressing Information parameters from CAN data bytes. :param ai_data_bytes: Data bytes containing Addressing Information. :return: Decoded Addressing Information parameters. .. py:method:: encode_can_id(addressing_type, target_address, source_address, priority = CanIdHandler.DEFAULT_PRIORITY_VALUE) :classmethod: Generate CAN ID value for Normal Fixed CAN Addressing format. :param addressing_type: Addressing type used. :param target_address: Target Address value to use. :param source_address: Source Address value to use. :param priority: Priority parameter value to use. :raise NotImplementedError: There is missing implementation for the provided Addressing Type. :return: Value of CAN ID (compatible with Normal Fixed Addressing Format) that was generated from the provided values. .. py:method:: encode_ai_data_bytes(target_address = None, address_extension = None) :classmethod: Generate data bytes that carry Addressing Information. :param target_address: Target Address value used. :param address_extension: Source Address value used. :return: Data bytes that carry Addressing Information in a CAN frame Data field.