Remote reboot capability

This commit is contained in:
ToSa27
2014-07-24 13:31:00 +02:00
parent 10e2d31a2f
commit 6aa321cf2e
3 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -41,7 +41,8 @@ typedef enum {
typedef enum {
I_BATTERY_LEVEL, I_TIME, I_VERSION, I_ID_REQUEST, I_ID_RESPONSE,
I_INCLUSION_MODE, I_CONFIG, I_PING, I_PING_ACK,
I_LOG_MESSAGE, I_CHILDREN, I_SKETCH_NAME, I_SKETCH_VERSION
I_LOG_MESSAGE, I_CHILDREN, I_SKETCH_NAME, I_SKETCH_VERSION,
I_REBOOT
} internal;
// Type of sensor (for presentation message)
+4
View File
@@ -326,6 +326,10 @@ boolean MySensor::process() {
bool isMetric;
switch (type) {
case I_REBOOT:
wdt_enable(WDTO_15MS);
for (;;);
break;
case I_ID_RESPONSE:
if (nc.nodeId == AUTO) {
nc.nodeId = msg.getByte();
+1
View File
@@ -20,6 +20,7 @@
#include <SPI.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include <avr/wdt.h>
#include <stdarg.h>
#include "utility/LowPower.h"
#include "utility/RF24.h"