Skip to content

Commit

Permalink
Fix #1037: decoded TXPower has incorrect value (#1043)
Browse files Browse the repository at this point in the history
* Fix #1037: decoded TXPower has incorrect value

* [#1037] Update unit-tests
  • Loading branch information
TheSomeMan authored May 6, 2024
1 parent feba5cc commit 4583897
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main/adv_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ JSON_STREAM_GEN_DECL_GENERATOR_SUB_FUNC(
JSON_STREAM_GEN_ADD_FLOAT_LIMITED_FIXED_POINT(
p_gen,
"txPower",
RE_5_TXPWR_MIN + (data.tx_power * 2),
data.tx_power,
JSON_STREAM_GEN_NUM_DECIMALS_FLOAT_0);
JSON_STREAM_GEN_ADD_INT32(p_gen, "measurementSequenceNumber", data.measurement_count);
mac_address_bin_t tag_mac = { 0 };
Expand Down
4 changes: 2 additions & 2 deletions tests/test_http_json/test_http_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ TEST_F(TestHttpJson, test_1_with_raw_and_decoded) // NOLINT
" \"accelZ\": 0.996,\n"
" \"movementCounter\": 232,\n"
" \"voltage\": 3.048,\n"
" \"txPower\": -32,\n"
" \"txPower\": 4,\n"
" \"measurementSequenceNumber\": 19838,\n"
" \"id\": \"F4:1F:0C:28:CB:D6\"\n"
" }\n"
Expand Down Expand Up @@ -400,7 +400,7 @@ TEST_F(TestHttpJson, test_1_without_raw_and_with_decoded) // NOLINT
" \"accelZ\": 0.996,\n"
" \"movementCounter\": 232,\n"
" \"voltage\": 3.048,\n"
" \"txPower\": -32,\n"
" \"txPower\": 4,\n"
" \"measurementSequenceNumber\": 19838,\n"
" \"id\": \"F4:1F:0C:28:CB:D6\"\n"
" }\n"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_mqtt_json/test_mqtt_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ TEST_F(TestMqttJson, test_raw_and_decoded_df5) // NOLINT
"\"accelZ\":-0.008,"
"\"movementCounter\":183,"
"\"voltage\":2.784,"
"\"txPower\":-32,"
"\"txPower\":4,"
"\"measurementSequenceNumber\":38282,"
"\"id\":\"E3:75:CF:37:4E:23\","
"\"coords\":\"170.112233,59.445566\""
Expand Down Expand Up @@ -358,7 +358,7 @@ TEST_F(TestMqttJson, test_decoded_df5) // NOLINT
"\"accelZ\":-0.008,"
"\"movementCounter\":183,"
"\"voltage\":2.784,"
"\"txPower\":-32,"
"\"txPower\":4,"
"\"measurementSequenceNumber\":38282,"
"\"id\":\"E3:75:CF:37:4E:23\","
"\"coords\":\"170.112233,59.445566\""
Expand Down

0 comments on commit 4583897

Please sign in to comment.