Skip to content

Commit

Permalink
Revert "Try and fix problems raised in Issue#46"
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz authored Oct 8, 2023
1 parent 9e9cb91 commit 60f993d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sensor/src/sensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ void handleBytes(size_t len, uint8_t buf[]) {
}
result += String(buf[i], HEX);
}
if (msgLength == 0 && result.length() >= 2) {
if (msgLength == 0 && result.length() == 2) {
String messageType = result.substring(0, 2);
if (messageType == "fa") {
msgLength = 46;
Expand All @@ -547,8 +547,8 @@ void handleBytes(size_t len, uint8_t buf[]) {
Serial.print("Unknown message length for ");
Serial.println(messageType);
}
} else if (result.length() >= msgLength) { // Shouldn't really be longer, but we might have been slow reading before pin5 HIGH
if (msgLength == 46) {
} else if (result.length() == msgLength) {
if (result.length() == 46) {
sendCommand(); // send reply *before* we parse the FA string as we don't want to delay the reply by
// say sending MQTT updates
}
Expand Down

0 comments on commit 60f993d

Please sign in to comment.