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: udsoncan/client.py
+45-16Lines changed: 45 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,17 @@ 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 to wait for a response after sending a request (in seconds). After this time is elapsed, a TimeoutException will be raised.
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.
26
27
: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)"% (response.code_name, response.code))
1489
+
ifresponse_pending_supported:
1490
+
# Received a 0x78 NRC: timeout is now set to P2*
1491
+
current_timeout=self.p2_star_timeout
1492
+
done_receiving=False
1493
+
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")
0 commit comments