Remote reboot capability
This commit is contained in:
@@ -41,7 +41,8 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
I_BATTERY_LEVEL, I_TIME, I_VERSION, I_ID_REQUEST, I_ID_RESPONSE,
|
I_BATTERY_LEVEL, I_TIME, I_VERSION, I_ID_REQUEST, I_ID_RESPONSE,
|
||||||
I_INCLUSION_MODE, I_CONFIG, I_PING, I_PING_ACK,
|
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;
|
} internal;
|
||||||
|
|
||||||
// Type of sensor (for presentation message)
|
// Type of sensor (for presentation message)
|
||||||
|
|||||||
@@ -326,6 +326,10 @@ boolean MySensor::process() {
|
|||||||
bool isMetric;
|
bool isMetric;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case I_REBOOT:
|
||||||
|
wdt_enable(WDTO_15MS);
|
||||||
|
for (;;);
|
||||||
|
break;
|
||||||
case I_ID_RESPONSE:
|
case I_ID_RESPONSE:
|
||||||
if (nc.nodeId == AUTO) {
|
if (nc.nodeId == AUTO) {
|
||||||
nc.nodeId = msg.getByte();
|
nc.nodeId = msg.getByte();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <avr/eeprom.h>
|
#include <avr/eeprom.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "utility/LowPower.h"
|
#include "utility/LowPower.h"
|
||||||
#include "utility/RF24.h"
|
#include "utility/RF24.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user