Use _msgTmp when building messages

This commit is contained in:
tekka007
2016-08-08 19:49:18 +02:00
parent 2d7b1a87b8
commit 6bc4a374ed
4 changed files with 20 additions and 9 deletions
+5 -1
View File
@@ -20,7 +20,11 @@
#include "MyGatewayTransport.h"
extern bool transportSendRoute(MyMessage &message);
// global variables
extern MyMessage _msg;
extern MyMessage _msgTmp;
extern NodeConfig _nc;
inline void gatewayTransportProcess() {
@@ -41,7 +45,7 @@ inline void gatewayTransportProcess() {
if (mGetCommand(_msg) == C_INTERNAL) {
if (_msg.type == I_VERSION) {
// Request for version. Create the response
gatewayTransportSend(buildGw(_msg, I_VERSION).set(MYSENSORS_LIBRARY_VERSION));
gatewayTransportSend(buildGw(_msgTmp, I_VERSION).set(MYSENSORS_LIBRARY_VERSION));
#ifdef MY_INCLUSION_MODE_FEATURE
} else if (_msg.type == I_INCLUSION_MODE) {
// Request to change inclusion mode