mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-19 19:55:09 +01:00
start
This commit is contained in:
parent
c87f0a84e1
commit
35ad116f68
30
src/station_utils.cpp
Normal file
30
src/station_utils.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "station_utils.h"
|
||||
/*#include <WiFi.h>
|
||||
#include "configuration.h"
|
||||
#include "display.h"
|
||||
|
||||
extern Configuration Config;
|
||||
extern WiFiClient espClient;
|
||||
extern int internalLedPin;
|
||||
extern uint32_t lastRxTxTime;*/
|
||||
|
||||
namespace APRS_IS_Utils {
|
||||
|
||||
|
||||
void deleteNotHeardStation() {
|
||||
uint32_t minReportingTime = 30*60*1000; // 30 minutes // from .json and CONFIGURATION?????
|
||||
for (int i=0; i<lastHeardStation.size(); i++) {
|
||||
String deltaTimeString = lastHeardStation[i].substring(lastHeardStation[i].indexOf(",")+1);
|
||||
uint32_t deltaTime = deltaTimeString.toInt();
|
||||
if ((millis() - deltaTime) < minReportingTime) {
|
||||
lastHeardStation_temp.push_back(lastHeardStation[i]);
|
||||
}
|
||||
}
|
||||
lastHeardStation.clear();
|
||||
for (int j=0; j<lastHeardStation_temp.size(); j++) {
|
||||
lastHeardStation.push_back(lastHeardStation_temp[j]);
|
||||
}
|
||||
lastHeardStation_temp.clear();
|
||||
}
|
||||
|
||||
}
|
||||
12
src/station_utils.h
Normal file
12
src/station_utils.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef STATION_UTILS_H_
|
||||
#define STATION_UTILS_H_
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
namespace STATION_Utils {
|
||||
|
||||
void deleteNotHeardStation();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue