spinnman.messages.eieio package

Subpackages

Module contents

class spinnman.messages.eieio.AbstractEIEIOMessage

Bases: object

Interface for an EIEIOMessage.

abstract property bytestring: bytes

The bytes of the message.

abstract property eieio_header: EIEIOCommandHeader | EIEIODataHeader

The header of the message.

class spinnman.messages.eieio.EIEIOPrefix(value)

Bases: Enum

Possible prefixing of keys in EIEIO packets.

LOWER_HALF_WORD = 0
UPPER_HALF_WORD = 1
class spinnman.messages.eieio.EIEIOType(value)

Bases: Enum

Possible types of EIEIO packets.

Parameters:
  • encoded_value – The encoded value representing the type.

  • key_bytes – The number of bytes used by each key element.

  • payload_bytes – The number of bytes used by each payload element.

KEY_16_BIT = 0
KEY_32_BIT = 2
KEY_PAYLOAD_16_BIT = 1
KEY_PAYLOAD_32_BIT = 3
property encoded_value: int

The encoded value representing the type.

property key_bytes: int

The number of bytes used by each key element.

property max_value: int

The maximum value of the key or payload (if there is a payload).

property payload_bytes: int

The number of bytes used by each payload element.

spinnman.messages.eieio.read_eieio_command_message(data: bytes, offset: int) EIEIOCommandMessage

Reads the content of an EIEIO command message and returns an object identifying the command which was contained in the packet, including any parameter, if required by the command.

Parameters:
  • data – data received from the network as a byte-string

  • offset – offset at which the parsing operation should start

Returns:

an object which inherits from EIEIOCommandMessage which contains parsed data received from the network

spinnman.messages.eieio.read_eieio_data_message(data: bytes, offset: int) EIEIODataMessage

Reads the content of an EIEIO data message and returns an object identifying the data which was contained in the packet.

Parameters:
  • data – data received from the network as a byte-string

  • offset – offset at which the parsing operation should start

Returns:

an object which inherits from EIEIODataMessage which contains parsed data received from the network