Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Try and fix problems raised in Issue#46" #57

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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