diff --git a/Makefile b/Makefile
index 83e84ee..e534745 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,7 @@ METERS_OBJS:=\
$(BUILD)/meter_supercom587.o \
$(BUILD)/meter_iperl.o \
$(BUILD)/meter_qcaloric.o \
+ $(BUILD)/meter_apator162.o \
$(BUILD)/printer.o \
$(BUILD)/serial.o \
$(BUILD)/shell.o \
@@ -148,6 +149,7 @@ update_manufacturers:
-e 's/<\/tr>/)\\\n/g' | \
grep -v '
' | tr -s ' ' | tr -s '\t' | tr '\t' '|' > tmpfile
echo 'X(|QDS|QUNDIS GmbH)\' >> tmpfile
+ echo 'X(|APA|Apator Powogaz S.A)\' >> tmpfile
cat tmpfile | sed -e "s/X(|\(.\)\(.\)\(.\)/X(\1\2\3|MANFCODE('\1','\2','\3')|/g" | \
tr -s '|' ',' >> m.h
echo >> m.h
@@ -156,4 +158,4 @@ update_manufacturers:
echo >> m.h
echo '#endif' >> m.h
rm tmpfile
- mv m.h manufacturers.h
+ mv m.h src/manufacturers.h
diff --git a/README.md b/README.md
index 0568df8..2bb9623 100644
--- a/README.md
+++ b/README.md
@@ -122,6 +122,7 @@ Supported heat cost allocator:
Qundis Q caloric (qcaloric)
Work in progress:
+Water meter Apator wt-wmbus-16-2 (apator162)
Heat meter Kamstrup Multical 302 (multical302)
Electricity meter Kamstrup Omnipower (omnipower)
```
diff --git a/src/main.cc b/src/main.cc
index 0adb4f6..dafc4c3 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -100,6 +100,7 @@ Supported heat cost allocator:
Qundis Q caloric (qcaloric)
Work in progress:
+Water meter Apator at-wmbus-16-2
Heat meter Kamstrup Multical 302 (multical302)
Electricity meter Kamstrup Omnipower (omnipower)
)MANUAL";
@@ -270,6 +271,10 @@ void startUsingCommandline(Configuration *config)
meters.push_back(createQCaloric(wmbus.get(), m.name, m.id, m.key));
verbose("(qcaloric) configured \"%s\" \"qcaloric\" \"%s\" %s\n", m.name.c_str(), m.id.c_str(), keymsg);
break;
+ case APATOR162_METER:
+ meters.push_back(createApator162(wmbus.get(), m.name, m.id, m.key));
+ verbose("(apator162) configured \"%s\" \"apator162\" \"%s\" %s\n", m.name.c_str(), m.id.c_str(), keymsg);
+ break;
case UNKNOWN_METER:
error("No such meter type \"%s\"\n", m.type.c_str());
break;
diff --git a/src/manufacturers.h b/src/manufacturers.h
index fbbf9ce..3d91d8d 100644
--- a/src/manufacturers.h
+++ b/src/manufacturers.h
@@ -1,5 +1,5 @@
// Data downloaded from http://www.m-bus.de/man.html
-// 2019-02-17
+// 2019-03-15
#ifndef MANUFACTURERS_H
#define MANUFACTURERS_H
@@ -116,6 +116,7 @@ X(ZAG,MANFCODE('Z','A','G'),Zellwerg Uster AG)\
X(ZAP,MANFCODE('Z','A','P'),Zaptronix)\
X(ZIV,MANFCODE('Z','I','V'),ZIV Aplicaciones y Tecnologia S.A.)\
X(QDS,MANFCODE('Q','D','S'),QUNDIS GmbH)\
+X(APA,MANFCODE('A','P','A'),Apator Powogaz S.A)\
#define MANUFACTURER_ABB MANFCODE('A','B','B')
#define MANUFACTURER_ACE MANFCODE('A','C','E')
@@ -228,5 +229,6 @@ X(QDS,MANFCODE('Q','D','S'),QUNDIS GmbH)\
#define MANUFACTURER_ZAP MANFCODE('Z','A','P')
#define MANUFACTURER_ZIV MANFCODE('Z','I','V')
#define MANUFACTURER_QDS MANFCODE('Q','D','S')
+#define MANUFACTURER_APA MANFCODE('A','P','A')
#endif
diff --git a/src/meter_apator162.cc b/src/meter_apator162.cc
new file mode 100644
index 0000000..2150422
--- /dev/null
+++ b/src/meter_apator162.cc
@@ -0,0 +1,276 @@
+/*
+ Copyright (C) 2017-2019 Fredrik Öhrström
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#include"dvparser.h"
+#include"meters.h"
+#include"meters_common_implementation.h"
+#include"wmbus.h"
+#include"wmbus_utils.h"
+#include"util.h"
+
+#include
+#include