You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/udsoncan/client.rst
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,36 @@ The client configuration must be a dictionary with the following keys defined:
182
182
183
183
The number of bytes used to encode a data identifier specifically for :ref:`ReadDTCInformation<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
184
184
185
+
.. _config_timeouts:
186
+
.. _config_request_timeout:
187
+
188
+
.. attribute:: request_timeout
189
+
:annotation: (int)
190
+
191
+
Maximum amount of time in seconds to wait for a response (positive or negative except NRC 0x78) after sending a request.
192
+
After this time is elapsed, a TimeoutException will be raised regardless of other timeouts value or previous client response.
193
+
Ensure an exit path if the ECU keeps requesting to wait.
194
+
Default value of 5
195
+
196
+
.. _config_p2_timeout:
197
+
198
+
.. attribute:: p2_timeout
199
+
:annotation: (int)
200
+
201
+
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.
202
+
See ISO 14229-2:2013 (UDS Session Layer Services) for more details.
203
+
Default value of 1
204
+
205
+
.. _config_p2_star_timeout:
206
+
207
+
.. attribute:: p2_star_timeout
208
+
:annotation: (int)
209
+
210
+
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
211
+
(requestCorrectlyReceived-ResponsePending). After this time is elapsed, a TimeoutException will be raised if no response has been received.
212
+
See ISO 14229-2:2013 (UDS Session Layer Services) for more details.
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.
@@ -22,17 +22,8 @@ class Client:
22
22
:param config: The :ref:`client configuration<client_config>`
23
23
:type config: dict
24
24
25
-
:param request_timeout: Maximum amount of time in seconds to wait for the final response (positive or negative except NRC 0x78) after sending a request.
26
-
After this time is elapsed, a TimeoutException will be raised. If less than or equal to p2_star, NRC 0x78 (requestCorrectlyReceived-ResponsePending) responses are not supported.
25
+
:param request_timeout: Maximum amount of time to wait for a response. This parameter exists for backward compatibility only. For detailed timeout handling, see :ref:`Client configuration<config_timeouts>`
27
26
:type request_timeout: int
28
-
29
-
:param p2_timeout: Maximum amount of time in seconds to wait for a response (positive, negative, or NRC 0x78). After this time is elapsed, a TimeoutException will be raised.
30
-
See ISO 14229-2 (UDS Session Layer Services).
31
-
:type p2_timeout: int
32
-
33
-
:param p2_star_timeout: 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
34
-
(requestCorrectlyReceived-ResponsePending). After this time is elapsed, a TimeoutException will be raised. See ISO 14229-2 (UDS Session Layer Services).
self.logger.warning('Given response code "%s" (0x%02x) is not a supported negative response code according to UDS standard.'% (response.code_name, response.code))
self.logger.debug("Server requested to wait with response code %s (0x%02x), timeout is now set to %.3f seconds"% (response.code_name, response.code, current_timeout))
1494
-
else:
1495
-
raiseNegativeResponseException(response, "RequestCorrectlyReceived_ResponsePending not supported")
self.logger.debug("Server requested to wait with response code %s (0x%02x), single request timeout is now set to P2* (%.3f seconds)"% (response.code_name, response.code, single_request_timeout))
0 commit comments