NodeEeprom
public
Eeprom
NodeEeprom

Used to read and write to Wireless Nodes' eeproms and provide caching functionality.

Functions
Eeprom
NodeEeprom(
NodeAddress nodeAddress,
const BaseStation &base,
const WirelessProtocol &protocol,
const NodeEepromSettings &settings
)

Creates an Eeprom object.

Parameters
nodeAddress

The address of the Node to access the Eeprom of.

base

The BaseStation to use for communicating with the Node.

protocol

The WirelessProtocol that is supported by the Node.

setttings

The NodeEepromSettings to use.

Variables
m_nodeAddress
NodeAddress m_nodeAddress

The address of the WirelessNode to access the eeprom of.

m_baseStation
BaseStation m_baseStation

The BaseStation to use for communication with the Node.

m_useGroupRead
bool m_useGroupRead

Whether we can use a group eeprom read when reading from eeprom.

m_protocol
const WirelessProtocol* m_protocol

The WirelessProtocol that is supported by the Node.

Functions
updateCacheFromDevice
virtual bool updateCacheFromDevice(
uint16 location
) final

Attempts to update the cache by reading the value from the Node with the nodeAddress given at initialization.  Any values that are read from the Node will be updated in the cache.

Parameters
location
uint16

The eeprom location to read from the device and update in the cache.

Returns

true if the value was read from the device and the cache has been updated, false otherwise.

Exceptions
parseEepromPage
virtual void parseEepromPage(
const ByteStream &pageData,
uint16 pageIndex
)

Parses a page download result containing eeprom values.  The eeprom cache will be updated with all the parsed values.

Parameters
pageData
const ByteStream&

The ByteStream that contains the data read from the page download command

pageIndex
uint16

The 0-based index that was used to download the page

updateSettings
void updateSettings(
const NodeEepromSettings &settings
)

Changes the settings for this eeprom object.

setBaseStation
void setBaseStation(
const BaseStation &base
)

Updates the BaseStation object that is set for use in communicating with the Node.

readEeprom
virtual uint16 readEeprom(
uint16 location
) override

Attempts to read an eeprom value from the Node.  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 Node.

Parameters
location
uint16

The eeprom location to read from the Node and update in the cache.

Returns

The eeprom value for the requested location.

Exceptions
writeEeprom
virtual void writeEeprom(
uint16 location,
uint16 value
) override

Attempts to write an eeprom value to the Node.  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 Node and this function will have no affect.

Parameters
location
uint16

The eeprom location to write to on the Node and update in the cache.

value
uint16

The value to write to the eeprom on the Node and update in the cache.

Exceptions