Skip to content

Commit

Permalink
Bugfix for various value types
Browse files Browse the repository at this point in the history
  • Loading branch information
fredlcore committed Nov 12, 2024
1 parent 4b784a0 commit 447850d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions BSB_LAN/BSB_LAN_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,11 @@ const units optbl[]={
{VT_UINT2_N, 5.0, 6, 2, DT_VALS, 1, U_NONE, sizeof(U_NONE), STR_UINT2},
{VT_UINT5, 0.2, 1, 2, DT_VALS, 0, U_NONE, sizeof(U_NONE), STR_UINT5},
{VT_UINT10, 10.0, 6, 2, DT_VALS, 1, U_NONE, sizeof(U_NONE), STR_UINT10},
{VT_UINT100_WORD, 100.0, 1, 4, DT_VALS, 2, U_NONE, sizeof(U_NONE), STR_UINT100},
{VT_UINT100_WORD_N, 100.0, 6, 4, DT_VALS, 2, U_NONE, sizeof(U_NONE), STR_UINT100},
{VT_AMP, 100.0, 1, 4, DT_VALS, 2, U_AMP, sizeof(U_AMP), STR_AMP},
{VT_AMP_N, 100.0, 6, 4, DT_VALS, 2, U_AMP, sizeof(U_AMP), STR_AMP},
{VT_CONSUMPTION, 100, 1, 4, DT_VALS, 3, U_M3H, sizeof(U_M3H), STR_M3H},
{VT_UINT100_WORD, 100.0, 1, 2, DT_VALS, 2, U_NONE, sizeof(U_NONE), STR_UINT100},
{VT_UINT100_WORD_N, 100.0, 6, 2, DT_VALS, 2, U_NONE, sizeof(U_NONE), STR_UINT100},
{VT_AMP, 100.0, 1, 2, DT_VALS, 2, U_AMP, sizeof(U_AMP), STR_AMP},
{VT_AMP_N, 100.0, 6, 2, DT_VALS, 2, U_AMP, sizeof(U_AMP), STR_AMP},
{VT_CONSUMPTION, 100.0, 1, 2, DT_VALS, 3, U_M3H, sizeof(U_M3H), STR_M3H},
{VT_SINT, 1.0, 6, 2, DT_VALS, 0, U_NONE, sizeof(U_NONE), STR_SINT},
{VT_SINT_NN, 1.0, 1, 2, DT_VALS, 0, U_NONE, sizeof(U_NONE), STR_SINT},
{VT_SINT1000, 1000, 1, 2+32, DT_VALS, 3, U_NONE, sizeof(U_NONE), STR_SINT1000},
Expand Down
25 changes: 13 additions & 12 deletions BSB_LAN/include/print_telegram.h
Original file line number Diff line number Diff line change
Expand Up @@ -980,12 +980,22 @@ void printTelegram(byte* msg, float query_line) {
case VT_MINUTES: // u32 min
case VT_HOURS: // u32 h
case VT_HOURS_N: // u32 h
case VT_SECONDS_DWORD: //u32? s
case VT_TEMP_DWORD: // u32 / 10.0 kW
case VT_ENERGY: // u32 / 1.0 kWh
case VT_ENERGY_N: // u32 / 1.0 kWh
case VT_ENERGY10: // u32 / 10.0 kWh
case VT_ENERGY10_N: // u32 / 10.0 kWh
case VT_ENERGY_MWH: //u32 / 1 MW
case VT_ENERGY_MWH_N: //u32 / 1 MW
case VT_POWER: // u32 / 10.0 kW
case VT_POWER100: //u32 / 100 kW
case VT_CUBICMETER: // u32 / 10
case VT_CUBICMETER_N: // u32 / 10
case VT_UINT100: // u32 / 100
case VT_DWORD: // s32
case VT_DWORD_N: // s32
case VT_DWORD10:
case VT_ENERGY: // u32 / 1.0 kWh
case VT_ENERGY_N: // u32 / 1.0 kWh
case VT_SECONDS_DWORD: //u32? s
printDWORD(msg,data_len,decodedTelegram.operand);
break;
case VT_SINT: // s16
Expand Down Expand Up @@ -1066,22 +1076,13 @@ void printTelegram(byte* msg, float query_line) {
case VT_PERCENT_WORD1: // u16 %
case VT_PERCENT_WORD: // u16 / 2 %
case VT_PERCENT_100: // u16 / 100 %
case VT_POWER100: //u32 / 100 kW
case VT_ENERGY_MWH: //u32 / 1 MW
case VT_SINT1000: // s16 / 1000
case VT_UINT100: // u32 / 100
case VT_UINT100_WORD: // u16 / 100
case VT_UINT100_WORD_N: // u16 / 100
case VT_UINT2_N: // u16 / 5
case VT_UINT5: // u16 * 5
case VT_UINT10: // u16 / 10
case VT_CUBICMETER: // u32 / 10
case VT_CUBICMETER_N: // u32 / 10
case VT_POWER: // u32 / 10.0 kW
case VT_TEMP_DWORD: // u32 / 10.0 kW
case VT_AMP:
case VT_ENERGY10: // u32 / 10.0 kWh
case VT_ENERGY10_N: // u32 / 10.0 kWh
printFIXPOINT(msg,data_len,decodedTelegram.operand,decodedTelegram.precision);
break;
case VT_BINARY_ENUM:
Expand Down

0 comments on commit 447850d

Please sign in to comment.