Adjusted project to prepare for library

This commit is contained in:
Roar Fredriksen
2017-09-25 22:58:45 +02:00
parent caccc8cd07
commit c7ed6b6fc8
5 changed files with 374 additions and 133 deletions

View File

@@ -0,0 +1,44 @@
#ifndef _HANREADER_h
#define _HANREADER_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include "KaifaHan.h"
#include "DlmsReader.h"
class HanReader
{
public:
HanReader();
void setup(HardwareSerial *hanPort);
void setup(HardwareSerial *hanPort, Stream *debugPort);
bool read();
List getList();
time_t getPackageTime();
int getInt(List1_ObisObjects objectId);
int getInt(List2_ObisObjects objectId);
int getInt(List3_ObisObjects objectId);
int getInt(int objectId);
String getString(List1_ObisObjects objectId);
String getString(List2_ObisObjects objectId);
String getString(List3_ObisObjects objectId);
String getString(int objectId);
private:
Stream *debug;
Stream *han;
byte buffer[512];
int bytesRead;
KaifaHan kaifa;
DlmsReader reader;
List list;
};
#endif