Store Class¶
See the Store Entity for generic information.
-
class StoreClass : public Acroname::BrainStem2CLI::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()¶
Constructors.
-
~StoreClass()¶
Destructor.
- !StoreClass ()
Finalizer.
- void init (BrainStem2CLI::ModuleClass^ module, const unsigned char index)
Initializes the class. Should only be called when manually creating classes.
- Parameters:
pModule – The module.
index – The cmdSTORE index to be addressed.
-
aErr getSlotState(const unsigned char slot, unsigned char %state)¶
Get slot state.
- Parameters:
slot – The slot number.
state – true: enabled, false: disabled.
- Returns:
Returns common entity return values
-
aErr loadSlot(const unsigned char slot, const unsigned char %buffer, const unsigned short bufferLength)¶
Load the slot.
- Parameters:
slot – The slot number.
buffer – The data.
bufferLength – The data length.
- Returns:
Returns common entity return values
-
aErr unloadSlot(const unsigned char slot, const unsigned int bufferLength, unsigned char %buffer, unsigned int %unloadedLength)¶
Unload the slot data.
- Parameters:
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.
unloadedLength – Length of data that was unloaded. Unloaded length will never be larger than dataLength.
- Returns:
Returns common entity return values
-
aErr slotEnable(const unsigned char slot)¶
Enable slot.
- Parameters:
slot – The slot number.
- Returns:
Returns common entity return values
-
aErr slotDisable(const unsigned char slot)¶
Disable slot.
- Parameters:
slot – The slot number.
- Returns:
Returns common entity return values
-
aErr getSlotCapacity(const unsigned char slot, unsigned int %capacity)¶
Get the slot capacity. Returns the Capacity of the slot, i.e. The number of bytes it can hold.
- Parameters:
slot – The slot number.
capacity – The slot capacity.
- Returns:
Returns common entity return values
-
aErr getSlotSize(const unsigned char slot, unsigned int %size)¶
Get the slot size. The slot size represents the size of the data currently filling the slot in bytes.
- Parameters:
slot – The slot number.
size – The slot size.
- Returns:
Returns common entity return values
-
aErr getSlotLocked(const unsigned char slot, unsigned char %lock)¶
Gets the current lock state of the slot Allows for write protection on a slot.
- Parameters:
slot – The slot number
lock – Variable to be filed with the locked state.
- Returns:
Returns common entity return values
-
aErr setSlotLocked(const unsigned char slot, const unsigned char lock)¶
Sets the locked state of the slot Allows for write protection on a slot.
- Parameters:
slot – The slot number
lock – state to be set.
- Returns:
Returns common entity return values
-
StoreClass()¶