@@ -135,7 +135,7 @@ def send_uds(
135135 if log .isEnabledFor (logging .getLogger ().level ):
136136 log .internal_info (
137137 "UDS request to send '%s'" ,
138- ["0x{:02X}" .format (i ) for i in msg_to_send ],
138+ ["0x{:02X}" .format (i ) for i in msg_to_send [: 6 ] ],
139139 )
140140 resp = self .uds_config .send (
141141 msg_to_send ,
@@ -157,14 +157,12 @@ def send_uds(
157157 resp_time = self .uds_config .last_resp_time ,
158158 pending_resp_times = self .uds_config .last_pending_resp_times ,
159159 )
160- log .internal_info ("UDS response received %s" , resp )
160+ if log .isEnabledFor (logging .getLogger ().level ):
161+ log .internal_info ("UDS response received %s" , resp .get_truncated_representation ())
161162 return resp
162163
163164 def send_uds_raw (
164- self ,
165- msg_to_send : Union [bytes , List [int ], tuple ],
166- timeout_in_s : float = 6 ,
167- response_required : bool = True ,
165+ self , msg_to_send : Union [bytes , List [int ], tuple ], timeout_in_s : float = 6 , response_required : bool = True
168166 ) -> Union [UdsResponse , bool ]:
169167 """Send a UDS diagnostic request to the target ECU and check response.
170168 Deprecated alias of `send_uds` that returns `False` on error,
@@ -182,6 +180,7 @@ def send_uds_raw(
182180 not expected and the command is properly sent otherwise
183181 False
184182 """
183+
185184 try :
186185 return True if (response := self .send_uds (msg_to_send , response_required )) is None else response
187186 except self .errors .ResponseNotReceivedError as exc :
0 commit comments