Porównaj commity

...

6 Commity

Autor SHA1 Wiadomość Data
BIBO 3ee4a19099
Merge 23536608dd into d90dbb196e 2024-04-15 00:24:58 -07:00
Fredrik Öhrström d90dbb196e Add another m,v,t combo for the lse_07_17 driver. 2024-04-15 08:44:14 +02:00
Fredrik Öhrström 14d021426a
Merge pull request #1245 from majonezz/patch-1
Avoid SIGSEGV in WMBusCUL::checkCULFrame
2024-04-14 16:13:26 +02:00
Michał Morański f32179a939
Avoid SIGSEGV in WMBusCUL::checkCULFrame
(cul) checkCULFrame "b2F4468506586269295620A17A2069F2"
(cul) no eol found yet, partial frame
(serial) received ascii "TMODE<0D><0A>b2F44685086625092957245C6A2069F2F6A06E0080000000000000000B9BF00000D0F0D11130512100F0F0F100F0F8E1F0F0E0D121310B241<0D><0A>b4E44B61065960200023732117A0E004005E4B5FD2A1E3DCCC84F38BDF21FD05D506BF685D50CB3AD9644F9FF7C893BF9DD0D2B64C85F703707B1965C69261E8CDF85046CDDC38F1336D67750E933854BA0C9A91240A18556E6064B<0D><0A>"
(cul) checkCULFrame "b2F4468506586269295620A17A2069F2TMODE<0D><0A>b2F44685086625092957245C6A2069F2F6A06E0080000000000000000B9BF00000D0F0D11130512100F0F0F100F0F8E1F0F0E0D121310B241<0D><0A>b4E44B61065960200023732117A0E004005E4B5FD2A1E3DCCC84F38BDF21FD05D506BF685D50CB3AD9644F9FF7C893BF9DD0D2B64C85F703707B1965C69261E8CDF85046CDDC38F1336D67750E933854BA0C9A91240A18556E6064B<0D><0A>"
(cul) bad hex for LQI and RSSI "MODE"
(cul) warning: the LQI and RSSI hex string is not properly formatted!

Thread 2 "wmbusmeters" received signal SIGSEGV, Segmentation fault.
0x571c718f in WMBusCUL::checkCULFrame (this=0xf0a03480, data=std::vector of length 339, capacity 339 = {...}, hex_frame_length=0xf07fe680,
    payload=std::vector of length 0, capacity 0, rssi_dbm=0xf07fe6c0) at src/wmbus_cul.cc:336
336         uint lqi = lqi_rssi[0]>>1;
(gdb)
2024-04-14 15:16:56 +02:00
Fredrik Öhrström a32fcfdf9a When generating IV for AES-CTR zero out H and R bit. 2024-04-13 13:42:25 +02:00
BIBO 23536608dd
Update driver_microclima.cc
Adding Sontex Supercal 739 - https://github.com/wmbusmeters/wmbusmeters/issues/898
2023-04-23 01:02:56 +03:00
6 zmienionych plików z 23 dodań i 4 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
/*
Copyright (C) 2021-2022 Fredrik Öhrström (gpl-3.0-or-later)
Copyright (C) 2021-2024 Fredrik Öhrström (gpl-3.0-or-later)
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
@ -34,6 +34,7 @@ namespace
di.addDetection(MANUFACTURER_LSE, 0x07, 0x18);
di.addDetection(MANUFACTURER_LSE, 0x07, 0x16);
di.addDetection(MANUFACTURER_LSE, 0x07, 0x17);
di.addDetection(MANUFACTURER_LSE, 0x07, 0xd8);
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
});
@ -207,3 +208,8 @@ namespace
// telegram=|2D4465329933961318067ADA000000_0C13567100004C1300000000426CFFFF02BB560000326CFFFF046D2307A12C|
// {"media":"warm water","meter":"lse_07_17","name":"Water","id":"13963399","total_m3":7.156,"due_date_m3":0,"due_date":"2127-15-31","what_date_m3":7,"what_date":"2021-11-30","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-12-01 07:35","meter_version":"11","timestamp":"1111-11-11T11:11:11Z"}
// |Water;13963399;7.156;0;2127-15-31;OK;2127-15-31;2021-12-01 07:35;1111-11-11 11:11.11
// Test: Water2 lse_07_17 09993623 NOKEY
// telegram=|2d44653223369909d8077a80000000046d130aed2B0c13233332004c1351762700426cdf2c326cffff02BB560000|
// {"device_date_time": "2023-11-13 10:19","due_date": "2022-12-31","due_date_m3": 277.651,"error_code": "OK","error_date": "2127-15-31","id": "09993623","media": "water","meter": "lse_07_17","name": "Water2","timestamp": "1111-11-11T11:11:11Z","total_m3": 323.323}
// |Water2;09993623;323.323;277.651;2022-12-31;OK;2127-15-31;2023-11-13 10:19;1111-11-11 11:11.11

Wyświetl plik

@ -31,6 +31,7 @@ namespace
di.setMeterType(MeterType::HeatMeter);
di.addLinkMode(LinkMode::T1);
di.addDetection(MANUFACTURER_MAD, 0x04, 0x00);
di.addDetection(MANUFACTURER_SON, 0x04, 0x1b); // Sontex Supercal 739
di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
});
@ -171,3 +172,10 @@ namespace
// telegram=|A44424348630579300047ADD0000202F2F046D0721B62C04064708000004135DB0030001FD1700426C9F2C4406C6040000C40106C0070000C4020637070000C4030611070000C404060B070000C405060B070000C406060B070000C407060B070000C40806A5060000C40906F7050000C40A067A050000C40B060F050000C40C06C6040000C40D063F040000C40E06BB030000C40F06A502000003FD0C05000002FD0B1111|
// {"consumption_at_set_date_11_kwh":1803,"consumption_at_set_date_13_kwh":1803,"consumption_at_set_date_15_kwh":1803,"consumption_at_set_date_17_kwh":1701,"consumption_at_set_date_19_kwh":1527,"consumption_at_set_date_1_kwh":1222,"consumption_at_set_date_21_kwh":1402,"consumption_at_set_date_23_kwh":1295,"consumption_at_set_date_25_kwh":1222,"consumption_at_set_date_27_kwh":1087,"consumption_at_set_date_29_kwh":955,"consumption_at_set_date_31_kwh":677,"consumption_at_set_date_3_kwh":1984,"consumption_at_set_date_5_kwh":1847,"consumption_at_set_date_7_kwh":1809,"consumption_at_set_date_9_kwh":1803,"id":"93573086","media":"heat","meter":"microclima","meter_datetime":"2021-12-22 01:07","model_version":"000005","name":"Heat","parameter_set":"1111","set_date_11_date":"2020-02-29","set_date_13_date":"2019-12-31","set_date_15_date":"2019-10-31","set_date_17_date":"2019-08-31","set_date_19_date":"2019-06-30","set_date_1_date":"2020-12-31","set_date_21_date":"2019-04-30","set_date_23_date":"2019-02-28","set_date_25_date":"2018-12-31","set_date_27_date":"2018-10-31","set_date_29_date":"2018-08-31","set_date_31_date":"2018-06-30","set_date_3_date":"2020-10-31","set_date_5_date":"2020-08-31","set_date_7_date":"2020-06-30","set_date_9_date":"2020-04-30","status":"OK","timestamp":"1111-11-11T11:11:11Z","total_energy_consumption_kwh":2119,"total_volume_m3":241.757}
// |Heat;93573086;OK;2119;241.757;1111-11-11 11:11.11
// Sontex Supercal 739 test case
// Test: sonsupercal microclima 89508019 NOKEY
// telegram=|4444EE4D198050891B047AFB000000_046D3612E423820A6CE1F1040628010000840A060000000004144A110000840A14000000000259E30F025D2A0C023B1D01032C3A0100|
// {"media":"heat","meter":"microclima","name":"sonsupercal","id":"89508019","meter_datetime":"2023-03-04 18:54","flow_temperature_c":40.67,"return_temperature_c":31.14,"status":"OK","total_energy_consumption_kwh":296,"total_volume_m3":44.26,"volume_flow_m3h":0.285,"power_kw":3.14,"consumption_at_set_date_20_kwh":0,"set_date_20_date":"-205264256-02-29","timestamp":"1111-11-11T11:11:11Z"}
// |sonsupercal;89508019;OK;296;44.26;1111-11-11 11:11.11

Wyświetl plik

@ -1,5 +1,5 @@
/*
Copyright (C) 2017-2023 Fredrik Öhrström (gpl-3.0-or-later)
Copyright (C) 2017-2024 Fredrik Öhrström (gpl-3.0-or-later)
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

Wyświetl plik

@ -331,6 +331,7 @@ FrameStatus WMBusCUL::checkCULFrame(vector<uchar> &data,
string s = safeString(hex_buffer);
debug("(cul) bad hex for LQI and RSSI \"%s\"\n", s.c_str());
warning("(cul) warning: the LQI and RSSI hex string is not properly formatted!\n");
return ErrorInFrame;
}
// LQI is 7 bits unsigned number and relative - range 0-127 lower is better
uint lqi = lqi_rssi[0]>>1;

Wyświetl plik

@ -1,5 +1,5 @@
/*
Copyright (C) 2018-2020 Fredrik Öhrström (gpl-3.0-or-later)
Copyright (C) 2018-2024 Fredrik Öhrström (gpl-3.0-or-later)
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
@ -39,7 +39,10 @@ bool decrypt_ELL_AES_CTR(Telegram *t, vector<uchar> &frame, vector<uchar>::itera
// A-field
for (int j=0; j<6; ++j) { iv[i++] = t->dll_a[j]; }
// CC-field
iv[i++] = t->ell_cc;
// Two bits should be zeroed out:
// 0x10 H-field Hop-count set when telegram is repeated
// 0x02 R-field Repeated access field
iv[i++] = t->ell_cc & ~(0x10) & ~(0x02);
// SN-field
for (int j=0; j<4; ++j) { iv[i++] = t->ell_sn_b[j]; }
// FN

Wyświetl plik

@ -447,6 +447,7 @@ ActualityDuration
FabricationNo
EnhancedIdentification
EnergyMWh
EnergyGJ
RelativeHumidity
AccessNumber
Medium