The abstract base class for reading and writing to Wireless devices' eeproms.
typedef for a map of eeprom locations to eeprom values
explicit Eeprom( |
| ) |
Creates an Eeprom object.
useCache bool | Whether or not to use the eeprom cache. |
numRetries uint8 | The number of retries to use for reads and writes. |
The EepromMap contianing all cached values that have previously been read from a device.
Whether or not the cache should be used.
The number of retries to use when reading and writing eeproms.
void useCache( |
| ) |
Enables or disables use of the eeprom cache. Once disabled, all eeprom reads will go to the Node.
enable bool | Whether to enable (true) or disable (false) the eeprom cache. |
Clears the entire eeprom cache.
void clearCacheLocation( |
| ) |
Clears a specific location from the eeprom cache, if it exists.
location uint16 | The location to clear from the cache. |
void setNumRetries( |
| ) |
Sets the number of retries to use when reading and writing eeproms. By default, this configuration is set to 0, meaning no retries are performed.
retries uint8 | The number of retries to use. |
Gets the number of retries currently set for reading and writing eeproms.
The number of retries currently set.
bool readCache( |
| ) |
Attempts to read a value from the eeprom cache.
location uint16 | The eeprom location to get the value for. |
result uint16& | Holds the result value read from the cache if successful. |
true if the value was read from the cache, false if the value was not found in the cache.
void updateCache( |
| ) |
Adds a value to the eeprom cache at the given location, or updates it if a value for that location already exists.
location uint16 | The location to store the value for in the cache. |
value uint16 | The eeprom value to store in the cache. |
virtual bool updateCacheFromDevice( |
| ) = 0 |
Attempts to update the cache by reading the value from a device. Any values that are read from the device will be updated in the cache.
location uint16 | The eeprom location to read from the device and update in the cache. |
true if the value was read from the device and the cache has been updated, false otherwise.
virtual uint16 readEeprom( |
| ) = 0 |
Attempts to read an eeprom value from a device. If caching is enabled and there is a previously cached value available, this will just return the value from the cache and will not communicate with the device.
location uint16 | The eeprom location to read from the device and update in the cache. |
The eeprom value for the requested location.
Error_NotSupported: Unsupported eeprom location.
Error_Communication: Failed to read the value from the BaseStation.
Error_NodeCommunication: Failed to read the value from the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual void writeEeprom( |
| ) = 0 |
Attempts to write an eeprom value to a device. If successful, the cache will be updated with the changed value as well. If caching is enabled and the value in the cache is the same as that attempting to be written, nothing will be written to the device and this function will have no affect.
location uint16 | The eeprom location to write to on the device and update in the cache. |
value uint16 | The value to write to the eeprom on the device and update in the cache. |
Error_NodeCommunication: Failed to write the value to the Node.
Error_Connection: A connection error has occurred with the BaseStation.
Value readEeprom( |
| ) |
Attempts to read an eeprom value from a device. If caching is enabled and there is a previously cached value available, this will just return the value from the cache and will not communicate with the device.
location const EepromLocation& | The EepromLocation to read from the device and update in the cache. |
A Value object containing the eeprom value for the requested location.
Error_NotSupported: Unsupported eeprom location.
Error_Communication: Failed to read the value from the BaseStation.
Error_NodeCommunication: Failed to read the value from the Node.
Error_Connection: A connection error has occurred with the BaseStation.
void writeEeprom( |
| ) |
Attempts to write an eeprom value to a device. If successful, the cache will be updated with the changed value as well. If caching is enabled and the value in the cache is the same as that attempting to be written, nothing will be written to the device and this function will have no affect.
location const EepromLocation& | The EepromLocation to write to on the device and update in the cache. |
value | The Value to write to the eeprom on the device and update in the cache. |
Error_NodeCommunication: Failed to write the value to the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual float readEeprom_float( |
| ) |
Attempts to read 2 eeprom values from a device and build them into a float. If caching is enabled and there is a previously cached value available, this will just return the value from the cache and will not communicate with the device.
location uint16 | The eeprom location to read from the device and update in the cache. |
The eeprom value for the requested location.
Error_NotSupported: Unsupported eeprom location.
Error_Communication: Failed to read the value from the BaseStation.
Error_NodeCommunication: Failed to read the value from the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual uint32 readEeprom_uint32( |
| ) |
Attempts to read 2 eeprom values from a device and build them into a uint32. If caching is enabled and there is a previously cached value available, this will just return the value from the cache and will not communicate with the device.
location uint16 | The eeprom location to read from the device and update in the cache. |
The eeprom value for the requested location.
Error_NotSupported: Unsupported eeprom location.
Error_Communication: Failed to read the value from the BaseStation.
Error_NodeCommunication: Failed to read the value from the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual int16 readEeprom_int16( |
| ) |
Attempts to read an eeprom value from a device as a signed int16. If caching is enabled and there is a previously cached value available, this will just return the value from the cache and will not communicate with the device.
location uint16 | The eeprom location to read from the device and update in the cache. |
The eeprom value for the requested location.
Error_NotSupported: Unsupported eeprom location.
Error_Communication: Failed to read the value from the BaseStation.
Error_NodeCommunication: Failed to read the value from the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual void writeEeprom_float( |
| ) |
Attempts to write 2 eeprom values to a device as a float. If successful, the cache will be updated with the changed value as well. If caching is enabled and the value in the cache is the same as that attempting to be written, nothing will be written to the device and this function will have no affect.
location uint16 | The eeprom location to write to on the device and update in the cache. |
value float | The value to write to the eeprom on the device and update in the cache. |
Error_NotSupported: Unsupported eeprom location or value.
Error_NodeCommunication: Failed to write the value to the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual void writeEeprom_uint32( |
| ) |
Attempts to write 2 eeprom values to a device as a uint32. If successful, the cache will be updated with the changed value as well. If caching is enabled and the value in the cache is the same as that attempting to be written, nothing will be written to the device and this function will have no affect.
location uint16 | The EepromLocation to write to on the device and update in the cache. |
value uint32 | The value to write to the eeprom on the device and update in the cache. |
Error_NotSupported: Unsupported eeprom location or value.
Error_NodeCommunication: Failed to write the value to the Node.
Error_Connection: A connection error has occurred with the BaseStation.
virtual void writeEeprom_int16( |
| ) |
Attempts to write an eeprom value to a device from a signed int16. If successful, the cache will be updated with the changed value as well. If caching is enabled and the value in the cache is the same as that attempting to be written, nothing will be written to the device and this function will have no affect.
location uint16 | The eeprom location to write to on the device and update in the cache. |
value int16 | The value to write to the eeprom on the device and update in the cache. |
Error_NotSupported: Unsupported eeprom location or value.
Error_NodeCommunication: Failed to write the value to the Node.
Error_Connection: A connection error has occurred with the BaseStation.