diff --git a/gateway/include/Dht.h b/gateway/include/Dht.h index 6432e3e..81aafb9 100644 --- a/gateway/include/Dht.h +++ b/gateway/include/Dht.h @@ -1,5 +1,6 @@ #if DHT_SENSOR +#include #include #define DHT11_PIN 12 diff --git a/gateway/include/Protocol.h b/gateway/include/Protocol.h index 09ab9fb..c5af972 100644 --- a/gateway/include/Protocol.h +++ b/gateway/include/Protocol.h @@ -3,7 +3,7 @@ #include class Protocol { -private: + unsigned int protocol; public: diff --git a/gateway/src/gateway.cpp b/gateway/src/gateway.cpp index 55a65af..56ba21e 100644 --- a/gateway/src/gateway.cpp +++ b/gateway/src/gateway.cpp @@ -1,8 +1,5 @@ #include #include -#include -#include "Tiny.h" -#include #include "Dht.h" #include "Protocol_1.h" #include "Protocol_2.h" @@ -14,9 +11,6 @@ RCSwitch mySwitch = RCSwitch(); -void readRcSwitch(); -void readCommand(); - void setup() { digitalWrite(RESET_PIN, HIGH); pinMode(LED_BUILTIN, OUTPUT); @@ -33,12 +27,6 @@ void setup() { delay(1000); } -void loop() { - readCommand(); - readRcSwitch(); - Dht::read(); -} - Protocol findProtocol(unsigned int protocol) { switch (mySwitch.getReceivedProtocol()) { case 1: @@ -107,3 +95,9 @@ void readCommand() { runJsonCommands(cmd.c_str()); } } + +void loop() { + readCommand(); + readRcSwitch(); + Dht::read(); +}