Parses all wireless data and stores it in a corresponding container
A typedef for a map of NodeAddresses to a timestamp or tick value to check for packet duplication
WirelessParser( |
| ) |
Constructor for WirelessParser
packetCollector | the WirelessPacketCollector to be associated with this parser |
responseCollector std::weak_ptr<ResponseCollector> | the ResponseCollector to be associated with this parser |
The WirelessPacketCollector associated with this parser and it's parent base station
The ResponseCollector associated with this parser and it's parent base station
A DuplicateCheckMap containing node addresses and their uniqueId values
void processPacket( |
| ) |
Takes a WirelessPacket, adds it to the data container if it is a data packet, or adds it to the appropriate handler depending on the packet type
packet const WirelessPacket& | A verified, valid WirelessPacket |
lastReadPos std::size_t | The last read position where the packet was parsed from. |
bool findMatchingResponse( |
| ) |
Takes a DataBuffer of bytes and checks if the packet collector has any responses it is waiting on. If it does, and the bytes match the expected response, the bytes are "given" to the packet collector and the read position is moved.
data | A DataBuffer containing bytes to parse |
true if the bytes matched an expected response, false otherwise
bool findMatchingResponse( |
| ) |
Takes a WirelessPacket and checks if the packet collector has any responses it is waiting on. If it does, and the packet matches the expected response, the packet is "given" to the packet collector.
packet const WirelessPacket& | A WirelessPacket to match against expected responses |
lastReadPos std::size_t | The last read position where the packet was parsed from. |
true if the packet matched an expected response, false otherwise
bool isDuplicate( |
| ) |
Checks whether the passed in packet is a duplicate of the previous packet that came in.
packet const WirelessPacket& | The WirelessPacket to check for duplicate. |
true if the packet is a duplicate, false otherwise.
WirelessParser::ParsePacketResult parseAsPacket( |
| ) |
Takes a DataBuffer that has had its read position moved to the start of a packet and verifies that the bytes form a valid ASPP packet.
data | A DataBuffer with its read position at the start of a packet (0xAA). |
packet | A WirelessPacket to hold all the packet information if the packet is verified from the DataBuffer. |
freq | A WirelessTypes::Frequency representing the frequency that this data was collected on. |
A ParsePacketResult describing if the packet was verified, or why it failed verification.
bool findPacketInBytes( |
| ) |
Checks for packets after the current bytes buffer's read position (starting at the next byte, not the current one). If a packet is found, the packet is processed and the byte buffer's read position is moved. If a packet is not found, nothing changes in the byte buffer
data | The bytes to look through for a packet |
freq | The WirelessTypes::Frequency that this data was collected on |
true if an ASPP packet is found, false otherwise
void parse( |
| ) |
Takes a DataBuffer and finds the next ASPP Wireless Packet, or the next command response that is expected by the base station.
If an ASPP packet is found, the packet will be stored in the WirelessPacketCollector. If a command response is found and is expected, it will be handled and passed to the base station directly.
data | A DataBuffer containing bytes that should be parsed for MicroStrain packets. |
freq | The WirelessTypes::Frequency representing the radio frequency that this data was collected on. |