uds.diagnostic_configuration.ecu_configuration ============================================== .. py:module:: uds.diagnostic_configuration.ecu_configuration .. autoapi-nested-parse:: Implementation for diagnostic ECU Configuration. Classes ------- .. autoapisummary:: uds.diagnostic_configuration.ecu_configuration.EcuDiagnosticConfiguration Module Contents --------------- .. py:class:: EcuDiagnosticConfiguration(*, states, sid_restrictions, subfunction_restrictions, did_restrictions, rid_restrictions) Configuration of restrictions used by ECU for diagnostic messages. Configure restrictions used by ECU for diagnostic messages. :param states: ECU states relevant for diagnostic communication. :param sid_restrictions: Requirements on states to execute request message successfully with given SID value. :param subfunction_restrictions: Requirements on states to execute request message successfully with given SubFunction value. :param did_restrictions: Requirements on states to execute request message successfully with given DID value. :param rid_restrictions: Requirements on states to execute request message successfully with given RID value. .. note:: By default all possible restrictions are applied. Conclusions: If some parameter is always supported, all states and their values have to be provided. If some parameter is never support, no need to include restrictions with empty values. .. py:attribute:: RequiredStatesAlias Alias storing states names and required values. .. py:property:: states :type: Set[uds.diagnostic_configuration.state.State] Get ECU states that are relevant for diagnostic communication. .. py:property:: sid_restrictions :type: Mapping[uds.message.SidAlias, RequiredStatesAlias] Get ECU restrictions for SID handling. .. py:property:: subfunction_restrictions :type: Mapping[uds.message.SidAlias, Mapping[int, RequiredStatesAlias]] Get ECU restrictions for SubFunctions handling. .. py:property:: did_restrictions :type: Mapping[uds.message.SidAlias, Mapping[int, RequiredStatesAlias]] Get ECU restrictions for DIDs handling. .. py:property:: rid_restrictions :type: Mapping[uds.message.SidAlias, Mapping[int, RequiredStatesAlias]] Get ECU restrictions for SID handling. .. py:method:: __getitem__(item) Get State by name. .. py:property:: states_names :type: Set[str] Get names of all ECU states. .. py:property:: states_mapping :type: Mapping[str, uds.diagnostic_configuration.state.State] Get names of all ECU states. .. py:method:: __validate_required_states(required_states) Validate required states mapping. :param required_states: State name to restricted state values. :raise InconsistencyError: Provided mapping is not consistent with configured states. :return: The same mapping using non-mutable types. .. py:method:: __extract_subfunction(message_payload) :staticmethod: Extract subfunction from message payload. .. py:method:: __extract_dids(decoded_message) :staticmethod: Extract DIDs from decoded message. .. py:method:: __extract_rids(decoded_message) :staticmethod: Extract RIDs from decoded message. .. py:method:: combine_restrictions(*restrictions) Combine multiple restrictions. :param restrictions: Restrictions to combine. :raise ValueError: At least one restriction must be provided. :return: Combined restrictions. .. py:method:: get_restrictions(message_payload) Get restrictions used by ECU for given diagnostic message. :param message_payload: Payload of message to get restrictions for. :return: Mapping with diagnostic message restrictions, where: - key is a state name - value is a collection of values that given state have to take to successfully execute the message