Fix bug where an mbus telegram was mistakenly detected as wmbus.

pull/915/head
Fredrik Öhrström 2023-03-13 17:58:51 +01:00
rodzic 5a2f3c22d1
commit 5e0bcbe3f0
3 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -9,3 +9,8 @@ telegram=|6893936808007275404810C514000431270000#04786BF99F00046D040F632B0415E02
telegram=|68F8F86808007200464470A7320404270000000974040970040C0E082303000C14079519000B2D0500000B3B0808000A5B52000A5F51000A6206004C14061818004C0E490603000C7800464470891071609B102D020100DB102D0201009B103B6009009A105B78009A105F74000C22726701003C22000000007C2200000000426C01018C2006000000008C3006000000008C80100600000000CC200600000000CC300600000000CC801006000000009A115B64009A115F63009B113B5208009B112D020100BC0122000000008C010E490603008C2106000000008C3106000000008C811006000000008C011406181800046D310ACA210F21040010A0C116|
{"media":"heat","meter":"ultraheat","name":"MyUltra","id":"70444600","heat_kwh":8974.444444,"volume_m3":1995.07,"power_kw":0.5,"flow_m3h":0.808,"flow_c":52,"return_c":51,"timestamp":"1111-11-11T11:11:11Z"}
# Test multical 403 heat meter sent over mbus.
telegram=|68464668084a72447744772d2c3404060000000406ce86000004ff073444020004ff08f8ce0100041411680300043B0f02000002593c19025da41104ff220000000004a5ff21c7d02700d916|
{"forward_energy_m3c": 148532,"id": "77447744","media": "heat","meter": "kamheat","name": "MyKamHeat","return_energy_m3c": 118520,"status": "OK","t1_temperature_c": 64.6,"t2_temperature_c": 45.16,"timestamp": "1111-11-11T11:11:11Z","total_energy_consumption_kwh": 34510,"total_volume_m3": 2232.49,"volume_flow_m3h": 0.527 }

Wyświetl plik

@ -4802,6 +4802,11 @@ FrameStatus checkWMBusFrame(vector<uchar> &data,
int type = data[1];
int offset = 1;
if (data[0] == 0x68 && data[3] == 0x68 && data[1] == data[2])
{
// Ooups this is not a wmbus frame. Its clearly an mbus frame.
return PartialFrame;
}
if (!isValidWMBusCField(type))
{
// Ouch, we are out of sync with the wmbus frames that we expect!

Wyświetl plik

@ -13,6 +13,7 @@ cat simulations/simulation_mbus.txt | grep '^{' | jq --sort-keys . > $TEST/test_
$PROG --format=json simulations/simulation_mbus.txt \
MyUltra ultraheat 70444600 NOKEY \
MySenso sensostar 10484075 NOKEY \
MyKamHeat kamheat 77447744 NOKEY \
2> $TEST/test_stderr.txt | jq --sort-keys . > $TEST/test_output.txt
if [ "$?" = "0" ]