SetToIdle
SetToIdle
namespace SetToIdle

Contains logic for the Set to Idle command.

Functions
buildCommand
ByteStream buildCommand(
NodeAddress nodeAddress
)

Builds the SetToIdle command packet.

Parameters
nodeAddress

the address of the Node to build the command for.

Returns

A ByteStream containing the SetToIdle 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 SetToIdle command

Functions
Response
Response(
NodeAddress nodeAddress,
std::weak_ptr<ResponseCollectorcollector,
const BaseStation &baseStation
)

Creates a SetToIdle Response object

Parameters
nodeAddress

the node address to check for.

collector
std::weak_ptr<ResponseCollector>

The ResponseCollector used to register and unregister the response.

baseStation

The BaseStation that will send the command (used for canceling this command).

Response
~Response()

Destroys the SetToIdle Response object. This also cancels the SetToIdle operation on the BaseStation, if not already complete or canceled.

Variables
m_nodeAddress
uint16 m_nodeAddress

The node address to look for in the response.

m_result
SetToIdleStatus::SetToIdleResult m_result

The <SetToIdleResult> detailing the result of the Set to Idle command.

m_baseStation
BaseStation m_baseStation

The BaseStation that will send the command (used for canceling this command).

m_setToIdleMutex
std::mutex m_setToIdleMutex

The mutex used for thread safety.

Functions
match
virtual bool match(
DataBuffer &data
) override

Checks if the bytes passed in match the response pattern from their current read position.

Parameters
data

The DataBuffer containing the bytes in which to try to find the pattern.

Returns

true if the response pattern was found, false otherwise.

cancel
void cancel()

Attempts to cancel the Stop Node operation.

Exceptions
result
SetToIdleStatus::SetToIdleResult result()

Gets the <SetToIdleResult> of the Stop Node command.

Returns

The <SetToIdleResult> containing the result of the Stop Node command.