-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
szczepan lib
- Loading branch information
Showing
19 changed files
with
387 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Based on: https://github.com/weetmuts/wmbusmeters/blob/master/src/driver_apatoreitn.cc | ||
Copyright (C) 2019-2022 Fredrik Öhrström (gpl-3.0-or-later) | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "driver.h" | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
struct ApatorEITN: Driver | ||
{ | ||
ApatorEITN() : Driver(std::string("apatoreitn")) {}; | ||
bool get_value(std::vector<unsigned char> &telegram, float ¤t_hca) override { | ||
bool ret_val = true; | ||
size_t i = 11; | ||
|
||
current_hca = (((uint32_t)telegram[i+8] << 8) + (uint32_t)telegram[i+7]); | ||
|
||
return ret_val; | ||
}; | ||
|
||
private: | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Based on: https://github.com/weetmuts/wmbusmeters/blob/master/src/driver_fhkvdataiii.cc | ||
Copyright (C) 2019-2022 Fredrik Öhrström (gpl-3.0-or-later) | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "driver.h" | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
struct FhkvdataIII: Driver | ||
{ | ||
FhkvdataIII() : Driver(std::string("fhkvdataiii")) {}; | ||
bool get_value(std::vector<unsigned char> &telegram, float ¤t_hca) override { | ||
bool ret_val = true; | ||
size_t i = 11; | ||
|
||
current_hca = (((uint32_t)telegram[i+8] << 8) + (uint32_t)telegram[i+7]); | ||
|
||
return ret_val; | ||
}; | ||
|
||
private: | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Based on: https://github.com/weetmuts/wmbusmeters/blob/master/src/driver_itron.cc | ||
Copyright (C) 2017-2022 Fredrik Öhrström (gpl-3.0-or-later) | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "driver.h" | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
struct Itron: Driver | ||
{ | ||
Itron() : Driver(std::string("itron")) {}; | ||
bool get_value(std::vector<unsigned char> &telegram, float &water_usage) override { | ||
bool ret_val = false; | ||
uint32_t usage = 0; | ||
size_t i = 15; | ||
uint32_t total_register = 0x0413; | ||
while (i < telegram.size()) { | ||
uint32_t c = (((uint32_t)telegram[i+0] << 8) | ((uint32_t)telegram[i+1])); | ||
if (c == total_register) { | ||
i += 2; | ||
usage = ((uint32_t)telegram[i+3] << 24) | ((uint32_t)telegram[i+2] << 16) | | ||
((uint32_t)telegram[i+1] << 8) | ((uint32_t)telegram[i+0]); | ||
water_usage = usage / 1000.0; | ||
ret_val = true; | ||
break; | ||
} | ||
i++; | ||
} | ||
return ret_val; | ||
}; | ||
|
||
private: | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
Based on: https://github.com/weetmuts/wmbusmeters/blob/master/src/driver_mkradio4.cc | ||
Copyright (C) 2019-2023 Fredrik Öhrström (gpl-3.0-or-later) | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "driver.h" | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
struct Mkradio4: Driver | ||
{ | ||
Mkradio4() : Driver(std::string("mkradio4")) {}; | ||
bool get_value(std::vector<unsigned char> &telegram, float &water_usage) override { | ||
bool ret_val = true; | ||
size_t i = 11; | ||
|
||
water_usage = ((((uint32_t)telegram[i+4] << 8) + (uint32_t)telegram[i+3]) / 10.0) + | ||
((((uint32_t)telegram[i+8] << 8) + (uint32_t)telegram[i+7]) / 10.0); | ||
|
||
return ret_val; | ||
}; | ||
|
||
private: | ||
|
||
}; |
Oops, something went wrong.