Hsfz Server Module

class mtf.diag_port.diag_servers.hsfz_server.HsfzRequest

The HSFZ responses generator.

__init__(payload: bytes)

The HSFZ constructor.

Parameters:

payload – the response payload.

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

Generate a negative response on a Hsfz request.

Parameters:
  • nrc – Negative response Code

  • data – response data.

Returns:

The Hsfz negative response.

generate_positive_response(data: bytes = b'') bytes

Generate a positive response on a Hsfz request.

Parameters:

data – response data.

Returns:

Hsfz positive response.

class mtf.diag_port.diag_servers.hsfz_server.HsfzServer

Hsfz server

vis_port
vis_req_data
__init__(ip: str, port: int = 6801)

Hsfz server constructor.

Parameters:
  • ip – Hsfz server ip address.

  • port – Hsfz port number. Defaults to 6801.

start()

Start the Hsfz server.

stop()

Stop the Hsfz server and close the socket.

call_back(data: bytes, connection: socket, adrr: str)

The HsfzServer callback function. Orchestrate the Hsfz communication.

Parameters:
  • data – Hsfz request’s data.

  • connection – Hsfz server socket.

  • adrr – Hsfz server address.

vis_func()

Send the response on the corresponding Hsfz request.

daemon_start()

Daemon thread that will run in the background of the main program.

property positive_responding: bool

Getter of positive_responding attribute

wait_connection()

Wait for tcp connection with the diagnostic server.