Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
fredlcore committed Jan 4, 2025
1 parent 194d825 commit 60bcd64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void connectToMaxCul();
void SetDevId();
void mqtt_callback(char* topic, byte* payload, unsigned int length); //Luposoft: predefintion
void mqtt_sendtoBroker(parameter param);
uint32_t printKat(uint8_t cat, int print_val, boolean debug_output=true);
uint16_t printKat(uint8_t cat, int print_val, boolean debug_output=true);

#include "src/Base64/src/Base64.h"

Expand Down Expand Up @@ -5827,9 +5827,9 @@ next_parameter:
if (p[2]=='K' && !isdigit(p[4])) {
bool notfirst = false;
for (uint cat=0;cat<CAT_UNKNOWN;cat++) {
uint32_t cat_dev_fam_var = printKat(cat,1);
uint16_t cat_dev_fam = cat_dev_fam_var >> 8;
uint16_t cat_dev_var = cat_dev_fam_var & 0xFF;
uint16_t cat_dev_fam_var = printKat(cat,1);
uint8_t cat_dev_fam = cat_dev_fam_var >> 8;
uint8_t cat_dev_var = cat_dev_fam_var & 0xFF;
writelnToDebug();
if ((bus->getBusType() != BUS_PPS && decodedTelegram.error != 258) || (bus->getBusType() == BUS_PPS && (cat == CAT_PPS || cat == CAT_USERSENSORS))) {
if (notfirst) {printToWebClient(",\r\n");} else {notfirst = true;}
Expand Down Expand Up @@ -5893,9 +5893,9 @@ next_parameter:
cmd = active_cmdtbl[i_line].cmd;
if (cat_dev_id < 0) {
uint8_t cat = atoi(&p[4]);
uint32_t cat_dev_fam_var = printKat(cat,1);
uint16_t cat_dev_fam = cat_dev_fam_var >> 8;
uint16_t cat_dev_var = cat_dev_fam_var & 0xFF;
uint16_t cat_dev_fam_var = printKat(cat,1);
uint8_t cat_dev_fam = cat_dev_fam_var >> 8;
uint8_t cat_dev_var = cat_dev_fam_var & 0xFF;
for (uint x=0; x < sizeof(dev_lookup)/sizeof(dev_lookup[0]); x++) {
if (dev_lookup[x].dev_fam == cat_dev_fam && dev_lookup[x].dev_var == cat_dev_var) {
cat_dev_id = dev_lookup[x].dev_id;
Expand Down
3 changes: 2 additions & 1 deletion BSB_LAN/include/print_telegram.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void printENUM(uint_farptr_t enumstr,uint16_t enumstr_len,uint16_t search_val, i
}
}

uint32_t printKat(uint8_t cat, int print_val, boolean debug_output) {
uint16_t printKat(uint8_t cat, int print_val, boolean debug_output) {
const char* enumstr = ENUM_CAT;
const uint16_t enumstr_len = sizeof(ENUM_CAT);
uint8_t val = 0;
Expand Down Expand Up @@ -1063,6 +1063,7 @@ void printTelegram(byte* msg, float query_line) {
case VT_POWER_WORD: // u16 / 10.0 kW
case VT_POWER_WORD_N: // u16 / 10.0 kW
case VT_POWER_WORD100: // u16 / 100.0 kW
case VT_POWER_WORD100_N: // u16 / 100.0 kW
case VT_ENERGY_WORD: // u16 / 10.0 kWh
case VT_ENERGY_WORD_N: // u16 / 10.0 kWh
case VT_SPF: // u16 / 100
Expand Down

0 comments on commit 60bcd64

Please sign in to comment.