mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-16 00:33:14 +00:00
48 lines
877 B
C++
48 lines
877 B
C++
/**
|
|
* @copyright Utilitech AS 2023
|
|
* License: Fair Source
|
|
*
|
|
*/
|
|
|
|
#ifndef _ENTSOEA44PARSER_H
|
|
#define _ENTSOEA44PARSER_H
|
|
|
|
#include "Stream.h"
|
|
#include "PricesContainer.h"
|
|
|
|
#define DOCPOS_SEEK 0
|
|
#define DOCPOS_CURRENCY 1
|
|
#define DOCPOS_MEASUREMENTUNIT 2
|
|
#define DOCPOS_POSITION 3
|
|
#define DOCPOS_AMOUNT 4
|
|
|
|
class EntsoeA44Parser: public Stream {
|
|
public:
|
|
EntsoeA44Parser();
|
|
virtual ~EntsoeA44Parser();
|
|
|
|
char* getCurrency();
|
|
char* getMeasurementUnit();
|
|
float getPoint(uint8_t position);
|
|
|
|
int available();
|
|
int read();
|
|
int peek();
|
|
void flush();
|
|
size_t write(const uint8_t *buffer, size_t size);
|
|
size_t write(uint8_t);
|
|
void get(PricesContainer*);
|
|
|
|
private:
|
|
char currency[4];
|
|
char measurementUnit[4];
|
|
float points[25];
|
|
|
|
char buf[64];
|
|
uint8_t pos = 0;
|
|
uint8_t docPos = 0;
|
|
uint8_t pointNum = 0;
|
|
};
|
|
|
|
#endif
|