queue every text event until the frame was checked by it checksum. then process the data directly into the buffer struct. do not clear the buffer struct, so it will always include the most recent value of a particular data point.
22 lines
537 B
C++
22 lines
537 B
C++
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include "VeDirectData.h"
|
|
#include "VeDirectFrameHandler.h"
|
|
|
|
class VeDirectShuntController : public VeDirectFrameHandler<veShuntStruct> {
|
|
public:
|
|
VeDirectShuntController() = default;
|
|
|
|
void init(int8_t rx, int8_t tx, Print* msgOut, bool verboseLogging);
|
|
|
|
using data_t = veShuntStruct;
|
|
data_t veFrame{};
|
|
|
|
private:
|
|
bool processTextDataDerived(std::string const& name, std::string const& value) final;
|
|
void frameValidEvent() final;
|
|
};
|
|
|
|
extern VeDirectShuntController VeDirectShunt;
|