VectorNav .NET Library
Classes | Public Member Functions | Events | List of all members
VectorNav.Protocol.Uart.PacketFinder Class Reference

Helper class for finding packets in raw incoming data from a VectorNav sensor. More...

Public Member Functions

 PacketFinder ()
 Creates a new PacketFinder with internal buffers to store incoming bytes and alert when valid packets are received. More...
 
 PacketFinder (int receiveBufferSize)
 Creates a new PacketFinder with an internal buffer the size specified. More...
 
void ProcessReceivedData (byte[] data, int index, int length)
 Adds new data to the internal buffers and processes the received data to determine if any new received packets are available. More...
 

Events

EventHandler< PacketFoundEventArgsValidPacketFound
 Allows registering for notification of when a valid packet if found. More...
 

Detailed Description

Helper class for finding packets in raw incoming data from a VectorNav sensor.

Internally, the PacketFinder keeps track of a running data index which keeps a running count of the bytes that are processed by the class. This is useful for users who wish to keep track of where packets where found in the incoming raw data stream. When the PacketFinder receives its first byte from the user, this is given the index of 0 for the running index and incremented for each byte received.

Constructor & Destructor Documentation

VectorNav.Protocol.Uart.PacketFinder.PacketFinder ( )

Creates a new PacketFinder with internal buffers to store incoming bytes and alert when valid packets are received.

VectorNav.Protocol.Uart.PacketFinder.PacketFinder ( int  receiveBufferSize)

Creates a new PacketFinder with an internal buffer the size specified.

Parameters
receiveBufferSizeThe number of bytes to make the internal buffer.

Member Function Documentation

void VectorNav.Protocol.Uart.PacketFinder.ProcessReceivedData ( byte[]  data,
int  index,
int  length 
)

Adds new data to the internal buffers and processes the received data to determine if any new received packets are available.

Parameters
dataThe data buffer containing the received data.
indexThe start index of the received data.
lengthThe number of bytes received.

Event Documentation

EventHandler<PacketFoundEventArgs> VectorNav.Protocol.Uart.PacketFinder.ValidPacketFound

Allows registering for notification of when a valid packet if found.


The documentation for this class was generated from the following file: