Entity¶
- class brainstem.Entity_Entity.Entity(module, cmd, index)[source]¶
Base class for BrainStem Entity.
Provides the default implementation for a functional entity within the BrainStem. This can include IO like GPIOs, Analogs etc. For a more detailed description of Entities see the Terminology section of the brainstem reference for more information.
- call_UEI(option)[source]¶
Call a set UEI on this entity.
- Parameters:
option (byte) – The command option.
- Returns:
An error result from the list of defined error codes in brainstem.result
- property command¶
Return the entity command.
- Type:
int
- drain_UEI(option)[source]¶
Drain UEI packets matching option.
- Parameters:
option (byte) – The command option.
- Returns:
An error result from the list of defined error codes in brainstem.result
- getStreamStatus(buffer_length=1024)[source]¶
Gets all available stream values associated with the cmd and index of the called API.
- Parameters:
buffer_length (unsigned int) – Size of the buffer to allocate
- Returns:
An error result from the list of defined error codes in brainstem.result
- get_UEI16(option)[source]¶
Get a UEI short value.
- Parameters:
option (byte) – The command option.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- get_UEI16_with_subindex(option, subIndex)[source]¶
Call a get UEI short value with a subIndex.
- Parameters:
option (byte) – The command option.
subIndex (byte) – The subIndex of the entity.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- get_UEI32(option)[source]¶
Get a UEI int value.
- Parameters:
option (byte) – The command option.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- get_UEI32_with_subindex(option, subIndex)[source]¶
Call a get UEI int value with a subIndex.
- Parameters:
option (byte) – The command option.
subIndex (byte) – The subIndex of the entity.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- get_UEI8(option)[source]¶
Get a UEI byte value.
- Parameters:
option (byte) – The command option.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- get_UEI8_with_subindex(option, subIndex)[source]¶
Call a get UEI byte value with a subIndex.
- Parameters:
option (byte) – The command option.
subIndex (byte) – The subIndex of the entity.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- get_UEIBytes(option, buffer_length=65536)[source]¶
Get a UEI Bytes buffer on this entity.
- Parameters:
option (byte) – The command option.
buffer_length (unsigned int) – The subIndex of the entity.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- property index¶
Return the entity index
- Type:
int
- registerOptionCallback(option, enable, cb, pRef)[source]¶
Registers a callback function based on a specific option code. Option code applies to the cmd and index of the called API.
:param option The option code for the entities command and index. :type option: byte
:param enable Enable (True) or disable (False) streaming. :type enable: bool
:param cb Callback to be executed on the provided criteria. :type cb: @ffi.callback(“unsigned char(aPacket*, void*)”)
:param pRef Handle to be passed to the provided callback. This handle must be kept alive by the caller. :type pRef: ffi handle
- Returns:
An error result from the list of defined error codes in brainstem.result
- setStreamEnabled(enable)[source]¶
Enables streaming for all possible option codes within the cmd and index the entity was created for.
- Parameters:
enable (bool) – Enable (True) or disable (False) streaming.
- Returns:
An error result from the list of defined error codes in brainstem.result
- set_UEI16(option, value)[source]¶
Call a set UEI with short value on this entity.
- Parameters:
option (byte) – The command option.
value (short) – The short parameter to send.
- Returns:
An error result from the list of defined error codes in brainstem.result
- set_UEI16_with_subindex(option, subIndex, value)[source]¶
Call a set UEI short value with a subIndex.
- Parameters:
option (byte) – The command option.
subIndex (byte) – The subIndex of the entity.
value (short) – The short parameter to send.
- Returns:
An error result from the list of defined error codes in brainstem.result
- set_UEI32(option, value)[source]¶
Call a set UEI with int value on this entity.
- Parameters:
option (byte) – The command option.
value (int) – The int parameter to send.
- set_UEI32_with_subindex(option, subIndex, value)[source]¶
Call a set UEI int value with a subIndex.
- Parameters:
option (byte) – The command option.
subIndex (byte) – The subIndex of the entity.
value (int) – The int parameter to send.
- Returns:
An error result from the list of defined error codes in brainstem.result
- set_UEI8(option, value)[source]¶
Call a set UEI with byte value on this entity.
- Parameters:
option (byte) – The command option.
value (byte) – The byte parameter to send.
- Returns:
An error result from the list of defined error codes in brainstem.result
- set_UEI8_with_subindex(option, subIndex, value)[source]¶
Call a set UEI byte value with a subIndex.
- Parameters:
option (byte) – The command option.
subIndex (byte) – The subIndex of the entity.
value (byte) – The byte parameter to send.
- Returns:
An error result from the list of defined error codes in brainstem.result