10. uds_auxiliary
10.1. uds_auxiliary
- module
uds_auxiliary
- synopsis
Auxiliary used to handle Unified Diagnostic Service protocol
- class pykiso.lib.auxiliaries.udsaux.uds_auxiliary.UdsAuxiliary(com, config_ini_path, odx_file_path=None, **kwargs)[source]
Auxiliary used to handle UDS messages
Initialize attributes.
- Parameters
com (
CChannel
) – communication channel connector.config_ini_path (
str
) – uds parameters file.odx_file_path (
Optional
[str
]) – ecu diagnostic definition file.
- check_raw_response_negative(resp)[source]
Check if the response is negative, raise an error if not
- Parameters
resp (
UdsResponse
) – raw response of uds request- Raises
UnexpectedResponseError – raised when the answer is not the expected one
- Return type
Optional
[bool
]- Returns
True if response is negative
- check_raw_response_positive(resp)[source]
Check if the response is positive, raise an error if not
- Parameters
resp (
UdsResponse
) – raw response of uds request- Raises
UnexpectedResponseError – raised when the answer is not the expected one
- Return type
Optional
[bool
]- Returns
True if response is positive
- errors = <module 'pykiso.lib.auxiliaries.udsaux.uds_exceptions' from '/home/docs/checkouts/readthedocs.org/user_builds/kiso-testing/envs/0.17.0/lib/python3.7/site-packages/pykiso/lib/auxiliaries/udsaux/uds_exceptions.py'>
- force_ecu_reset()[source]
Allow power reset of the component
- Return type
UdsResponse
- Returns
response of the force ecu reset request
- hard_reset()[source]
Allow power reset of the component
- Return type
Union
[dict
,UdsResponse
]- Returns
response of the hard reset request
- read_data(parameter)[source]
UDS config command that allow data reading
- Parameters
parameter (
str
) – data to be read- Return type
Union
[dict
,bool
,None
]- Returns
a dict with uds config response
- send_uds_config(msg_to_send, timeout_in_s=6)[source]
Send UDS config to the target ECU.
- Parameters
msg_to_send (
dict
) – uds config to be senttimeout_in_s (
float
) – not used
- Return type
Union
[dict
,bool
]- Returns
a dict containing the uds response, or True if a response is not expected and the command is properly sent otherwise False
- send_uds_raw(msg_to_send, timeout_in_s=6)[source]
Send a UDS diagnostic request to the target ECU and check response.
- Parameters
msg_to_send (
Union
[bytes
,List
[int
],tuple
]) – can uds raw bytes to be senttimeout_in_s (
float
) – not used
- Raises
ResponseNotReceivedError – raised when no answer has been received
Exception – raised when the raw message could not be send properly
- Return type
Union
[UdsResponse
,bool
]- Returns
the raw uds response’s bytes, or True if a response is not expected and the command is properly sent otherwise False
- soft_reset()[source]
Perform soft reset of the component, equivalent to a restart of application
- Return type
Union
[dict
,UdsResponse
]- Returns
response of the soft reset request
- transmit(data, req_id, extended=False)[source]
Transmit a message through ITF connector. This method is a substitute to transmit method present in python-uds package.
- Parameters
data (
bytes
) – data to sendreq_id (
int
) – CAN message identifierextended (
bool
) – True if addressing mode is extended otherwise False
- Return type
None