LongPing
PingResponse
PingResponse

Represents the response to a Long Ping Node command

Functions
PingResponse
PingResponse()

Creates a PingResponse with default values

PingResponse
PingResponse(
bool success,
int16 nodeRssi,
int16 baseRssi
)

Creates a PingResponse with the given parameters

Parameters
success
bool

Whether or not the Long Ping response was a success

nodeRssi
int16

The node RSSI value received in the Long Ping response

baseRssi
int16

The base station RSSI value received in the Long Ping response

ResponseSuccess
static PingResponse ResponseSuccess(
int16 nodeRssi,
int16 baseRssi
)

Creates a PingResponse with a successful response

Parameters
nodeRssi
int16

the node RSSI from the response

baseRssi
int16

the base station RSSI from the response

Returns

A PingResponse representing a success response from the LongPing node command

ResponseFail
static PingResponse ResponseFail()

Creates a PingResponse with a fail response

Returns

A PingResponse representing a failed response from the LongPing Node command

Variables
m_success
bool m_success

Whether or not the Long Ping response was a success

m_nodeRssi
int16 m_nodeRssi

The node RSSI value received in the Long Ping response

m_baseRssi
int16 m_baseRssi

The base station RSSI value received in the Long Ping response

Functions
success
bool success() const

Gets whether or not the Long Ping command was a success (the node responded).

Returns

true if the Long Ping command was a success, false otherwise.

nodeRssi
int16 nodeRssi() const

Gets the node RSSI that was returned with the response (if success() returns true).  This is the signal strength at which the Node received the BaseStation's command packet.

Returns

The node RSSI that was returned with the response

baseRssi
int16 baseRssi() const

Gets the base station RSSI that was returned with the response (if success() returns true).  This is the signal strength at which the BaseStation received the Nodes's response packet.

Returns

The base station RSSI that was returned with the response.

LongPing
LongPing

Contains logic for the LongPing Node command

Functions
buildCommand
static ByteStream buildCommand(
NodeAddress nodeAddress
)

Builds the LongPing command packet

Parameters
nodeAddress

the address of the Node to build the command for

Returns

A ByteStream containing the LongPing 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,
std::weak_ptr<ResponseCollectorcollector
)

Creates a LongPing Response object

Parameters
nodeAddress

the node address to check for

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 Long Ping response

m_result
PingResponse m_result

The PingResponse that holds the result of the LongPing Node command

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
PingResponse result()

Gets the PingResponse that holds the result of the response

Returns

A PingResponse that holds the result of the response