From 7e697f27bba928ec75243322bb9b0cc52e8beff0 Mon Sep 17 00:00:00 2001 From: Roar Fredriksen Date: Thu, 26 Oct 2017 00:47:29 +0200 Subject: [PATCH] Fixing missing OBIS in enum, adding clock to test project --- Code/Arduino/HanReader/src/Kamstrup.h | 6 +++++- Code/Arduino/KamstrupTest/KamstrupTest.ino | 14 ++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Code/Arduino/HanReader/src/Kamstrup.h b/Code/Arduino/HanReader/src/Kamstrup.h index c06f979a..f9ee0aef 100644 --- a/Code/Arduino/HanReader/src/Kamstrup.h +++ b/Code/Arduino/HanReader/src/Kamstrup.h @@ -71,12 +71,16 @@ enum class Kamstrup_List2 VoltageL2, VoltageL3_OBIS, VoltageL3, + MeterClock_OBIS, MeterClock, + CumulativeActiveImportEnergy_OBIS, CumulativeActiveImportEnergy, + CumulativeActiveExportEnergy_OBIS, CumulativeActiveExportEnergy, + CumulativeReactiveImportEnergy_OBIS, CumulativeReactiveImportEnergy, + CumulativeReactiveExportEnergy_OBIS, CumulativeReactiveExportEnergy - }; diff --git a/Code/Arduino/KamstrupTest/KamstrupTest.ino b/Code/Arduino/KamstrupTest/KamstrupTest.ino index a152b8ab..46a19622 100644 --- a/Code/Arduino/KamstrupTest/KamstrupTest.ino +++ b/Code/Arduino/KamstrupTest/KamstrupTest.ino @@ -71,15 +71,15 @@ void loop() { if (hanReader.read(samples[sampleIndex++])) { // Get the list identifier - int list = hanReader.getList(); + int listSize = hanReader.getListSize(); Serial.println(""); - Serial.print("List #"); - Serial.print((byte)list, HEX); + Serial.print("List size: "); + Serial.print(listSize); Serial.print(": "); // Only care for the ACtive Power Imported, which is found in the first list - if (list == (int)Kamstrup::List1 || list == (int)Kamstrup::List2) + if (listSize == (int)Kamstrup::List1 || listSize == (int)Kamstrup::List2) { String id = hanReader.getString((int)Kamstrup_List1::ListVersionIdentifier); Serial.println(id); @@ -114,6 +114,12 @@ void loop() { Serial.println(" A)"); } + if (listSize == (int)Kamstrup::List2) + { + time_t clock = hanReader.getTime((int)Kamstrup_List2::MeterClock); + Serial.print("Clock is: "); + Serial.println(clock); + } } }