Pointer Entity

See the Pointer Entity for generic information.

group PointerEntity

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.

void pointer_getOffset(unsigned int *id, struct Result *result, const int index)

Get the offset of the pointer

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void pointer_setOffset(unsigned int *id, struct Result *result, const int index, const unsigned short offset)

Set the offset of the pointer

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • offset – The value of the offset.

void pointer_getMode(unsigned int *id, struct Result *result, const int index)

Get the mode of the pointer

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void pointer_setMode(unsigned int *id, struct Result *result, const int index, const unsigned char mode)

Set the mode of the pointer

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • mode – The mode: aPOINTER_MODE_STATIC or aPOINTER_MODE_AUTO_INCREMENT.

void pointer_getTransferStore(unsigned int *id, struct Result *result, const int index)

Get the handle to the store.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void pointer_setTransferStore(unsigned int *id, struct Result *result, const int index, const unsigned char handle)

Set the handle to the store.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • handle – The handle of the store.

void pointer_initiateTransferToStore(unsigned int *id, struct Result *result, const int index, const unsigned char transferLength)

Transfer data to the store.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • transferLength – The length of the data transfer.

void pointer_initiateTransferFromStore(unsigned int *id, struct Result *result, const int index, const unsigned char transferLength)

Transfer data from the store.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • transferLength – The length of the data transfer.

void pointer_getChar(unsigned int *id, struct Result *result, const int index)

Get a char (1 byte) value from the pointer at this object’s index, where elements are 1 byte long.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void pointer_setChar(unsigned int *id, struct Result *result, const int index, const unsigned char value)

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

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

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

void pointer_getShort(unsigned int *id, struct Result *result, const int index)

Get a short (2 byte) value from the pointer at this objects index, where elements are 2 bytes long

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void pointer_setShort(unsigned int *id, struct Result *result, const int index, const unsigned short value)

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

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

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

void pointer_getInt(unsigned int *id, struct Result *result, const int index)

Get an int (4 bytes) value from the pointer at this objects index, where elements are 4 bytes long

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void pointer_setInt(unsigned int *id, struct Result *result, const int index, const unsigned int value)

Set an int (4 bytes) value from the pointer at this objects index, where elements are 4 bytes long

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

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