mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-12 00:02:53 +00:00
* 15min prices WIP * WIP more changes for 15min prices * More work on 15min pricing * Fixed some errors * Some changes after testing * Graphical changes for 15min pricing * Adjustments on MQTT handlers after switching to 15min prices * Reverted some MQTT changes * Adapted HA integration for 15min pricing * Adapted JSON payload for 15min * Adjustments during testing * Set default price interval * Fixed refresh of price graph when data changes * Bugfixes * Fixed some issues with raw payload * Adjustments for meter timestamp from Kamstrup * Updated readme * Added detailed breakdown of payloads coming from Norwegian meters * Minor changes relating to price * Fixed byte alignment on price config * Changes to support RC upgraders
43 lines
786 B
C++
43 lines
786 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
|
|
#define DOCPOS_RESOLUTION 5
|
|
|
|
class EntsoeA44Parser: public Stream {
|
|
public:
|
|
EntsoeA44Parser(PricesContainer *container);
|
|
virtual ~EntsoeA44Parser();
|
|
|
|
int available();
|
|
int read();
|
|
int peek();
|
|
void flush();
|
|
size_t write(const uint8_t *buffer, size_t size);
|
|
size_t write(uint8_t);
|
|
|
|
private:
|
|
PricesContainer *container;
|
|
float multiplier = 1.0;
|
|
|
|
char buf[64];
|
|
uint8_t pos = 0;
|
|
uint8_t docPos = 0;
|
|
uint8_t pointNum = 0;
|
|
};
|
|
|
|
#endif
|