Store Entity

group StoreEntity

StoreClass: 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.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • state – true: enabled, false: disabled.

Returns:

Returns common entity return values

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

Load the slot.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • slot – The slot number.

  • pData – The data.

  • length – The data length.

Returns:

Returns common entity return values

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

Unload the slot data.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

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

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

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

  • slot – The slot number.

Returns:

Returns common entity return values

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

Enable slot.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • slot – The slot number.

Returns:

Returns common entity return values

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

Disable slot.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • slot – The slot number.

Returns:

Returns common entity return values

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.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • slot – The slot number.

  • capacity – The slot capacity.

Returns:

Returns common entity return values

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.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • slot – The slot number.

  • size – The slot size.

Returns:

Returns common entity return values

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.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • lock – Variable to be filed with the locked state.

Returns:

Returns common entity return values

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.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • slot – The slot number

  • lock – state to be set.

Returns:

Returns common entity return values