Protocol

class secsgem.hsms.protocol.HsmsProtocol(settings)[source]

Baseclass for creating Host/Equipment models.

This layer contains the HSMS functionality. Inherit from this class and override required functions.

send_packet_size = 1048576

Block size for outbound data .

message_type

alias of HsmsMessage

property connection_state: ConnectionStateMachine

Property for connection state.

serialize_data()[source]

Return data for serialization.

Return type:

dict[str, Any]

Returns:

data to serialize for this object

send_select_req()[source]

Send a Select Request to the remote host.

Return type:

HsmsMessage | None

Returns:

received message or None

send_select_rsp(system_id)[source]

Send a Select Response to the remote host.

Parameters:

system_id (int) – System of the request to reply for

Return type:

bool

Returns:

False if sending was not successful

send_linktest_req()[source]

Send a Linktest Request to the remote host.

Return type:

HsmsMessage | None

Returns:

received message or None

send_linktest_rsp(system_id)[source]

Send a Linktest Response to the remote host.

Parameters:

system_id (int) – System of the request to reply for

Return type:

bool

Returns:

False if sending was not successful

send_deselect_req()[source]

Send a Deselect Request to the remote host.

Return type:

HsmsMessage | None

Returns:

received message or None

send_deselect_rsp(system_id)[source]

Send a Deselect Response to the remote host.

Parameters:

system_id (int) – System of the request to reply for

Return type:

bool

Returns:

False if sending was not successful

send_reject_rsp(system_id, s_type, reason)[source]

Send a Reject Response to the remote host.

Parameters:
  • system_id (int) – System of the request to reply for

  • s_type (HsmsSType) – Type of the request to reply for

  • reason (int) – Reason of the rejection

Return type:

bool

Returns:

False if sending was not successful

send_separate_req()[source]

Send a Separate Request to the remote host.

Return type:

int | None

Returns:

system id of the request or None if sending failed

class secsgem.hsms.protocol.HsmsMessage(header, data, complete=True)[source]

Class for hsms message.

Contains all required data and functions.

block_type

alias of HsmsBlock

property header: HsmsHeader

Get the header.

property data: bytes

Get the data.

property complete: bool

Check if the message is complete.

class secsgem.hsms.protocol.HsmsBlock(header, data)[source]

Data block for SECS I.

header_type

alias of HsmsHeader