Skip to content

Commit

Permalink
Fix developed by Matthias Behr
Browse files Browse the repository at this point in the history
  • Loading branch information
narc-Ontakac2 committed Jun 29, 2024
1 parent 25f9ab3 commit 81c9649
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/protocols/MeterOMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ double MeterOMS::get_record_value(mbus_data_record *record) const {
t.tm_year =
100 + (((record->data[3] & 0xe0) >> 5) |
((record->data[4] & 0xf0) >> 1)); // tm_year is number of years since 1900.
t.tm_isdst = ((record->data[0] & 0x40) == 0x40) ? 1 : 0;
t.tm_isdst = -1; // We ignore data[0] & 0x40
// check for time invalid at bit 16 (1-based)
if ((record->data[1] & 0x80) == 0x80) {
// time invalid!
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ IF(GCOV_PATH AND LCOV_PATH AND GENHTML_PATH)
COMMAND vzlogger_unit_tests
COMMAND mock_metermap
COMMAND mock_MeterW1therm
COMMAND env TZ="Europe/Berlin" mock_MeterOMS
COMMAND mock_MeterOMS
COMMAND mock_MeterS0

# Capturing lcov counters and generating report
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/mock_MeterOMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ TEST(mock_MeterOMS, first_packets) {
t.tm_mday = 20;
t.tm_mon = 6 - 1;
t.tm_year = 2015 - 1900;
t.tm_isdst = 1;
t.tm_isdst = -1;
ASSERT_EQ(rds[7].time_s(), mktime(&t));
}

Expand Down

0 comments on commit 81c9649

Please sign in to comment.