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:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user