Skip to content

Commit

Permalink
URL-command R also for non-default destination devices
Browse files Browse the repository at this point in the history
  • Loading branch information
fredlcore committed Dec 13, 2024
1 parent b3a9c56 commit 088a00c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5073,7 +5073,18 @@ void loop() {
// query reset value
if (p[1]=='R') {
webPrintHeader();
if (!queryDefaultValue(atof(&p[2]), msg, tx_msg)) {

uint8_t destAddr = bus->getBusDest();
uint8_t save_my_dev_fam = my_dev_fam;
uint8_t save_my_dev_var = my_dev_var;
uint32_t save_my_dev_serial = my_dev_serial;
parameter param = parsingStringToParameter(&p[2]);
float line = param.number;
if (param.dest_addr > -1) {
set_temp_destination(param.dest_addr);
}

if (!queryDefaultValue(line, msg, tx_msg)) {
if (decodedTelegram.error == 258) {
printToWebClient(MENU_TEXT_ER6 "\r\n");
} else if (decodedTelegram.error == 261) {
Expand All @@ -5088,6 +5099,14 @@ void loop() {
printToWebClient("<br>");
}
}

if (bus->getBusDest() != destAddr) {
return_to_default_destination(destAddr);
my_dev_fam = save_my_dev_fam;
my_dev_var = save_my_dev_var;
my_dev_serial = save_my_dev_serial;
}

webPrintFooter();
break;
}
Expand Down

0 comments on commit 088a00c

Please sign in to comment.