Fix bug making gateway sending all payloads with newline character included. Fix bug related to receiving Mertic/Imperial setting in sensor nodes (getByte was implemented wrong).

This commit is contained in:
Henrik Ekblad
2014-09-07 20:39:28 +02:00
parent 612ab5ea59
commit cfbceadea9
2 changed files with 3 additions and 8 deletions
+2 -1
View File
@@ -169,6 +169,8 @@ void MyGateway::parseAndSend(char *commandBuffer) {
}
} else {
value = str;
// Remove newline character
value[strlen(value)-1] = 0;
}
break;
}
@@ -193,7 +195,6 @@ void MyGateway::parseAndSend(char *commandBuffer) {
mSetCommand(msg,command);
mSetRequestAck(msg,ack?1:0);
mSetAck(msg,false);
msg.set(value);
if (command == C_STREAM)
msg.set(bvalue, blen);
else
+1 -7
View File
@@ -87,13 +87,7 @@ char* MyMessage::getString(char *buffer) const {
}
uint8_t MyMessage::getByte() const {
if (miGetPayloadType() == P_BYTE) {
return data[0];
} else if (miGetPayloadType() == P_STRING) {
return atoi(data);
} else {
return 0;
}
return data[0];
}
bool MyMessage::getBool() const {