mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-14 15:54:47 +00:00
Updated to support new list definition
This commit is contained in:
parent
4a926ca26b
commit
d58d70c0df
@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "HanReader.h"
|
||||
#include "Kaifa.h"
|
||||
|
||||
// The HAN Port reader
|
||||
HanReader hanReader;
|
||||
@ -41,20 +42,20 @@ void loop() {
|
||||
if (hanReader.read())
|
||||
{
|
||||
// Get the list identifier
|
||||
List list = hanReader.getList();
|
||||
int listSize = hanReader.getListSize();
|
||||
|
||||
Serial1.println("");
|
||||
Serial1.print("List #");
|
||||
Serial1.print((byte)list, HEX);
|
||||
Serial1.print(": ");
|
||||
Serial1.println("");
|
||||
Serial1.print("List size: ");
|
||||
Serial1.print(listSize);
|
||||
Serial1.print(": ");
|
||||
|
||||
// Only care for the ACtive Power Imported, which is found in the first list
|
||||
if (list == List::List1)
|
||||
{
|
||||
int power = hanReader.getInt(List1_ObisObjects::ActivePowerImported);
|
||||
if (listSize == (int)Kaifa::List1)
|
||||
{
|
||||
int power = hanReader.getInt((int)Kaifa_List1::ActivePowerImported);
|
||||
Serial1.print("Power consumtion is right now: ");
|
||||
Serial1.print(power);
|
||||
Serial1.println(" W");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user