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.

Returns:

data to serialize for this object

Return type:

dict

send_select_req()[source]

Send a Select Request to the remote host.

Returns:

System of the sent request

Return type:

integer

send_select_rsp(system_id)[source]

Send a Select Response to the remote host.

Parameters:

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

send_linktest_req()[source]

Send a Linktest Request to the remote host.

Returns:

System of the sent request

Return type:

integer

send_linktest_rsp(system_id)[source]

Send a Linktest Response to the remote host.

Parameters:

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

send_deselect_req()[source]

Send a Deselect Request to the remote host.

Returns:

System of the sent request

Return type:

integer

send_deselect_rsp(system_id)[source]

Send a Deselect Response to the remote host.

Parameters:

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

send_reject_rsp(system_id, s_type, reason)[source]

Send a Reject Response to the remote host.

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

  • s_type (integer) – s_type of rejected message

  • reason (integer) – reason for rejection

send_separate_req()[source]

Send a Separate Request to the remote host.

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