![]() |
VectorNav .NET Library
|
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< PacketFoundEventArgs > | ValidPacketFound |
| Allows registering for notification of when a valid packet if found. More... | |
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.
| 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.
| receiveBufferSize | The number of bytes to make the internal buffer. |
| 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.
| data | The data buffer containing the received data. |
| index | The start index of the received data. |
| length | The number of bytes received. |
| EventHandler<PacketFoundEventArgs> VectorNav.Protocol.Uart.PacketFinder.ValidPacketFound |
Allows registering for notification of when a valid packet if found.
1.8.10