diff --git a/fdrs_gateway.cpp b/fdrs_gateway.cpp index 6d6a680..4895098 100644 --- a/fdrs_gateway.cpp +++ b/fdrs_gateway.cpp @@ -11,33 +11,12 @@ bool ESP_FDRSGateWay::is_init = false; std::vector ESP_FDRSGateWay::peer_list; std::vector ESP_FDRSGateWay::unknow_peer; -uint8_t newData = 0; -uint8_t ln = 0; -DataReading_t theData[256]; - -DataReadingBuffer_t MQTTbuffer; -uint32_t timeMQTT = 0; - -DataReadingBuffer_t LORAGbuffer; -uint32_t timeLORAG = 0; - -DataReadingBuffer_t LORA1buffer; -uint32_t timeLORA1 = 0; - -DataReadingBuffer_t LORA2buffer; -uint32_t timeLORA2 = 0; - // Set ESP-NOW send and receive callbacks for either ESP8266 or ESP32 void ESP_FDRSGateWay::OnDataRecv(uint8_t * mac, const uint8_t *incomingData, int len){ - DataReading_t data; - - //memcpy(&data, incomingData, sizeof(theData)); - uint32_t i = 0; - uint8_t d = len / sizeof(DataReading_t); for(i = 0; i < d; i++){ @@ -494,6 +473,8 @@ void LoRa_FDRSGateWay::get(void){ return; } + uint8_t theData[packetSize - 5]; + memcpy(&incLORAMAC, &packet[3], 2); //Split off address portion of packet memcpy(&theData, &packet[5], packetSize - 5); //Split off data portion of packet diff --git a/fdrs_types.h b/fdrs_types.h index e694314..f59c7cd 100644 --- a/fdrs_types.h +++ b/fdrs_types.h @@ -12,18 +12,6 @@ typedef struct __attribute__((packed)) DataReading_t { } } DataReading_t; - -typedef struct DataReadingBuffer_t{ - DataReading_t buffer[256]; - uint16_t len; - - DataReadingBuffer_t(){ - - } - -}DataReadingBuffer_t; - - typedef struct Peer_t{ uint8_t peer[6];