Store Entity

See the Store Entity for generic information.

group StoreEntity

The store provides a flat file system on modules that have storage capacity. Files are referred to as slots and they have simple zero-based numbers for access. Store slots can be used for generalized storage and commonly contain compiled reflex code (files ending in .map) or templates used by the system. Slots simply contain bytes with no expected organization but the code or use of the slot may impose a structure. Stores have fixed indices based on type. Not every module contains a store of each type. Consult the module datasheet for details on which specific stores are implemented, if any, and the capacities of implemented stores.

void store_getSlotState(unsigned int *id, struct Result *result, const int index, const unsigned char slot)

Get slot state.

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.

  • slot – The slot number.

void store_loadSlot(unsigned int *id, struct Result *result, const int index, const unsigned char slot, const unsigned char *buffer, const unsigned short bufferLength)

Load the slot.

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.

  • slot – The slot number.

  • buffer – The data.

  • bufferLength – The data length.

void store_unloadSlot(unsigned int *id, struct Result *result, const int index, const unsigned char slot, unsigned char *buffer, const unsigned int bufferLength)

Unload the slot data.

The result parameter will output the following fields:

  • error: Common EntityClass Return Values common entity return value

  • value: Length of data that was unloaded. Unloaded length will never be larger than dataLength.

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.

  • slot – The slot number.

  • bufferLength – The length of buffer buffer in bytes. This is the maximum number of bytes that should be unloaded.

  • buffer – Byte array that the unloaded data will be placed into.

void store_slotEnable(unsigned int *id, struct Result *result, const int index, const unsigned char slot)

Enable slot.

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.

  • slot – The slot number.

void store_slotDisable(unsigned int *id, struct Result *result, const int index, const unsigned char slot)

Disable slot.

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.

  • slot – The slot number.

void store_getSlotCapacity(unsigned int *id, struct Result *result, const int index, const unsigned char slot)

Get the slot capacity. Returns the Capacity of the slot, i.e. The number of bytes it can hold.

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.

  • slot – The slot number.

void store_getSlotSize(unsigned int *id, struct Result *result, const int index, const unsigned char slot)

Get the slot size. The slot size represents the size of the data currently filling the slot in bytes.

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.

  • slot – The slot number.

void store_getSlotLocked(unsigned int *id, struct Result *result, const int index, const unsigned char slot)

Gets the current lock state of the slot Allows for write protection on a slot.

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.

  • slot – The slot number

void store_setSlotLocked(unsigned int *id, struct Result *result, const int index, const unsigned char slot, const unsigned char lock)

Sets the locked state of the slot Allows for write protection on a slot.

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.

  • slot – The slot number

  • lock – state to be set.