Fix another problem related to config from controller (reading wrong position at startup!). Bugfix. Only strip carriage return on serial data from controller (at gateway)

This commit is contained in:
Henrik Ekblad
2014-09-08 19:56:09 +02:00
parent bf341ab49c
commit 9192da3a7d
3 changed files with 16 additions and 8 deletions
+4 -2
View File
@@ -169,8 +169,10 @@ void MyGateway::parseAndSend(char *commandBuffer) {
}
} else {
value = str;
// Remove newline character
value[strlen(value)-1] = 0;
// Remove ending carriage return character (if it exists)
uint8_t lastCharacter = strlen(value)-1;
if (value[lastCharacter] == '\r')
value[lastCharacter] = 0;
}
break;
}