Client

The UDS client is a simple client that works synchronously and can handle a single request/response at a time. When requesting a service, the client executes these tasks:

  • Builds a payload

  • Calls the connection empty_rxqueue method.

  • Sends the request

  • Waits for a response, with timeout

  • Interprets the response data

  • Validates the response content

  • Returns the response

The goal of this client is to simplify the usage of the Services object by exposing only useful arguments, hiding repetitive values, handling exceptions and logging. It can detect usage errors as well as malformed server responses.

The client will raise a NegativeResponseException when the server responds with a negative response.

The client may raise InvalidResponseException if the payload is incomplete or if the underlying service raises this exception while parsing the response data.

The client may raise UnexpectedResponseException if the response from the server does not match the last request sent. For example, if the service number in the response is different from the service number in the request. Another case would be if the echo of a parameter for a specific service does not match the request. For instance, if an ECUReset subfunction is the reset type, a valid server response will include an echo of the reset type in its payload.

class udsoncan.client.Client(self, conn, config=default_client_config, request_timeout=None)[source]

Object that interacts with a UDS server. It builds a service request, sends it to the server, receives and parses its response, detects communication anomalies and logs what it is doing for further debugging.

Parameters:
  • conn (Connection) – The underlying protocol interface.

  • config (dict) – The client configuration

  • request_timeout (int) – Maximum amount of time to wait for a response. This parameter exists for backward compatibility only. For detailed timeout handling, see Client configuration


Configuration

The client configuration must be a dictionary with the following keys defined:

exception_on_negative_response (bool)

When set to True, the client will raise a NegativeResponseException when the server responds with a negative response. When set to False, the returned Response will have its property positive set to False

exception_on_invalid_response (bool)

When set to True, the client will raise a InvalidResponseException when the underlying service interpret_response raises the same exception. When set to False, the returned Response will have its property valid set to False

exception_on_unexpected_response (bool)

When set to True, the client will raise a UnexpectedResponseException when the server returns a response that is not expected. For instance, a response for a different service or when the subfunction echo doesn’t match the request. When set to False, the returned Response will have its property unexpected set to True in the same case.

security_algo (callable)

The implementation of the security algorithm necessary for the SecurityAccess service. This function must have the following signatures:

SomeAlgorithm(level, seed, params)
Parameters:
  • level (int) – The requested security level.

  • seed (bytes) – The seed given by the server

  • params – The value provided by the client configuration security_algo_params

Returns:

The security key

Return type:

bytes

Warning

Starting from v1.12, parameters are passed by name, so their order is not important, but their name is. Also, for backward compatibility, Python reflection is used to pass only arguments present in the signature. So a signature such as SomeAlgorithm() would be accepted.

See an example

security_algo_params (...)

This value will be given to the security algorithm defined in config['security_algo']. This value can be any Python object, including a dictionary.

data_identifiers (dict)

This configuration is a dictionary that is mapping an integer (the data identifier) with a DidCodec. These codecs will be used to convert values to byte payload and vice-versa when sending/receiving data for a service that needs a DID, i.e.:

Possible configuration values are

  • string : The string will be used as a pack/unpack string when processing the data

  • DidCodec (class or instance) : The encode/decode method will be used to process the data

The special dictionnary key ‘default’ can be used to specify a fallback codec if an operation is done on a codec not part of the configuration. Useful for scanning a range of DID

input_output (dict)

This configuration is a dictionary that is mapping an integer (the IO data identifier) with a DidCodec specifically for the InputOutputControlByIdentifier service. Just like config[data_identifers], these codecs will be used to convert values to byte payload and vice-versa when sending/receiving data.

Since InputOutputControlByIdentifier supports composite codecs, it is possible to provide a sub-dictionary as a codec specifying the bitmasks.

Possible configuration values are:

  • string : The string will be used as a pack/unpack string when processing the data

  • DidCodec (class or instance) : The encode/decode method will be used to process the data

  • dict : The dictionary entry indicates a composite DID. Three subkeys must be defined as:

    • codec : The codec, a string or a DidCodec class/instance

    • mask : A dictionary mapping the mask name with a bit

    • mask_size : An integer indicating on how many bytes must the mask be encoded

The special dictionnary key ‘default’ can be used to specify a fallback codec if an operation is done on a codec not part of the configuration. Useful for scanning a range of DID

See this example to see how IO codecs are defined.

tolerate_zero_padding (bool)

This value will be passed to the services ‘interpret_response’ when the parameter is supported as in ReadDataByIdentifier, ReadDTCInformation. It has to ignore trailing zeros in the response data to avoid falsely raising InvalidResponseException if the underlying protocol uses some zero-padding.

ignore_all_zero_dtc (bool)

This value is used with the ReadDTCInformation service when reading DTCs. It will skip any DTC that has an ID of 0x000000. If the underlying protocol uses zero-padding, it may generate a valid response data of all zeros. This parameter is different from config['tolerate_zero_padding'].

Consider a server response that contains a list of DTCs where all DTCs must be 4 bytes long (ID and status). Say that the server returns a single DTC of value 0x123456, with status 0x78 over a transport protocol that uses zero-padding. Let’s study 5 different payloads.

  1. 1234567800 (invalid)

  2. 123456780000 (invalid)

  3. 12345678000000 (invalid)

  4. 1234567800000000 (valid)

  5. 123456780000000000 (invalid)

In this situation, all cases except case 4 would raise a InvalidResponseException because of their incorrect lengths (unless config['tolerate_zero_padding'] is set to True). Case 4 would return 2 DTCs, the second DTC with an ID of 0x000000 and a status of 0x00. Setting config['ignore_all_zero_dtc'] to True will make the functions return only the first valid DTC.

server_address_format (int)

The MemoryLocation server_address_format is the value to use when none is specified explicitly for methods expecting a parameter of type MemoryLocation.

See an example

server_memorysize_format (int)

The MemoryLocation server_memorysize_format is the value to use when none is specified explicitly for methods expecting a parameter of type MemoryLocation

See an example

extended_data_size (dict[int] = int)

This is the description of all the DTC extended data record sizes. This value is used to decode the server response when requesting a DTC extended data. The value must be specified as follows:

config['extended_data_size'] = {
   0x123456 : 45, # Extended data for DTC 0x123456 is 45 bytes long
   0x123457 : 23 # Extended data for DTC 0x123457 is 23 bytes long
}
dtc_snapshot_did_size (int)

The number of bytes used to encode a data identifier specifically for ReadDTCInformation subfunction reportDTCSnapshotRecordByDTCNumber and reportDTCSnapshotRecordByRecordNumber. The UDS standard does not specify a DID size although all other services expect a DID encoded over 2 bytes (16 bits). Default value of 2

standard_version (int)

The standard version to use, valid values are : 2006, 2013, 2020. Default value is 2020

request_timeout (float)

Maximum amount of time in seconds to wait for a response of any kind, positive or negative, after sending a request. After this time is elapsed, a TimeoutException will be raised regardless of other timeouts value or previous client responses. In particular even if the server requests that the client wait, by returning response requestCorrectlyReceived-ResponsePending (0x78), this timeout will still trigger.

If you wish to disable this behaviour and have your server wait for as long as it takes for the ECU to finish whatever activity you have requested, set this value to None.

Default value of 5

p2_timeout (float)

Maximum amount of time in seconds to wait for a first response (positive, negative, or NRC 0x78). After this time is elapsed, a TimeoutException will be raised if no response has been received. See ISO 14229-2:2013 (UDS Session Layer Services) for more details. Default value of 1

p2_star_timeout (float)

Maximum amount of time in seconds to wait for a response (positive, negative, or NRC0x78) after the reception of a negative response with code 0x78 (requestCorrectlyReceived-ResponsePending). After this time is elapsed, a TimeoutException will be raised if no response has been received. See ISO 14229-2:2013 (UDS Session Layer Services) for more details. Default value of 5

use_server_timing (bool)

When using 2013 standard or above, the server is required to provide its P2 and P2* timing values with a DiagnosticSessionControl request. By setting this parameter to True, the value received from the server will be used. When False, these timing values will be ignored and local configuration timing will be used. Note that no timeout value can exceed the config['request_timeout'] as it is meant to avoid the client from hanging for too long.

This parameter has no effect when config['standard_version'] is set to 2006.

Default value is True


Suppress positive response

The UDS standard proposes a mechanism to avoid treating useless positive responses. For all services using a subfunction byte, the client can set bit 7 of the subfunction byte to signal that no response is necessary if the response is positive. This bit is called the suppressPosRspMsgIndicationBit

The Client object lets you use that feature by using suppress_positive_response into a with statement. See the following example:

with client.suppress_positive_response(wait_nrc=False):
    client.tester_present()   # Will not wait for a response and always return None

with client.suppress_positive_response(wait_nrc=True):
    client.tester_present()   # Will wait in case an NRC is returned.

When suppress_positive_response is askied for a service using a subfunction byte, the client will set suppressPosRspMsgIndicationBit before sending the request. If wait_nrc is False (default value), the client will not wait for any response and will disregard positive and negative responses if they happen. The response returned by the client function will always be None in that case.

If wait_nrc is True, the client will wait to see if a negative response is returned. In that scenario
  • No timeout will be raised if no response is received

  • If a positive response is received, it will not be validated and None will be returned

  • If a negative response is received, the normal processing will happen. Meaning either the response will be returned or a NegativeResponseException

    will be raised, depending on exception_on_negative_response parameter.

If suppress_positive_response is askied for a service with no subfunction byte, the directive will be ignored and a warning message will be logged.


Overriding the output

For mean of testing, it may be useful to send invalid payloads to the server and still want the Client object to parse the response of the server.

It is possible to do so by using the payload_override property into a with statement. See the following example:

with client.payload_override(b'\x11\x22\x33'): # Client will send 112233 (hex) in every call within this "with" statement
   client.tester_present()

It is also possible to override with a function that modify the original output

def my_func(payload):
   return payload + b'\x00'  # Add extra 00 to the payload

with client.payload_override(my_func): # Client will append 00 to its output
   client.tester_present()

When using that feature, the client will process the response from the server just like if a valid request was sent. The response may be Invalid, Unexpected or Negative.

Note

It is possible to change the behaviour of the client on failing requests. See the client parameters exception_on_invalid_response, exception_on_unexpected_response and exception_on_negative_response


Methods by services

AccessTimingParameter

Client.read_extended_timing_parameters()[source]

Reads the timing parameters from the server with AccessTimingParameter service with subfunction readExtendedTimingParameterSet (0x01).

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by AccessTimingParameter.interpret_response

Return type:

Response

Client.reset_default_timing_parameters()[source]

Resets the server timing parameters to their default value with AccessTimingParameter service with subfunction setTimingParametersToDefaultValues (0x02).

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by AccessTimingParameter.interpret_response

Return type:

Response

Client.read_active_timing_parameters()[source]

Reads the currently active timing parameters from the server with AccessTimingParameter service with subfunction readCurrentlyActiveTimingParameters (0x03).

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by AccessTimingParameter.interpret_response

Return type:

Response

Client.set_timing_parameters(params)[source]

Sets the timing parameters into the server with AccessTimingParameter service with subfunction setTimingParametersToGivenValues (0x04).

Effective configuration:

exception_on_<type>_response

Parameters:

params (bytes) – The parameters data. Specific to each ECU.

Returns:

The server response parsed by AccessTimingParameter.interpret_response

Return type:

Response


ClearDiagnosticInformation

Client.clear_dtc(group=16777215, memory_selection=None)[source]

Requests the server to clear its active Diagnostic Trouble Codes with the ClearDiagnosticInformation service.

Effective configuration:

exception_on_<type>_response. standard_version

Parameters:
  • group (int) –

    The group of DTCs to clear. It may refer to Powertrain DTCs, Chassis DTCs, etc. Values are defined by the ECU manufacturer except for two specific values

    • 0x000000 : Emissions-related systems

    • 0xFFFFFF : All DTCs

  • memory_selection (int) – MemorySelection byte (0-0xFF). This value is user defined and introduced in 2020 version of ISO-14229-1. Only added to the request payload when different from None. Default : None

Returns:

The server response parsed by ClearDiagnosticInformation.interpret_response

Return type:

Response


CommunicationControl

Client.communication_control(control_type, communication_type, node_id=None)[source]

Switches the transmission or reception of certain messages on/off with CommunicationControl service.

Effective configuration:

exception_on_<type>_response

Parameters:
  • control_type (int) – The action to request such as enabling or disabling some messages. See CommunicationControl.ControlType. This value can also be ECU manufacturer-specific

  • communication_type (CommunicationType, bytes, int) – Indicates what section of the network and the type of message that should be affected by the command. Refer to CommunicationType for more details. If an integer or a bytes is given, the value will be decoded to create the required CommunicationType object

  • node_id (int) – DTC memory identifier (nodeIdentificationNumber). This value is user defined and introduced in 2013 version of ISO-14229-1. Possible only when control type is enableRxAndDisableTxWithEnhancedAddressInformation or enableRxAndTxWithEnhancedAddressInformation Only added to the request payload when different from None. Default : None

Returns:

The server response parsed by CommunicationControl.interpret_response

Return type:

Response


ControlDTCSetting

Client.control_dtc_setting(setting_type, data=None)[source]

Controls some settings related to the Diagnostic Trouble Codes by sending a ControlDTCSetting service request. It can enable/disable some DTCs or perform some ECU specific configuration.

Effective configuration:

exception_on_<type>_response

Parameters:
  • setting_type (int) – Allowed values are from 0 to 0x7F. See ControlDTCSetting.SettingType

  • data (bytes) – Optional additional data sent with the request called DTCSettingControlOptionRecord

Returns:

The server response parsed by ControlDTCSetting.interpret_response

Return type:

Response


DiagnosticSessionControl

Client.change_session(newsession)[source]

Requests the server to change the diagnostic session with a DiagnosticSessionControl service request

Effective configuration:

exception_on_<type>_response

Parameters:

newsession (int) – The session to try to switch. Values from DiagnosticSessionControl.Session can be used.

Returns:

The server response parsed by DiagnosticSessionControl.interpret_response

Return type:

Response


DynamicallyDefineDataIdentifier

Client.dynamically_define_did(did, did_definition)[source]

Defines a dynamically defined DID.

Effective configuration:

exception_on_<type>_response server_address_format server_memorysize_format

Parameters:
  • did (int) – The data identifier to define.

  • did_definition (DynamicDidDefinition or MemoryLocation) – The definition of the DID. Can be defined by source DID or memory address. If a MemoryLocation object is given, definition will automatically be by memory address

Returns:

The server response parsed by DynamicallyDefineDataIdentifier.interpret_response

Return type:

Response

Note

See an example showing how to define a dynamic DID.

Client.clear_dynamically_defined_did(did)[source]

Clears a dynamically defined DID.

Effective configuration:

exception_on_<type>_response

Parameters:

did (int) – The data identifier to clear.

Returns:

The server response parsed by DynamicallyDefineDataIdentifier.interpret_response

Return type:

Response

Client.clear_all_dynamically_defined_did()[source]

Clears all dynamically defined DID. Uses subfunction clearDynamicallyDefinedDataIdentifier without specifying a DID which means “all DID” according to ISO-14229

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by DynamicallyDefineDataIdentifier.interpret_response

Return type:

Response


ECUReset

Client.ecu_reset(reset_type)[source]

Requests the server to execute a reset sequence through the ECUReset service.

Effective configuration:

exception_on_<type>_response

Parameters:

reset_type (int) – The type of reset to perform. ECUReset.ResetType

Returns:

The server response parsed by ECUReset.interpret_response

Return type:

Response


InputOutputControlByIdentifier

Client.io_control(did, control_param=None, values=None, masks=None)[source]

Substitutes the value of an input signal or overrides the state of an output by sending a InputOutputControlByIdentifier service request.

Effective configuration:

exception_on_<type>_response input_output tolerate_zero_padding

Parameters:
  • did (int) – Data identifier to represent the IO

  • control_param (int) – Optional parameter that can be a value from InputOutputControlByIdentifier.ControlParam

  • values (list, dict, IOValues) –

    Optional values to send to the server. This parameter will be given to DidCodec.encode() method. It can be:

    • A list for positional arguments

    • A dict for named arguments

    • An instance of IOValues for mixed arguments

  • masks (list, dict, IOMask, bool) –

    Optional mask record for composite values. The mask definition must be included in config['input_output'] It can be:

    • A list naming the bit mask to set

    • A dict with the mask name as a key and a boolean setting or clearing the mask as the value

    • An instance of IOMask

    • A boolean value to set all masks to the same value.

Returns:

The server response parsed by InputOutputControlByIdentifier.interpret_response

Return type:

Response


LinkControl

Controls the communication baudrate by sending a LinkControl service request.

Effective configuration:

exception_on_<type>_response

Parameters:
  • control_type (int) – Allowed values are from 0 to 0xFF. See LinkControl.ControlType

  • baudrate (Baudrate) – Required baudrate value when control_type is either verifyBaudrateTransitionWithFixedBaudrate (1) or verifyBaudrateTransitionWithSpecificBaudrate (2)

Returns:

The server response parsed by LinkControl.interpret_response

Return type:

Response


ReadDataByIdentifier

Client.read_data_by_identifier(didlist)[source]

Requests a value associated with a data identifier (DID) through the ReadDataByIdentifier service.

Effective configuration:

exception_on_<type>_response data_identifiers tolerate_zero_padding

Parameters:

didlist (int | List[int]) –

Return type:

InterpretedResponse | None

See an example about how to read a DID

Parameters:

didlist (list[int]) – The list of DID to be read

Returns:

The server response parsed by ReadDataByIdentifier.interpret_response

Return type:

Response

Client.read_data_by_identifier_first(didlist)[source]

Shortcut to extract a single DID. Calls read_data_by_identifier then returns the first DID asked for.

Effective configuration:

exception_on_<type>_response data_identifiers tolerate_zero_padding

Parameters:

didlist (list[int]) – The list of DID to be read

Returns:

The server response parsed by ReadDataByIdentifier.interpret_response

Return type:

Response

Client.test_data_identifier(didlist)[source]

Sends a request for the ReadDataByIdentifier and returns blindly the received response without parsing. The requested DIDs do not have to be inside the client list of supported DID. This method can be useful for testing if a DID exists on an ECU

Effective configuration:

exception_on_<type>_response

Parameters:

didlist (list[int]) – The DIDs to peek

Returns:

The raw server response. The response will not be parsed by any service, causing service_data to always be None

Return type:

Response


ReadDTCInformation

Client.get_dtc_by_status_mask(status_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportDTCByStatusMask

Reads all the Diagnostic Trouble Codes that have a status matching the given mask. The server will check all of its DTCs and if (Dtc.status & status_mask) != 0, then the DTCs match the filter and are sent back to the client.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Parameters:

status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_user_defined_memory_dtc_by_status_mask(status_mask, memory_selection)[source]

Performs a ReadDTCInformation service request with subfunction reportUserDefMemoryDTCByStatusMask

Reads Diagnostic Trouble Codes that have a status matching the given mask in a user defined memory . The server will check all of its DTCs inside the user defined memory region and if (Dtc.status & status_mask) != 0, then the DTCs match the filter and are sent back to the client.

Introduced in 2020 version of ISO-14229

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc standard_version

Parameters:
  • status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

  • memory_selection (int) – A 1 byte wide identifier for the memory region. Defined by ECU manufacturer.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_emission_dtc_by_status_mask(status_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportEmissionsRelatedOBDDTCByStatusMask

Reads the emission-related Diagnostic Trouble Codes that have a status matching the given mask. The server will check its emission-related DTCs and if (Dtc.status & status_mask) != 0, then the DTCs match the filter and are sent back to the client.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Parameters:

status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_mirrormemory_dtc_by_status_mask(status_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportMirrorMemoryDTCByStatusMask

Reads all the Diagnostic Trouble Codes stored in mirror memory that have a status matching the given mask. The server will check all of its DTCs and if (Dtc.status & status_mask) != 0, then the DTCs match the filter and are sent back to the client.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Parameters:

status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_by_status_severity_mask(status_mask, severity_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportDTCBySeverityMaskRecord

Reads all the Diagnostic Trouble Codes that have a status and a severity matching the given masks. The server will check all of its DTCs and if ( (Dtc.status & status_mask) != 0 && (Dtc.severity & severity) !=0), then the DTCs match the filter and are sent back to the client.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Parameters:
  • status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

  • severity_mask (int or Dtc.Severity) – The severity mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_number_of_dtc_by_status_mask(status_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportNumberOfDTCByStatusMask

Gets the number of DTCs that match the specified status mask.

Effective configuration:

exception_on_<type>_response

Parameters:

status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_mirrormemory_number_of_dtc_by_status_mask(status_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportNumberOfMirrorMemoryDTCByStatusMask

Gets the number of DTCs that match the specified status mask in mirror memory.

Effective configuration:

exception_on_<type>_response

Parameters:

status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_number_of_emission_dtc_by_status_mask(status_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportNumberOfEmissionsRelatedOBDDTCByStatusMask

Gets the number of emission-related DTCs that match the specified status mask.

Effective configuration:

exception_on_<type>_response

Parameters:

status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_number_of_dtc_by_status_severity_mask(status_mask, severity_mask)[source]

Performs a ReadDTCInformation service request with subfunction reportNumberOfDTCBySeverityMaskRecord

Gets the number of DTCs that match the specified status mask and severity mask.

Effective configuration:

exception_on_<type>_response

Parameters:
  • status_mask (int or Dtc.Status) – The status mask against which the DTCs are tested.

  • severity_mask (int or Dtc.Severity) – The severity mask against which the DTCs are tested.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_severity(dtc)[source]

Performs a ReadDTCInformation service request with subfunction reportSeverityInformationOfDTC

Requests the server for a specific DTC severity level.

Effective configuration:

exception_on_<type>_response

Parameters:

dtc (int or Dtc) – The DTC ID for which we request the severity. It can be a 3-byte integer or a DTC instance with an ID set.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_supported_dtc()[source]

Performs a ReadDTCInformation service request with subfunction reportSupportedDTCs

Requests the list of supported DTCs by the server.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_first_test_failed_dtc()[source]

Performs a ReadDTCInformation service request with subfunction reportFirstTestFailedDTC

Reads a single DTC. Requests the server for the first DTC that set its Dtc.Status.test_failed bit.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_first_confirmed_dtc()[source]

Performs a ReadDTCInformation service request with subfunction reportFirstConfirmedDTC

Reads a single DTC. Requests the server for the first DTC that set its Dtc.Status.confirmed bit.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_most_recent_test_failed_dtc()[source]

Performs a ReadDTCInformation service request with subfunction reportMostRecentTestFailedDTC

Reads a single DTC. Requests the server for the last DTC that set its Dtc.Status.test_failed bit.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_most_recent_confirmed_dtc()[source]

Performs a ReadDTCInformation service request with subfunction reportMostRecentConfirmedDTC

Reads a single DTC. Requests the server for the last DTC that set its Dtc.Status.confirmed bit.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_with_permanent_status()[source]

Performs a ReadDTCInformation service request with subfunction reportDTCWithPermanentStatus

Returns all DTCs that the server marked as permanent.

A permanent DTC is a DTC stored in Non-Volatile memory and that cannot be erased by test equipment or by power-cycling the ECU.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_fault_counter()[source]

Performs a ReadDTCInformation service request with subfunction reportDTCFaultDetectionCounter

Requests the server for all DTCs that are prefailed along with their fault detection counter.

A prefailed DTC is a DTC for which the detection condition is met, but has not been identified as pending or confirmed yet.

If the ECU follows the UDS guidelines, it will wait to detect a fault many times before setting a status bit for this fault DTC. Each time the fault is detected, a fault counter is incremented, when it is not detected, the counter is decremented. Once the fault counter reaches a threshold, a status bit is set and the DTC is not prefailed anymore. A prefailed DTC is any DTC that has fault detection counter greater than 0, but less than the detection threshold.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_snapshot_identification()[source]

Performs a ReadDTCInformation service request with subfunction reportDTCSnapshotIdentification

Requests the server to return an index of all the DTC snapshots available. The server will respond with a list of DTCs and a list of snapshot record numbers for each DTC.

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_snapshot_by_dtc_number(dtc, record_number=255)[source]

Performs a ReadDTCInformation service request with subfunction reportDTCSnapshotRecordByDTCNumber

Requests the server for one or many specific DTC snapshots associated with a single DTC. Each snapshot has a data identifier associated with it. The data will be decoded using the associated DidCodec defined in config['data_identifiers'].

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc dtc_snapshot_did_size

Parameters:
  • dtc (int or Dtc) – The DTC ID for which we request the snapshot data. It can be a 3-byte integer or a DTC instance with an ID set.

  • record_number (int) – The record number of the snapshot data to read. If 0xFF is given, then all snapshots will be read, otherwise, a single snapshot will be read.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_user_defined_dtc_snapshot_by_dtc_number(dtc, memory_selection, record_number=255)[source]

Performs a ReadDTCInformation service request with subfunction reportUserDefMemoryDTCSnapshotRecordByDTCNumber

Requests the server for one or many specific DTC snapshots associated with a single DTC in a user defined memory. Each snapshot has a data identifier associated with it. The data will be decoded using the associated DidCodec defined in config['data_identifiers'].

Introduced in 2020 version of ISO-14229

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc dtc_snapshot_did_size standard_version

Parameters:
  • dtc (int or Dtc) – The DTC ID for which we request the snapshot data. It can be a 3-byte integer or a DTC instance with an ID set.

  • record_number (int) – The record number of the snapshot data to read. If 0xFF is given, then all snapshots will be read, otherwise, a single snapshot will be read.

  • memory_selection (int) – A 1 byte wide identifier for the memory region. Defined by ECU manufacturer.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_snapshot_by_record_number(record_number=255)[source]

Performs a ReadDTCInformation service request with subfunction reportDTCSnapshotRecordByRecordNumber

Requests the server for one or many DTC snapshots by specifying a record number. This functionality can exist only if the server assigns globally unique record_numbers to DTC snapshots, regardless of the DTC ID.

Each snapshot has a data identifier associated with it. The data will be decoded using the associated DidCodec defined in config['data_identifiers'].

Effective configuration:

exception_on_<type>_response tolerate_zero_padding dtc_snapshot_did_size

Parameters:

record_number (int) – The record number of the snapshot data to read. If 0xFF is given, then all snapshots will be read, otherwise, a single snapshot will be read.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_extended_data_by_dtc_number(dtc, record_number=255, data_size=None)[source]

Performs a ReadDTCInformation service request with subfunction reportDTCExtendedDataRecordByDTCNumber

Requests the server for one or many DTC extended data by specifying a DTC and an record number. This mehtod may return a single DTC containing multiple records of extended data

The DTC extended data is an ECU specific set of data that is not associated with a data identifier. Given as bytes

Effective configuration:

exception_on_<type>_response tolerate_zero_padding extended_data_size

Parameters:
  • dtc (int or Dtc) – The DTC ID for which we request the extended data. It can be a 3-byte integer or a DTC instance with an ID set.

  • record_number (int) – The record number of the extended data to read. If 0xFF is given, then all extended data entries will be read, otherwise, a single entry will be read.

  • data_size (int or None) – The number of bytes of an extended data record. If not specified config['extended_data_size'][dtc] will be used.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_dtc_extended_data_by_record_number(record_number, data_size=None)[source]

Performs a ReadDTCInformation service request with subfunction reportDTCExtDataRecordByRecordNumber

Requests the server for one or many DTC extended data by specifying a record number only. This method may return multiple DTC containing each a single record of extended data.

The DTC extended data is an ECU specific set of data that is not associated with a data identifier. Given as bytes

Introduced in 2020 version of ISO-14229

Effective configuration:

exception_on_<type>_response tolerate_zero_padding ignore_all_zero_dtc extended_data_size standard_version

Parameters:
  • record_number (int) – The record number of the extended data to read. Value must range between 0x00 and 0xEF. 0xFF (all) cannot be used.

  • data_size (int, dict or None) – The number of bytes of each extended data record. If not specified config['extended_data_size'] will be used. Since this method can return data for multiple DTCs and data size might be different for each DTC, it is possible to pass a dictionary with a size for each DTC id (just like extended_data_size configuration). Example : size = {0x123456 : 5, 0x112233 : 10}

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_user_defined_dtc_extended_data_by_dtc_number(dtc, memory_selection, record_number=255, data_size=None)[source]

Performs a ReadDTCInformation service request with subfunction reportUserDefMemoryDTCExtDataRecordByDTCNumber

Requests the server for one or many DTC extended data by specifying a DTC and an optional record number in a user defined memory. This mehtod may return a single DTC containing multiple records of extended data The DTC extended data is an ECU specific set of data that is not associated with a data identifier. Given as bytes

Introduced in 2020 version of ISO-14229

Effective configuration:

exception_on_<type>_response tolerate_zero_padding extended_data_size standard_version

Parameters:
  • dtc (int or Dtc) – The DTC ID for which we request the extended data. It can be a 3-byte integer or a DTC instance with an ID set.

  • memory_selection (int) – A 1 byte wide identifier for the memory region. Defined by ECU manufacturer.

  • record_number (int) – The record number of the extended data to read. If 0xFF is given, then all extended data entries will be read, otherwise, a single entry will be read.

  • data_size (int or None) – The number of bytes of an extended data record. If not specified config['extended_data_size'][dtc] will be used.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response

Client.get_mirrormemory_dtc_extended_data_by_dtc_number(dtc, record_number=255, data_size=None)[source]

Performs a ReadDTCInformation service request with subfunction reportMirrorMemoryDTCExtendedDataRecordByDTCNumber

Requests the server for one or many DTC extended data stored in mirror memory by specifying a record number.

The DTC extended data is an ECU specific set of data that is not associated with a data identifier. Given as bytes

Effective configuration:

exception_on_<type>_response tolerate_zero_padding extended_data_size

Parameters:
  • dtc (int or Dtc) – The DTC ID for which we request the extended data. It can be a 3-byte integer or a DTC instance with an ID set.

  • record_number (int) – The record number of the extended data to read. If 0xFF is given, then all extended data entries will be read, otherwise, a single entry will be read.

  • data_size (int or None) – The number of bytes of an extended data record. If not specified config['extended_data_size'][dtc] wil be used.

Returns:

The server response parsed by ReadDTCInformation.interpret_response

Return type:

Response


ReadMemoryByAddress

Client.read_memory_by_address(memory_location)[source]

Reads a block of memory from the server by sending a ReadMemoryByAddress service request.

Effective configuration:

exception_on_<type>_response server_address_format server_memorysize_format

Parameters:

memory_location (MemoryLocation) – The address and the size of the memory block to read.

Returns:

The server response parsed by ReadMemoryByAddress.interpret_response

Return type:

Response

Note

See an example showing how to use default format configuration.


RequestDownload

Client.request_download(memory_location, dfi=None)[source]

Informs the server that the client wants to initiate a download from the client to the server by sending a RequestDownload service request.

Effective configuration:

exception_on_<type>_response server_address_format server_memorysize_format

Parameters:
  • memory_location (MemoryLocation) – The address and size of the memory block to be written.

  • dfi (DataFormatIdentifier) – Optional DataFormatIdentifier defining the compression and encryption scheme of the data. If not specified, the default value of 00 will be used, specifying no encryption and no compression

Returns:

The server response parsed by RequestDownload.interpret_response

Return type:

Response

Note

See an example showing how to use default format configuration.


RequestTransferExit

Client.request_transfer_exit(data=None)[source]

Informs the server that the client wants to stop the data transfer by sending a RequestTransferExit service request.

Effective configuration:

exception_on_<type>_response

Parameters:

data (bytes) – Optional additional data to send to the server

Returns:

The server response parsed by RequestTransferExit.interpret_response

Return type:

Response


RequestUpload

Client.request_upload(memory_location, dfi=None)[source]

Informs the server that the client wants to initiate an upload from the server to the client by sending a RequestUpload service request.

Effective configuration:

exception_on_<type>_response server_address_format server_memorysize_format

Parameters:
  • memory_location (MemoryLocation) – The address and size of the memory block to be written.

  • dfi (DataFormatIdentifier) – Optional DataFormatIdentifier defining the compression and encryption scheme of the data. If not specified, the default value of 00 will be used, specifying no encryption and no compression

Returns:

The server response parsed by RequestUpload.interpret_response

Return type:

Response

Note

See an example showing how to use default format configuration.


RoutineControl

Client.start_routine(routine_id, data=None)[source]

Requests the server to start a routine through the RoutineControl service (subfunction = 0x01).

Effective configuration:

exception_on_<type>_response

Parameters:
  • routine_id (int) – The 16-bit numerical ID of the routine to start

  • data (bytes) – Optional additional data to give to the server

Returns:

The server response parsed by RoutineControl.interpret_response

Return type:

Response

Client.stop_routine(routine_id, data=None)[source]

Requests the server to stop a routine through the RoutineControl service (subfunction = 0x02).

Effective configuration:

exception_on_<type>_response

Parameters:
  • routine_id (int) – The 16-bit numerical ID of the routine to stop

  • data (bytes) – Optional additional data to give to the server

Returns:

The server response parsed by RoutineControl.interpret_response

Return type:

Response

Client.get_routine_result(routine_id, data=None)[source]

Requests the server to send back the execution result of the specified routine through the RoutineControl service (subfunction = 0x03).

Effective configuration:

exception_on_<type>_response

Parameters:
  • routine_id (int) – The 16-bit numerical ID of the routine

  • data (bytes) – Optional additional data to give to the server

Returns:

The server response parsed by RoutineControl.interpret_response

Return type:

Response


SecurityAccess

Client.request_seed(level, data=b'')[source]

Requests a seed to unlock a security level with the SecurityAccess service

Effective configuration:

exception_on_<type>_response

Parameters:
  • level (int) – The security level to unlock. If value is even, it will be converted to the corresponding odd value

  • data (bytes) – The data to send to the server (securityAccessDataRecord)

Returns:

The server response parsed by SecurityAccess.interpret_response

Return type:

Response

Client.send_key(level, key)[source]

Sends a key to unlock a security level with the SecurityAccess service

Effective configuration:

exception_on_<type>_response

Parameters:
  • level (int) – The security level to unlock. If value is odd, it will be converted to the corresponding even value

  • key (bytes) – The key to send to the server

Returns:

The server response parsed by SecurityAccess.interpret_response

Return type:

Response

Client.unlock_security_access(level, seed_params=b'')[source]

Successively calls request_seed and send_key to unlock a security level with the SecurityAccess service. The key computation is done by calling config[‘security_algo’]

Effective configuration:

exception_on_<type>_response security_algo security_algo_params

Parameters:
  • level (int) – The level to unlock. Can be the odd or even variant of it.

  • seed_params (bytes) – Optional data to attach to the RequestSeed request (securityAccessDataRecord).

Returns:

The server response parsed by SecurityAccess.interpret_response

Return type:

Response

Note

See this example to see how to define the security algorithm


TesterPresent

Client.tester_present()[source]

Sends a TesterPresent request to keep the session active.

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by TesterPresent.interpret_response

Return type:

Response


TransferData

Client.transfer_data(sequence_number, data=None)[source]

Transfer a block of data to/from the client to/from the server by sending a TransferData service request and returning the server response.

Effective configuration:

exception_on_<type>_response

Parameters:
  • sequence_number (int) – Corresponds to an 8bit counter that should increment for each new block transferred. Allowed values are from 0 to 0xFF

  • data (bytes) – Optional additional data to send to the server

Returns:

The server response parsed by TransferData.interpret_response

Return type:

Response


WriteDataByIdentifier

Client.write_data_by_identifier(did, value)[source]

Requests to write a value associated with a data identifier (DID) through the WriteDataByIdentifier service.

Effective configuration:

exception_on_<type>_response data_identifiers

Parameters:
  • did (int) – The DID to write its value

  • value (int) – Value given to the DidCodec.encode method. The payload returned by the codec will be sent to the server.

Returns:

The server response parsed by WriteDataByIdentifier.interpret_response

Return type:

Response

Note

If the DID Codec that is written is defined with a pack string (default codec), multiple values may be passed with a tuple.


WriteMemoryByAddress

Client.write_memory_by_address(memory_location, data)[source]

Writes a block of memory in the server by sending a WriteMemoryByAddress service request.

Effective configuration:

exception_on_<type>_response server_address_format server_memorysize_format

Parameters:
  • memory_location (MemoryLocation) – The address and the size of the memory block to read.

  • data (bytes) – The data to write into memory.

Returns:

The server response parsed by WriteMemoryByAddress.interpret_response

Return type:

Response


RequestFileTransfer

Client.add_file(filename, dfi=None, filesize=None)[source]

Sends a RequestFileTransfer request with ModeOfOperation=AddFile(1).

Effective configuration:

exception_on_<type>_response tolerate_zero_padding

Parameters:
  • filename (str) – The name of the file to create, limited to ASCII characters.

  • dfi (DataFormatIdentifier) – DataFormatIdentifier defining the compression and encryption scheme of the data. If not specified, the default value of 00 will be used, specifying no encryption and no compression.

  • filesize (Filesize or int) – The filesize of the file to write. If filesize is an object of type Filesize, the uncompressed size and compressed size will be encoded on the minimum amount of bytes necessary, unless a width is explicitly defined. If no compressed size is given or filesize is an int, then the compressed size will be set equal to the uncompressed size or the integer value given as specified by ISO-14229

Returns:

The server response parsed by RequestFileTransfer.interpret_response

Return type:

Response

Client.delete_file(filename)[source]

Sends a RequestFileTransfer request with ModeOfOperation=DeleteFile(2).

Effective configuration:

exception_on_<type>_response tolerate_zero_padding

Parameters:

filename (str) – The name of the file to delete, limited to ASCII characters.

Returns:

The server response parsed by RequestFileTransfer.interpret_response

Return type:

Response

Client.replace_file(filename, dfi=None, filesize=None)[source]

Sends a RequestFileTransfer request with ModeOfOperation=ReplaceFile(3).

Effective configuration:

exception_on_<type>_response tolerate_zero_padding

Parameters:
  • filename (str) – The name of the file to replace, limited to ASCII characters.

  • dfi (DataFormatIdentifier) – DataFormatIdentifier defining the compression and encryption scheme of the data. If not specified, the default value of 00 will be used, specifying no encryption and no compression.

  • filesize (Filesize or int) – The filesize of the file to write. If filesize is an object of type Filesize, the uncompressed size and compressed size will be encoded on the minimum amount of bytes necessary, unless a width is explicitly defined. If no compressed size is given or filesize is an int, then the compressed size will be set equal to the uncompressed size or the integer value given as specified by ISO-14229

Returns:

The server response parsed by RequestFileTransfer.interpret_response

Return type:

Response

Client.read_file(filename, dfi=None)[source]

Sends a RequestFileTransfer request with ModeOfOperation=ReadFile(4).

Effective configuration:

exception_on_<type>_response tolerate_zero_padding

Parameters:
  • filename (str) – The name of the file to read, limited to ASCII characters.

  • dfi (DataFormatIdentifier) – DataFormatIdentifier defining the compression and encryption scheme of the data. If not specified, the default value of 00 will be used, specifying no encryption and no compression.

Returns:

The server response parsed by RequestFileTransfer.interpret_response

Return type:

Response

Client.read_dir(path)[source]

Sends a RequestFileTransfer request with ModeOfOperation=ReadDir(5).

Effective configuration:

exception_on_<type>_response tolerate_zero_padding

Parameters:

path (str) – The name of the directory to read, limited to ASCII characters.

Returns:

The server response parsed by RequestFileTransfer.interpret_response

Return type:

Response

Client.resume_file(filename, dfi=None, filesize=None)[source]

Sends a RequestFileTransfer request with ModeOfOperation=ResumeFile(6).

Effective configuration:

exception_on_<type>_response tolerate_zero_padding

Parameters:
  • filename (str) – The name of the file to create, limited to ASCII characters.

  • dfi (DataFormatIdentifier) – DataFormatIdentifier defining the compression and encryption scheme of the data. If not specified, the default value of 00 will be used, specifying no encryption and no compression.

  • filesize (Filesize or int) – The filesize of the file to write. If filesize is an object of type Filesize, the uncompressed size and compressed size will be encoded on the minimum amount of bytes necessary, unless a width is explicitly defined. If no compressed size is given or filesize is an int, then the compressed size will be set equal to the uncompressed size or the integer value given as specified by ISO-14229

Returns:

The server response parsed by RequestFileTransfer.interpret_response

Return type:

Response


Authentication

Client.authentication(authentication_task, communication_configuration=None, certificate_client=None, challenge_client=None, algorithm_indicator=None, certificate_evaluation_id=None, certificate_data=None, proof_of_ownership_client=None, ephemeral_public_key_client=None, additional_parameter=None)[source]

Sends an Authentication request introduced in 2020 version of ISO-14229-1. You can also use the helper functions to send each authentication task (sub function).

Effective configuration:

exception_on_<type>_response

Parameters:
  • authentication_task (int) – The authenticationTask (subfunction) to use.

  • communication_configuration (int) – Optional Configuration information about how to proceed with security in further diagnostic communication after the Authentication (vehicle manufacturer specific). Allowed values are from 0 to 255.

  • certificate_client (bytes) – Optional The Certificate to verify.

  • challenge_client (bytes) – Optional The challenge contains vehicle manufacturer specific formatted client data (likely containing randomized information) or is a random number.

  • algorithm_indicator (bytes) – Optional Indicates the algorithm used in the generating and verifying Proof of Ownership (POWN), which further determines the parameters used in the algorithm and possibly the session key creation mode. This field is a 16 byte value containing the BER encoded OID value of the algorithm used. The value is left aligned and right padded with zero up to 16 bytes.

  • certificate_evaluation_id (int) – Optional unique ID to identify the evaluation type of the transmitted certificate. The value of this parameter is vehicle manufacturer specific. Subsequent diagnostic requests with the same evaluationTypeId will overwrite the certificate data of the previous requests. Allowed values are from 0 to 0xFFFF.

  • certificate_data (bytes) – Optional The Certificate to verify.

  • proof_of_ownership_client (bytes) – Optional Proof of Ownership of the previous given challenge to be verified by the server.

  • ephemeral_public_key_client (bytes) – Optional Ephemeral public key generated by the client for Diffie-Hellman key agreement.

  • additional_parameter (bytes) – Optional additional parameter is provided to the server if the server indicates as neededAdditionalParameter.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.deauthenticate()[source]

Sends a deAuthenticate request (sub function of Authentication Service) introduced in 2020 version of ISO-14229-1.

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.verify_certificate_unidirectional(communication_configuration, certificate_client, challenge_client=None)[source]

Sends a verifyCertificateUnidirectional request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • communication_configuration (int) – Configuration information about how to proceed with security in further diagnostic communication after the Authentication (vehicle manufacturer specific). Allowed values are from 0 to 255.

  • certificate_client (bytes) – The Certificate to verify.

  • challenge_client (bytes) – Optional The challenge contains vehicle manufacturer specific formatted client data (likely containing randomized information) or is a random number.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.verify_certificate_bidirectional(communication_configuration, certificate_client, challenge_client)[source]

Sends a verifyCertificateBidirectional request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • communication_configuration (int) – Configuration information about how to proceed with security in further diagnostic communication after the Authentication (vehicle manufacturer specific). Allowed values are from 0 to 255.

  • certificate_client (bytes) – The Certificate to verify.

  • challenge_client (bytes) – The challenge contains vehicle manufacturer specific formatted client data (likely containing randomized information) or is a random number.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.proof_of_ownership(proof_of_ownership_client, ephemeral_public_key_client=None)[source]

Sends a proofOfOwnership request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • proof_of_ownership_client (bytes) – Proof of Ownership of the previous given challenge to be verified by the server.

  • ephemeral_public_key_client (bytes) – Optional Ephemeral public key generated by the client for Diffie-Hellman key agreement.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.transmit_certificate(certificate_evaluation_id, certificate_data)[source]

Sends a transmitCertificate request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • certificate_evaluation_id (int) – Unique ID to identify the evaluation type of the transmitted certificate. The value of this parameter is vehicle manufacturer specific. Subsequent diagnostic requests with the same evaluationTypeId will overwrite the certificate data of the previous requests. Allowed values are from 0 to 0xFFFF.

  • certificate_data (bytes) – The Certificate to verify.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.request_challenge_for_authentication(communication_configuration, algorithm_indicator)[source]

Sends a requestChallengeForAuthentication request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • communication_configuration (int) – Configuration information about how to proceed with security in further diagnostic communication after the Authentication (vehicle manufacturer specific). Allowed values are from 0 to 255.

  • algorithm_indicator (bytes) – Indicates the algorithm used in the generating and verifying Proof of Ownership (POWN), which further determines the parameters used in the algorithm and possibly the session key creation mode. This field is a 16 byte value containing the BER encoded OID value of the algorithm used. The value is left aligned and right padded with zero up to 16 bytes.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.verify_proof_of_ownership_unidirectional(algorithm_indicator, proof_of_ownership_client, challenge_client=None, additional_parameter=None)[source]

Sends a verifyProofOfOwnershipUnidirectional request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • algorithm_indicator (bytes) – Indicates the algorithm used in the generating and verifying Proof of Ownership (POWN), which further determines the parameters used in the algorithm and possibly the session key creation mode. This field is a 16 byte value containing the BER encoded OID value of the algorithm used. The value is left aligned and right padded with zero up to 16 bytes.

  • proof_of_ownership_client (bytes) – Proof of Ownership of the previous given challenge to be verified by the server.

  • challenge_client (bytes) – Optional The challenge contains vehicle manufacturer specific formatted client data (likely containing randomized information) or is a random number.

  • additional_parameter (bytes) – Optional additional parameter is provided to the server if the server indicates as neededAdditionalParameter.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.verify_proof_of_ownership_bidirectional(algorithm_indicator, proof_of_ownership_client, challenge_client, additional_parameter=None)[source]

Sends a verifyProofOfOwnershipBidirectional request (sub function of Authentication Service)

Effective configuration:

exception_on_<type>_response

Parameters:
  • algorithm_indicator (bytes) – Indicates the algorithm used in the generating and verifying Proof of Ownership (POWN), which further determines the parameters used in the algorithm and possibly the session key creation mode. This field is a 16 byte value containing the BER encoded OID value of the algorithm used. The value is left aligned and right padded with zero up to 16 bytes.

  • proof_of_ownership_client (bytes) – Proof of Ownership of the previous given challenge to be verified by the server.

  • challenge_client (bytes) – The challenge contains vehicle manufacturer specific formatted client data (likely containing randomized information) or is a random number.

  • additional_parameter (bytes) – Optional additional parameter is provided to the server if the server indicates as neededAdditionalParameter.

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response

Client.authentication_configuration()[source]

Sends a authenticationConfiguration request (sub function of Authentication Service) introduced in 2020 version of ISO-14229-1.

Effective configuration:

exception_on_<type>_response

Returns:

The server response parsed by Authentication.interpret_response

Return type:

Response