@@ -260,7 +260,7 @@ def request_seed(self, level: int, data=bytes()) -> Optional[services.SecurityAc
260260 :param level: The security level to unlock. If value is even, it will be converted to the corresponding odd value
261261 :type level: int
262262
263- :param data: The data to send to the server
263+ :param data: The data to send to the server (securityAccessDataRecord)
264264 :type data: bytes
265265
266266 :return: The server response parsed by :meth:`SecurityAccess.interpret_response<udsoncan.services.SecurityAccess.interpret_response>`
@@ -327,7 +327,7 @@ def send_key(self, level: int, key: bytes) -> Optional[services.SecurityAccess.I
327327 return response
328328
329329 @standard_error_management
330- def unlock_security_access (self , level ) -> Optional [services .SecurityAccess .InterpretedResponse ]:
330+ def unlock_security_access (self , level , seed_params = bytes () ) -> Optional [services .SecurityAccess .InterpretedResponse ]:
331331 """
332332 Successively calls request_seed and send_key to unlock a security level with the :ref:`SecurityAccess<SecurityAccess>` service.
333333 The key computation is done by calling config['security_algo']
@@ -337,14 +337,17 @@ def unlock_security_access(self, level) -> Optional[services.SecurityAccess.Inte
337337 :param level: The level to unlock. Can be the odd or even variant of it.
338338 :type level: int
339339
340+ :param seed_params: Optional data to attach to the RequestSeed request (securityAccessDataRecord).
341+ :type seed_params: bytes
342+
340343 :return: The server response parsed by :meth:`SecurityAccess.interpret_response<udsoncan.services.SecurityAccess.interpret_response>`
341344 :rtype: :ref:`Response<Response>`
342345 """
343346
344347 if 'security_algo' not in self .config or not callable (self .config ['security_algo' ]):
345348 raise NotImplementedError ("Client configuration does not provide a security algorithm" )
346349
347- response = self .request_seed ._func_no_error_management (self , level )
350+ response = self .request_seed ._func_no_error_management (self , level , data = seed_params )
348351 seed = response .service_data .seed
349352 if len (seed ) > 0 and seed == b'\x00 ' * len (seed ):
350353 self .logger .info ('%s - Security access level 0x%02x is already unlocked, no key will be sent.' %
0 commit comments