TOSAs OTA bootloader, test nodejs gateway and other misc changes.

Merge commit '5968ddf21964dff4043e70df8bd65286c90b5127' into development

* commit '5968ddf21964dff4043e70df8bd65286c90b5127':
  Send reboot msg after message retrieval to deal with sensors going to sleep
  Node JS controller
  OTA Bootloader
  Binary message payload handling
  Remote reboot capability
  Misc fixes

Conflicts:
	EthernetGateway/EthernetGateway.ino
	libraries/MySensors/MyGateway.cpp
	libraries/MySensors/MyMessage.h
This commit is contained in:
Henrik Ekblad
2014-07-27 20:08:55 +02:00
45 changed files with 3004 additions and 6901 deletions
+28 -1
View File
@@ -105,10 +105,22 @@ void MyGateway::checkInclusionFinished() {
}
}
uint8_t MyGateway::h2i(char c) {
uint8_t i = 0;
if (c <= '9')
i += c - '0';
else if (c >= 'a')
i += c - 'a' + 10;
else
i += c - 'A' + 10;
return i;
}
void MyGateway::parseAndSend(char *commandBuffer) {
boolean ok = false;
char *str, *p, *value=NULL;
uint8_t bvalue[MAX_PAYLOAD];
uint8_t blen = 0;
int i = 0;
uint16_t destination = 0;
uint8_t sensor = 0;
@@ -138,7 +150,18 @@ void MyGateway::parseAndSend(char *commandBuffer) {
type = atoi(str);
break;
case 5: // Variable value
value = str;
if (command == C_STREAM) {
blen = 0;
uint8_t val;
while (*str) {
val = h2i(*str++) << 4;
val += h2i(*str++);
bvalue[blen] = val;
blen++;
}
} else {
value = str;
}
break;
}
i++;
@@ -163,6 +186,10 @@ void MyGateway::parseAndSend(char *commandBuffer) {
mSetRequestAck(msg,ack?1:0);
mSetAck(msg,false);
msg.set(value);
if (command == C_STREAM)
msg.set(bvalue, blen);
else
msg.set(value);
ok = sendRoute(msg);
if (!ok) {
errBlink(1);