WirelessPacket
WirelessPacket
NodeDiscoveryPacket
NodeDiscoveryPacket_v2
NodeDiscoveryPacket_v3
NodeDiscoveryPacket_v4
WirelessDataPacket

Represents a MicroStrain wireless packet

Types
Payload

typedef for the bytes that make up a payload in a packet

Constants
Wireless Packet Bytes
ASPP_START_OF_PACKET_BYTE

0xAA  - The "Start of Packet" byte for the ASPP packets

ASPP_POS_START_OF_PACKET

0;  - The byte position for the Start of Packet byte

ASPP_POS_DELIVERY_FLAGS

1;  - The byte position for the Delivery Stop Flags

ASPP_POS_APP_DATA_TYPE

2;  - The byte position for the App Data Type

ASPP_POS_NODE_ADDRESS

3;  - The byte position for the Node Address

ASPP_POS_PAYLOAD_LEN

5;  - The byte position for the payload length

ASPP_POS_PAYLOAD_START

6;  - The byte position for the start of the payload bytes

Wireless Packet Information
ASPP_MIN_RESPONSE_PACKET_SIZE

10  - The minimum number of bytes to make a valid ASPP Response packet (Payload len + LQI + RSSI + Checksum)

ASPP_NUM_BYTES_BEFORE_PAYLOAD

6  - The number of bytes in the ASPP packets before the payload

ASPP_NUM_BYTES_AFTER_PAYLOAD

4  - The number of bytes in the ASPP packets after the payload

ASPP_NUM_COMMAND_BYTES

2  - The number of command bytes in the ASPP packets

START_CHECKSUM_POS

1  - The starting position for calculating the checksum in ASPP packets

Types
PacketType
packetType_unknown

-1  - Unknown Packet Type

packetType_nodeCommand

0x00 - Node Command Packet

packetType_nodeErrorReply

0x02 - Node Command Error Reply Packet

packetType_LDC

0x04 - Standard Low Duty Cycle Packet

packetType_nodeDiscovery

0x07 - Node Discovery Packet (version 1)

packetType_TCLinkLDC

0x09 - TC-Link Low Duty Cycle packet

packetType_SyncSampling

0x0A - Synchronized Sampling Packet

packetType_BufferedLDC

0x0D - Buffered LDC Packet

packetType_AsyncDigital

0x0E - Asynchronous Digital (Event) Packet

packetType_AsyncDigitalAnalog

0x0F - Asynchronous Digital and Analog (Event) Packet

packetType_beaconEcho

0x10 - Beacon Echo Packet

packetType_LDC_16ch

0x14 - LDC Packet with 16 channel support

packetType_nodeDiscovery_v4

0x16 - Node Discovery Packet (version 4)

packetType_nodeDiscovery_v2

0x17 - Node Discovery Packet (version 2)

packetType_nodeDiscovery_v3

0x18 - Node Discovery Packet (version 3)

packetType_SyncSampling_16ch

0x1A - Synchronized Sampling Packet with 16 channel support

packetType_BufferedLDC_16ch

0x1D - Buffered LDC Packet with 16 channel support

packetType_NodeReceived

0x20 - Node Received the command

packetType_nodeSuccessReply

0x22 - Node Command Success Reply Packet

packetType_baseCommand

0x30 - Base Station Command Packet

packetType_baseSuccessReply

0x31 - Base Station Command Reply Packet

packetType_baseErrorReply

0x32 - Base Station Command Error Reply Packet

packetType_rfScanSweep

0x33 - RF Sweep Packet sent from the BaseStation in RF Scan Mode

packetType_SHM

0xA0 - Structural Health Monitoring Packet

packetType_HclSmartBearing_Calibrated

0xA1 - HclSmartBearing Calibrated data Packet

packetType_HclSmartBearing_Raw

0xA2 - HclSmartBearing Raw data Packet

packetType_rawAngleStrain

0xA3 - Raw Angle Strain data Packet

ResponseErrorCode

Possible error codes from response packets.

error_none

0x00 - No Error.

error_unknownEeprom

0x01 - An Unknown/Unsupported Eeprom was attempted to be accessed.

error_outOfBounds

0x02 - An out of bounds value was attempted to be used.

error_readOnly

0x03 - Attempted to write to a read only Eeprom location.

error_hardwareError

0x04 - A hardware error has occurred.

Functions
WirelessPacket
WirelessPacket()

The default constructor for a wireless packet

throwEepromResponseError
static void throwEepromResponseError(
ResponseErrorCode errorCode,
uint16 location
)

Throws an exception based on a ResponseErrorCode from a read/write eeprom command.  Not all error codes will cause an exception.

Parameters
errorCode

The ResponseErrorCode to use for potentially throwing an exception.

location
uint16

The eeprom location associated with the command.

Exceptions
- Error_NotSupported

invalid eeprom location, value out of bounds, or read only eeprom location.

Variables
m_deliveryStopFlags
DeliveryStopFlags m_deliveryStopFlags

The delivery stop flags of the packet

m_type
PacketType m_type

The packet type of the packet

m_nodeAddress
NodeAddress m_nodeAddress

The node address in the packet

m_nodeRSSI
int16 m_nodeRSSI

The node received signal strength indicator (strength of which the node received the command from the base station).  This value will be set to -200 if the packet contains a legacy junk lqi byte that should be thrown out.

m_baseRSSI
int16 m_baseRSSI

The base received signal strength indicator (strength of which the base station received the response from the node).

m_frequency
WirelessTypes::Frequency m_frequency

The WirelessTypes::Frequency that this packet was collected on.

m_payload
Payload m_payload

The payload bytes in the packet

Functions
isDataPacket
bool isDataPacket() const

Gets whether or not the packet is a Data packet.

Returns

true if the packet is a data packet, false otherwise.

isDiscoveryPacket
bool isDiscoveryPacket() const

Gets whether or not the packet is a Node Discovery packet.

Returns

true if the packet is a discovery packet, false otherwise.

deliveryStopFlags
DeliveryStopFlags deliveryStopFlags() const

Gets the delivery stop flags for the packet

Returns

The delivery stop flags as a DeliveryStopFlags object

deliveryStopFlags
void deliveryStopFlags(
DeliveryStopFlags flags
)

Sets the delivery stop flags to the passed in flags

Parameters
flags

the delivery stop flags to set

type
PacketType type() const

Gets the packet type of the packet

Returns

The packet type as a PacketType enumeration

type
void type(
PacketType packetType
)

Sets the packet type of the packet

Parameters
packetType

The packet type to set, as a PacketType enumeration

nodeAddress
NodeAddress nodeAddress() const

Gets the node address of the packet

Returns

The node address of the packet

nodeAddress
void nodeAddress(
NodeAddress address
)

Sets the node address of the packet

Parameters
address

The node address to set

nodeRSSI
int16 nodeRSSI() const

Gets the node RSSI of the packet

Returns

The node RSSI

nodeRSSI
void nodeRSSI(
int16 rssi
)

Sets the node RSSI of the packet

Parameters
rssi
int16

The node rssi to set

baseRSSI
int16 baseRSSI() const

Gets the base station RSSI of the packet

Returns

The base station RSSI

baseRSSI
void baseRSSI(
int16 rssi
)

Sets the base station RSSI of the packet

Parameters
rssi
int16

The base station RSSI

frequency
WirelessTypes::Frequency frequency() const

Gets the WirelessTypes::Frequency that the packet was collected on

Returns

The WirelessTypes::Frequency that the packet was collected on

frequency
void frequency(
WirelessTypes::Frequency freq
)

Sets the WirelessTypes::Frequency that the packet was collected on

Parameters
freq

The WirelessTypes::Frequency that the packet was collected on

payload
const Payload& payload() const

Gets the payload bytes of the packet

Returns

The payload of the packet, as a vector of bytes

payload
void payload(
const Bytes &bytes
)

Sets the payload bytes of the packet

Parameters
bytes
const Bytes&

The payload of the packet, as a vector of bytes