Pointer

class brainstem.entity.Pointer(module, index)[source]

PointerClass: Allows access to the reflex scratchpad from a host computer.

The Pointers access the pad which is a shared memory area on a BrainStem module. The interface allows the use of the BrainStem scratchpad from the host, and provides a mechanism for allowing the host application and BrainStem relexes to communicate.

The Pointer allows access to the pad in a similar manner as a file pointer accesses the underlying file. The cursor position can be set via setOffset. A read of a character short or int can be made from that cursor position. In addition the mode of the pointer can be set so that the cursor position automatically increments or set so that it does not this allows for multiple reads of the same pad value, or reads of multi-record values, via an incrementing pointer.

getChar()[source]

Get a char (1 byte) value from the pointer at this object’s index, where elements are 1 byte long. The value of a single character (1 byte) stored in the pointer. All possible standard UEI return values.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getInt()[source]

Get an int (4 bytes) value from the pointer at this objects index, where elements are 4 bytes long The value of a single int (4 byte) stored in the pointer. All possible standard UEI return values.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getMode()[source]

Get the mode of the pointer The mode: aPOINTER_MODE_STATIC or aPOINTER_MODE_AUTO_INCREMENT. All possible standard UEI return values.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getOffset()[source]

Get the offset of the pointer The value of the offset. All possible standard UEI return values.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getShort()[source]

Get a short (2 byte) value from the pointer at this objects index, where elements are 2 bytes long The value of a single short (2 byte) stored in the pointer. All possible standard UEI return values.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getTransferStore()[source]

Get the handle to the store. The handle of the store. All possible standard UEI return handles.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

initiateTransferFromStore(transferLength)[source]

Transfer data from the store. All possible standard UEI return values.

Parameters:

transferLength (unsigned char) – The length of the data transfer.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

initiateTransferToStore(transferLength)[source]

Transfer data to the store. All possible standard UEI return values.

Parameters:

transferLength (unsigned char) – The length of the data transfer.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setChar(value)[source]

Set a char (1 byte) value to the pointer at this object’s element index, where elements are 1 byte long. All possible standard UEI return values.

Parameters:

value (const unsigned char) – The single char (1 byte) value to be stored in the pointer.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setInt(value)[source]

Set an int (4 bytes) value from the pointer at this objects index, where elements are 4 bytes long All possible standard UEI return values.

Parameters:

value (const unsigned int) – The single int (4 byte) value to be stored in the pointer.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setMode(mode)[source]

Set the mode of the pointer All possible standard UEI return values.

Parameters:

mode (unsigned char) – The mode: aPOINTER_MODE_STATIC or aPOINTER_MODE_AUTO_INCREMENT.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setOffset(offset)[source]

Set the offset of the pointer All possible standard UEI return values.

Parameters:

offset (unsigned short) – The value of the offset.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setShort(value)[source]

Set a short (2 bytes) value to the pointer at this object’s element index, where elements are 2 bytes long. All possible standard UEI return values.

Parameters:

value (const unsigned short) – The single short (2 byte) value to be set in the pointer.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setTransferStore(handle)[source]

Set the handle to the store. All possible standard UEI return handles.

Parameters:

handle (unsigned char) – The handle of the store.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte