Skip to content

Commit

Permalink
Added debug info for MAX messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fredlcore committed Oct 14, 2024
1 parent 1c153dd commit 6b7da54
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6653,6 +6653,7 @@ next_parameter:
if ((c!='\n') && (c!='\r') && (max_str_index<60)) {
outBuf[max_str_index++]=c;
} else {
outBuf[max_str_index++]= '\0';
if (verbose == DEVELOPER_DEBUG) writelnToDebug();
break;
}
Expand Down Expand Up @@ -6684,6 +6685,10 @@ next_parameter:
break;
}
}
if (max_msg_type != 0x00 && known_addr == false) {
printFmtToDebug("Message from unpaired MAX device address %08lX.\r\n", max_addr);
printFmtToDebug("Raw message: %s\r\n", outBuf);
}

if (max_msg_type == 0x00) { // Device info after pressing pairing button
for (int x=0;x<10;x++) {
Expand Down Expand Up @@ -6717,11 +6722,11 @@ next_parameter:
}
}

if (max_msg_type == 0x02) {
if (max_msg_type == 0x02 && known_addr == true) {
strncpy(max_hex_str, outBuf+27, 2);
max_hex_str[2]='\0';
max_valve[max_idx] = (uint32_t)strtoul(max_hex_str,NULL,16);
printFmtToDebug("Valve position from associated thermostat received:\r\n%08lX\r\n%lu\r\n", max_addr, max_valve[max_idx]);
printFmtToDebug("Valve position from thermostat received:\r\n%08lX\r\n%lu\r\n", max_addr, max_valve[max_idx]);
}

if ((max_msg_type == 0x42 || max_msg_type == 0x60) && known_addr == true) { // Temperature from thermostats
Expand Down

0 comments on commit 6b7da54

Please sign in to comment.