DoipRequest

class mtf.diag_port.diag_servers.doip_server.DoipRequest

The Doip responses generator.

__init__(payload: bytes, logical_add: bytes | None = None)

DoipRequest constructor.

Parameters:
  • payload – Doip response payload.

  • logical_add – server/ target logical address.

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

Generate a negative response on a Doip request.

Parameters:
  • nrc – Negative response Code. Defaults to 0x11.

  • data – response data.

Returns:

doip negative response composed of the Doip header and the uds packet.

generate_ack()

Generate the tcp acknowledgement.

Returns:

The acknowledgement packet

generate_routing_activation_response() bytes

generate the routing activation response.

Returns:

The routing activation response.

generate_positive_response(data: bytes = b'') bytes

Generate a positive response on a Doip request.

Parameters:

data – response data.

Returns:

The doip positive response composed of the Doip header and the uds packet.