Store Class

class StoreClass : public Acroname::BrainStem::EntityClass

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.

Public Functions

StoreClass(void)

Constructor.

~StoreClass(void)

Destructor.

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters
  • pModule: The module.
  • index: The index.

aErr getSlotState(const uint8_t slot, uint8_t *state)

Get slot state.

Return
Returns common entity return values
Parameters
  • slot: The slot number.
  • state: true: enabled, false: disabled.

aErr loadSlot(const uint8_t slot, const uint8_t *pData, const uint16_t length)

Load the slot.

Return
Returns common entity return values
Parameters
  • slot: The slot number.
  • pData: The data.
  • length: The data length.

aErr unloadSlot(const uint8_t slot, const size_t dataLength, uint8_t *pData, size_t *unloadedLength)

Unload the slot data.

Return
Returns common entity return values
Parameters
  • 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.

aErr slotEnable(const uint8_t slot)

Enable slot.

Return
Returns common entity return values
Parameters
  • slot: The slot number.

aErr slotDisable(const uint8_t slot)

Disable slot.

Return
Returns common entity return values
Parameters
  • slot: The slot number.

aErr getSlotCapacity(const uint8_t slot, size_t *capacity)

Get the slot capacity.

Return
Returns common entity return values
Parameters
  • slot: The slot number.
  • capacity: The slot capacity.

aErr getSlotSize(const uint8_t slot, size_t *size)

Get the slot size

Return
Returns common entity return values
Parameters
  • slot: The slot number.
  • size: The slot size.