1 #ifndef VNUPACKF_H_INCLUDED
2 #define VNUPACKF_H_INCLUDED
4 #include "vn/protocol/upack.h"
12 #ifndef VNUART_PROTOCOL_BUFFER_SIZE
14 #define VNUART_PROTOCOL_BUFFER_SIZE 256
24 typedef void(*VnUartPacketFinder_PacketFoundHandler)(
void *userData,
VnUartPacket* packet,
size_t runningIndexOfPacketStart);
28 #pragma warning(disable : 4820)
93 uint8_t receiveBuffer[VNUART_PROTOCOL_BUFFER_SIZE];
112 VnError VnUartPacketFinder_processData(
VnUartPacketFinder* finder, uint8_t* data,
size_t len);
119 VnError VnUartPacketFinder_registerPacketFoundHandler(
VnUartPacketFinder* finder, VnUartPacketFinder_PacketFoundHandler handler,
void *userData);
size_t binaryPossibleStartIndex
Start index of a possible binary packet.
Definition: upackf.h:86
Data structure holding current parsing status of data received from a VectorNav sensor.
Definition: upackf.h:38
bool asciiEndChar1Found
Indicates if the first ending character has been found.
Definition: upackf.h:60
bool binaryGroupsPresentFound
Indicates if we have found the groups present data field for a binary packet we are building...
Definition: upackf.h:76
Structure representing a UART packet received from a VectorNav sensor.
Definition: upack.h:34
size_t runningDataIndex
Used for correlating the position in the received raw data stream where packets are found...
Definition: upackf.h:48
VnUartPacketFinder_PacketFoundHandler packetFoundHandler
Callback for when a packet has been found and validated.
Definition: upackf.h:41
size_t asciiRunningDataIndexOfStart
Index of start of ASCII packet in total running index.
Definition: upackf.h:57
size_t bufferSize
Holds the size of the receive buffer.
Definition: upackf.h:69
bool asciiCurrentlyBuildingPacket
Indicates if an ASCII packet is currently being built.
Definition: upackf.h:51
size_t binaryNumberOfBytesRemainingForCompletePacket
Keeps track of the number of bytes remaining for a complete binary packet.
Definition: upackf.h:90
size_t binaryRunningDataIndexOfStart
Index of start of binary packet in total running index.
Definition: upackf.h:66
size_t bufferAppendLocation
The current location to append data into the buffer.
Definition: upackf.h:72
void * packetFoundHandlerUserData
User data for callbacks on the packetFoundHandler.
Definition: upackf.h:44
bool binaryCurrentlyBuildingBinaryPacket
Indicates if we are currently building a binary packet.
Definition: upackf.h:63
size_t asciiPossibleStartOfPacketIndex
Indicates a suspected start of an ASCII packet.
Definition: upackf.h:54
uint8_t binaryNumOfBytesRemainingToHaveAllGroupFields
Indicates the number of bytes remaining to have all group fields for a binary data packet we are proc...
Definition: upackf.h:83
uint8_t binaryGroupsPresent
The groups present found from a binary packet.
Definition: upackf.h:79