From 8d781ad2404b9bc7b239904fce0af49856fe0dc7 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Wed, 8 Jul 2020 11:44:17 +0200 Subject: [PATCH] Improve product strings for Aquametro and Sensus --- mbus/mbus-protocol.c | 28 +++++++++++++++-------- test/test-frames/example_data_01.norm.xml | 2 +- test/test-frames/example_data_01.xml | 2 +- test/test-frames/example_data_02.norm.xml | 2 +- test/test-frames/example_data_02.xml | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/mbus/mbus-protocol.c b/mbus/mbus-protocol.c index 80eb45c..9312364 100755 --- a/mbus/mbus-protocol.c +++ b/mbus/mbus-protocol.c @@ -955,14 +955,21 @@ mbus_data_product_name(mbus_data_variable_header *header) } else if (manufacturer == mbus_manufacturer_id("AMT")) { - switch (header->version) + if (header->version >= 0xC0) { - case 0x80: - strcpy(buff,"Aquametro CALEC MB"); - break; - case 0xC0: - strcpy(buff,"Aquametro CALEC ST"); - break; + strcpy(buff,"Aquametro CALEC ST"); + } + else if (header->version >= 0x80) + { + strcpy(buff,"Aquametro CALEC MB"); + } + else if (header->version >= 0x40) + { + strcpy(buff,"Aquametro SAPHIR"); + } + else + { + strcpy(buff,"Aquametro AMTRON"); } } else if (manufacturer == mbus_manufacturer_id("BEC")) @@ -1266,15 +1273,16 @@ mbus_data_product_name(mbus_data_variable_header *header) { switch (header->version) { + case 0x08: + case 0x19: + strcpy(buff,"Sensus PolluCom E"); + break; case 0x0B: strcpy(buff,"Sensus PolluTherm"); break; case 0x0E: strcpy(buff,"Sensus PolluStat E"); break; - case 0x19: - strcpy(buff,"Sensus PolluCom E"); - break; } } else if (manufacturer == mbus_manufacturer_id("SON")) diff --git a/test/test-frames/example_data_01.norm.xml b/test/test-frames/example_data_01.norm.xml index 54ba0bb..587ce57 100644 --- a/test/test-frames/example_data_01.norm.xml +++ b/test/test-frames/example_data_01.norm.xml @@ -5,7 +5,7 @@ 3575845 AMT 52 - + Aquametro AMTRON Heat: Outlet 158 00 diff --git a/test/test-frames/example_data_01.xml b/test/test-frames/example_data_01.xml index dbfede8..a344e78 100644 --- a/test/test-frames/example_data_01.xml +++ b/test/test-frames/example_data_01.xml @@ -5,7 +5,7 @@ 3575845 AMT 52 - + Aquametro AMTRON Heat: Outlet 158 00 diff --git a/test/test-frames/example_data_02.norm.xml b/test/test-frames/example_data_02.norm.xml index d135aae..8702216 100644 --- a/test/test-frames/example_data_02.norm.xml +++ b/test/test-frames/example_data_02.norm.xml @@ -5,7 +5,7 @@ 3575845 AMT 52 - + Aquametro AMTRON Heat: Outlet 161 00 diff --git a/test/test-frames/example_data_02.xml b/test/test-frames/example_data_02.xml index ad6236f..fda38df 100644 --- a/test/test-frames/example_data_02.xml +++ b/test/test-frames/example_data_02.xml @@ -5,7 +5,7 @@ 3575845 AMT 52 - + Aquametro AMTRON Heat: Outlet 161 00