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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. true: enabled, false: disabled.
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, unsigned char *buffer, const unsigned short bufferLength)¶
Load the slot.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure. Length of data that was unloaded. Unloaded length will never be larger than dataLength.
index – The index of the entity in question.
buffer – Byte array that the unloaded data will be placed into.
bufferLength – - The length of pData buffer in bytes. This is the maximum number of bytes that should be unloaded.
slot – The slot number.
-
void store_slotEnable(unsigned int *id, struct Result *result, const int index, const unsigned char slot)¶
Enable slot.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone on success. Non-zero error code on failure.
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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. The slot capacity.
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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. The slot size.
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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Variable to be filed with the locked state.
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.
Returns common entity return values
- Parameters:
id – ID assigned through “module_createStem”
result – Object containing aErrNone 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.