From feecc7662a4b74f7532bf9ea4fd6f32e55798346 Mon Sep 17 00:00:00 2001
From: user2684 <you@example.com>
Date: Wed, 12 Apr 2017 14:47:54 +0200
Subject: [PATCH] Send a heartbeat when waking up from a wait cycle #50

---
 NodeManager.cpp | 4 +++-
 NodeManager.h   | 2 +-
 NodeManager.ino | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/NodeManager.cpp b/NodeManager.cpp
index 7a9b56d..3c6be30 100644
--- a/NodeManager.cpp
+++ b/NodeManager.cpp
@@ -441,7 +441,7 @@ void SensorThermistor::onLoop() {
     Serial.print(F(" V="));
     Serial.print(adc);
     Serial.print(F(" T="));
-    Serial.println(temperature);
+    Serial.print(temperature);
     Serial.print(F(" M="));
     Serial.println(getControllerConfig().isMetric);
   #endif
@@ -1891,6 +1891,8 @@ void NodeManager::_sleep() {
   if (_sleep_mode == WAIT) {
     // wait for the given interval
     wait(sleep_ms);
+    // send heartbeat to the controller
+    sendHeartbeat();
   }
   else if (_sleep_mode == SLEEP) {
     // setup interrupt pins
diff --git a/NodeManager.h b/NodeManager.h
index d187a34..d469543 100644
--- a/NodeManager.h
+++ b/NodeManager.h
@@ -8,7 +8,7 @@
 #include <Arduino.h>
 
 // define NodeManager version
-#define VERSION "1.4"
+#define VERSION "1.5-dev1"
 
 /***********************************
    Constants
diff --git a/NodeManager.ino b/NodeManager.ino
index a720850..43a22e0 100644
--- a/NodeManager.ino
+++ b/NodeManager.ino
@@ -41,7 +41,7 @@ void before() {
 // presentation
 void presentation() {
   // Send the sketch version information to the gateway and Controller
-	sendSketchInfo(SKETCH_NAME,SKETCH_VERSION);
+  sendSketchInfo(SKETCH_NAME,SKETCH_VERSION);
   // call NodeManager presentation routine
   nodeManager.presentation();
 
-- 
GitLab