AutoBalance_v2
AutoBalance_v2

Contains logic for the Auto Balance Node command (Version 2).

Functions
buildCommand
static ByteStream buildCommand(
NodeAddress nodeAddress,
uint8 channelNumber,
float targetPercent
)

Builds the AutoBalance_v2 command packet.

Parameters
nodeAddress

The address of the Node to build the command for.

channelNumber
uint8

The channel number to balance (ch1 = 1, ch8 = 8).

targetPercent
float

The target percentage to balance to (0 - 100).

Returns

A ByteStream containing the command packet.

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 LongPing Node command

Functions
Response
Response(
NodeAddress nodeAddress,
uint8 channelNumber,
float targetPercent,
std::weak_ptr<ResponseCollectorcollector
)

Creates a LongPing Response object

Parameters
nodeAddress

the node address to check for in the response.

channelNumber
uint8

The channel number to check for in the response.

targetPercent
float

The target percentage (0-100) to check for in the response.

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 response.

m_channelNumber
uint8 m_channelNumber

The channel number to look for in the response.

m_targetPercent
float m_targetPercent

The target percentage to look for in the response.

m_result
AutoBalanceResult m_result

The AutoBalanceResult containing info about the autobalance 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

result
const AutoBalanceResult& result() const

Gets the AutoBalanceResult of the command.