From 06ed73ce4b50a544fdb9ed57b6f2f12efac3ab2b Mon Sep 17 00:00:00 2001 From: fredlcore Date: Sun, 2 Feb 2025 00:22:58 +0800 Subject: [PATCH] Fixed VT_CURRENT/VT_CURRENT1000 bug --- BSB_LAN/BSB_LAN_defs.h | 2 +- BSB_LAN/include/print_telegram.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BSB_LAN/BSB_LAN_defs.h b/BSB_LAN/BSB_LAN_defs.h index 7ef33371..9ec5b444 100644 --- a/BSB_LAN/BSB_LAN_defs.h +++ b/BSB_LAN/BSB_LAN_defs.h @@ -752,7 +752,7 @@ const units optbl[]={ {VT_POWER_SHORT, 1.0, 1, 2, DT_VALS, 0, U_WATT, sizeof(U_WATT), STR_POWER_SHORT}, {VT_POWER_SHORT_N, 1.0, 6, 2, DT_VALS, 0, U_WATT, sizeof(U_WATT), STR_POWER_SHORT}, {VT_SPF, 100.0, 0, 2, DT_VALS, 2, U_NONE, sizeof(U_NONE), STR_SPF}, -{VT_CURRENT, 100.0, 0, 2, DT_VALS, 2, U_CURR, sizeof(U_CURR), STR_CURRENT}, +{VT_CURRENT, 1000.0, 0, 2, DT_VALS, 2, U_CURR, sizeof(U_CURR), STR_CURRENT}, {VT_CURRENT1000, 1000.0, 0, 2, DT_VALS, 2, U_CURR, sizeof(U_CURR), STR_CURRENT1000}, {VT_DAYS_WORD, 1.0, 1, 2, DT_VALS, 0, U_DAYS, sizeof(U_DAYS), STR_DAYS_WORD}, {VT_ERRORCODE, 1.0, 0, 0, DT_ENUM, 0, U_NONE, sizeof(U_NONE), STR_ERRORCODE}, diff --git a/BSB_LAN/include/print_telegram.h b/BSB_LAN/include/print_telegram.h index 7fbc7b03..693ca03e 100644 --- a/BSB_LAN/include/print_telegram.h +++ b/BSB_LAN/include/print_telegram.h @@ -1076,7 +1076,7 @@ void printTelegram(byte* msg, float query_line) { case VT_ENERGY_WORD_N: // u16 / 10.0 kWh case VT_SPF: // u16 / 100 case VT_ENERGY_CONTENT: // u16 / 10.0 kWh/m³ - case VT_CURRENT: // u16 / 100 uA + case VT_CURRENT: // u16 / 100 uA // actually, there doesn't seem to be a divisor of 100, but rather 1000. So VT_CURRENT and VT_CURRENT1000 should be the same. Both are kept for compatibility reasons with older parameter files case VT_CURRENT1000: case VT_PROPVAL: // u16 / 16 case VT_SPEED: // u16