DiagRequest

class mtf.diag_port.diag_servers.diag_server.DiagRequest

Diagnostic response generator Class.

__init__(payload: bytes)

DiagRequest constructor.

Parameters:

payload – response payload.

generate_negative_response(nrc: int = 17, data: bytes = b'') bytes

Generate a negative diagnostic response.

Parameters:
  • nrc – Negative Response Codes. Defaults to 0x11.

  • data – response data.

Returns:

Negative response.

generate_positive_response(data: bytes = b'') bytes

Generate a positive diagnostic response.

Parameters:

data – positive response data.

Returns:

positive response.