Streaming parser for Fastrak / FastSCAN ASCII records. More...
#include <fastrak_parser.h>
Public Types | |
| enum class | Units { Inches , Centimetres } |
Public Member Functions | |
| FastrakParser ()=default | |
| void | setUnits (Units units) |
| Units | units () const |
| void | append (const QByteArray &chunk) |
| bool | nextSample (FastrakSample &out) |
| void | reset () |
Static Public Member Functions | |
| static bool | parseRecord (const QByteArray &record, Units units, FastrakSample &out) |
Streaming parser for Fastrak / FastSCAN ASCII records.
Thread-affine: the caller is responsible for serialising calls. No heap allocations on the hot path other than the internal buffer.
Definition at line 71 of file fastrak_parser.h.
|
strong |
| Enumerator | |
|---|---|
| Inches | Fastrak factory default. |
| Centimetres | FastSCAN / G4 default. |
Definition at line 74 of file fastrak_parser.h.
|
default |
|
inline |
Append raw bytes received from the serial port.
Definition at line 87 of file fastrak_parser.h.
| bool FastrakParser::nextSample | ( | FastrakSample & | out | ) |
Pop the next fully-decoded sample, if any.
out was populated; false when the buffer does not yet contain a complete record. Definition at line 120 of file fastrak_parser.cpp.
|
static |
Parse one record line (without trailing CR/LF) — exposed for unit tests and for callers that pre-frame their data.
Definition at line 42 of file fastrak_parser.cpp.
|
inline |
Reset accumulated buffer state.
Definition at line 98 of file fastrak_parser.h.
|
inline |
Configure the linear unit reported by the device.
Definition at line 82 of file fastrak_parser.h.
|
inline |
Definition at line 84 of file fastrak_parser.h.