Packets

class secsgem.hsms.HsmsHeader(system, session_id, stream=0, function=0, requires_response=False, p_type=0, s_type=HsmsSType.SELECT_REQ)[source]

Generic HSMS header.

Base for different specific headers

property p_type: int

Get P-type.

property s_type: HsmsSType

Get S-type.

encode()[source]

Encode header to hsms message.

Return type:

bytes

Returns:

encoded header

Example

>>> import secsgem.hsms
>>> import secsgem.common
>>>
>>> header = secsgem.hsms.HsmsLinktestReqHeader(2)
>>> secsgem.common.format_hex(header.encode())
'ff:ff:00:00:00:05:00:00:00:02'
classmethod decode(data)[source]

Decode data to HsmsHeader object.

Parameters:

data (bytes) – data to decode

Return type:

HsmsHeader

Returns:

new header object

class secsgem.hsms.HsmsStreamFunctionHeader(system, stream, function, require_response, session_id)[source]

Header for SECS message.

Header for message with SType 0.

class secsgem.hsms.HsmsSelectReqHeader(system)[source]

Header for Select Request.

Header for message with SType 1.

class secsgem.hsms.HsmsSelectRspHeader(system)[source]

Header for Select Response.

Header for message with SType 2.

class secsgem.hsms.HsmsDeselectReqHeader(system)[source]

Header for Deselect Request.

Header for message with SType 3.

class secsgem.hsms.HsmsDeselectRspHeader(system)[source]

Header for Deselect Response.

Header for message with SType 4.

class secsgem.hsms.HsmsLinktestReqHeader(system)[source]

Header for Linktest Request.

Header for message with SType 5.

class secsgem.hsms.HsmsLinktestRspHeader(system)[source]

Header for Linktest Response.

Header for message with SType 6.

class secsgem.hsms.HsmsRejectReqHeader(system, s_type, reason)[source]

Header for Reject Request.

Header for message with SType 7.

class secsgem.hsms.HsmsSeparateReqHeader(system)[source]

Header for Separate Request.

Header for message with SType 9.

class secsgem.hsms.HsmsSType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

HSMS SType enum.

classmethod names()[source]

Get the names associated with the scode.

Return type:

dict[HsmsSType, str]

Returns:

dictionary of names associated with enum values

property text: str

Get the text for the item.