WriteEeprom_v2
WriteEeprom_v2

Contains logic for the WriteEeprom (version 2) Node command

Functions
buildCommand
static ByteStream buildCommand(
NodeAddress nodeAddress,
uint16 eepromAddress,
uint16 valueToWrite
)

Builds the WriteEeprom_v2 command packet

Parameters
nodeAddress

the address of the Node to build the command for

eepromAddress
uint16

the Eeprom address to write to

valueToWrite
uint16

the value to write to the Eeprom

Returns

A ByteStream containing the command packet

Constants
Packet Bytes
COMMAND_ID

0x0008  - The Command ID for the WriteEeprom_v2 Command

Response
public
ResponsePattern
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
GenericInertialCommand.​Response
Response

Handles the response to the WriteEeprom_v2 Node command

Functions
Response
Response(
NodeAddress nodeAddress,
uint16 eepromAddress,
uint16 valueWritten,
std::weak_ptr<ResponseCollectorcollector
)

Creates a WriteEeprom_v2 Response object

Parameters
nodeAddress

the node address to check for.

eepromAddress
uint16

the eeprom address that was written to.

valueWritten
uint16

the value that was written to eeprom.

collector
std::weak_ptr<ResponseCollector>

The ResponseCollector used to register and unregister the response.

Variables
m_nodeAddress
NodeAddress m_nodeAddress

The node address to look for in the WriteEeprom_v2 response

m_eepromAddress
uint16 m_eepromAddress

The eeprom address to look for in the WriteEeprom_v2 response.

eepromValue
uint16 m_eepromValue

The eeprom value to look for in the WriteEeprom_v2 response.

m_errorCode
WirelessPacket::ResponseErrorCode m_errorCode

The WirelessPacket::ResponseErrorCode from the response.

Functions
match
virtual bool match(
const WirelessPacket &packet
) override

Checks if the WirelessPacket passed in matches the expected response pattern's bytes

Parameters
packet

The WirelessPacket in which to try to find the pattern

Returns

true if the packet matches a response pattern, false otherwise

errorCode
WirelessPacket::ResponseErrorCode errorCode() const

Gets the WirelessPacket::ResponseErrorCode from the response packet.

Returns

The error code from the response.

matchSuccessResponse
bool matchSuccessResponse(
const WirelessPacket &packet
)

Checks if the WirelessPacket passed in matches the success response.

Parameters
packet

The WirelessPacket to match.

Returns

true if the packet matches the success response, false otherwise.

matchFailResponse
bool matchFailResponse(
const WirelessPacket &packet
)

Checks if the WirelessPacket passed in matches the failure response.

Parameters
packet

The WirelessPacket to match.

Returns

true if the packet matches the fail response, false otherwise.