mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-07-06 01:41:42 +02:00
more const cleaning
This commit is contained in:
+4
-4
@@ -116,7 +116,7 @@ namespace BME_Utils {
|
||||
}
|
||||
}
|
||||
|
||||
String generateTempString(float bmeTemp) {
|
||||
const String generateTempString(const float bmeTemp) {
|
||||
String strTemp;
|
||||
strTemp = String((int)bmeTemp);
|
||||
switch (strTemp.length()) {
|
||||
@@ -131,7 +131,7 @@ namespace BME_Utils {
|
||||
}
|
||||
}
|
||||
|
||||
String generateHumString(float bmeHum) {
|
||||
const String generateHumString(const float bmeHum) {
|
||||
String strHum;
|
||||
strHum = String((int)bmeHum);
|
||||
switch (strHum.length()) {
|
||||
@@ -150,7 +150,7 @@ namespace BME_Utils {
|
||||
}
|
||||
}
|
||||
|
||||
String generatePresString(float bmePress) {
|
||||
const String generatePresString(const float bmePress) {
|
||||
String strPress = String((int)bmePress);
|
||||
String decPress = String(int((bmePress - int(bmePress)) * 10));
|
||||
switch (strPress.length()) {
|
||||
@@ -169,7 +169,7 @@ namespace BME_Utils {
|
||||
}
|
||||
}
|
||||
|
||||
String readDataSensor() {
|
||||
const String readDataSensor() {
|
||||
String wx, tempStr, humStr, presStr;
|
||||
switch (wxModuleType) {
|
||||
case 1: // BME280
|
||||
|
||||
+6
-6
@@ -10,12 +10,12 @@
|
||||
|
||||
namespace BME_Utils {
|
||||
|
||||
void getWxModuleAddres();
|
||||
void setup();
|
||||
String generateTempString(float bmeTemp);
|
||||
String generateHumString(float bmeHum);
|
||||
String generatePresString(float bmePress);
|
||||
String readDataSensor();
|
||||
void getWxModuleAddres();
|
||||
void setup();
|
||||
const String generateTempString(const float bmeTemp);
|
||||
const String generateHumString(const float bmeHum);
|
||||
const String generatePresString(const float bmePress);
|
||||
const String readDataSensor();
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ namespace LoRa_Utils {
|
||||
}
|
||||
}
|
||||
|
||||
String packetSanitization(const String& packet) {
|
||||
/*String packetSanitization(const String& packet) {
|
||||
String sanitizedPacket = packet;
|
||||
if (packet.indexOf("\0") > 0) {
|
||||
sanitizedPacket.replace("\0", "");
|
||||
@@ -146,7 +146,7 @@ namespace LoRa_Utils {
|
||||
sanitizedPacket.replace("\n", "");
|
||||
}
|
||||
return sanitizedPacket;
|
||||
}
|
||||
}*/
|
||||
|
||||
void startReceive() {
|
||||
radio.startReceive();
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace LoRa_Utils {
|
||||
|
||||
void setup();
|
||||
void sendNewPacket(const String& newPacket);
|
||||
String packetSanitization(const String& packet);
|
||||
//String packetSanitization(const String& packet);
|
||||
String receivePacket();
|
||||
void changeFreqTx();
|
||||
void changeFreqRx();
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ extern int freqError;
|
||||
|
||||
namespace QUERY_Utils {
|
||||
|
||||
String process(const String& query, const String& station, uint8_t queryOrigin) {
|
||||
String process(const String& query, const String& station, const uint8_t queryOrigin) {
|
||||
String answer;
|
||||
if (query=="?APRS?" || query=="?aprs?" || query=="?Aprs?" || query=="H" || query=="h" || query=="HELP" || query=="Help" || query=="help" || query=="?") {
|
||||
answer = "?APRSV ?APRSP ?APRSL ?APRSH ?WHERE callsign";
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace QUERY_Utils {
|
||||
|
||||
String process(const String& query, const String& station, uint8_t queryOrigin);
|
||||
String process(const String& query, const String& station, const uint8_t queryOrigin);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ WiFiUDP udpClient;
|
||||
|
||||
namespace SYSLOG_Utils {
|
||||
|
||||
void log(uint8_t type, const String& packet, int rssi, float snr, int freqError) {
|
||||
void log(const uint8_t type, const String& packet, const int rssi, const float snr, const int freqError) {
|
||||
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
|
||||
String syslogPacket = "<165>1 - ";
|
||||
syslogPacket.concat(Config.callsign);
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace SYSLOG_Utils {
|
||||
|
||||
void log(uint8_t type ,const String& packet, int rssi, float snr, int freqError);
|
||||
void log(const uint8_t type ,const String& packet, const int rssi, const float snr, const int freqError);
|
||||
void setup();
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ namespace Utils {
|
||||
}
|
||||
}
|
||||
|
||||
String getLocalIP() {
|
||||
const String getLocalIP() {
|
||||
if (!WiFiConnected) {
|
||||
return "IP : 192.168.4.1";
|
||||
} else if (backUpDigiMode) {
|
||||
@@ -213,7 +213,7 @@ namespace Utils {
|
||||
}
|
||||
}
|
||||
|
||||
void typeOfPacket(const String& packet, uint8_t packetType) {
|
||||
void typeOfPacket(const String& packet, const uint8_t packetType) {
|
||||
String sender = packet.substring(0,packet.indexOf(">"));
|
||||
switch (packetType) {
|
||||
case 0: // LoRa-APRS
|
||||
|
||||
+2
-2
@@ -14,13 +14,13 @@ public:
|
||||
namespace Utils {
|
||||
|
||||
void processStatus();
|
||||
String getLocalIP();
|
||||
const String getLocalIP();
|
||||
void setupDisplay();
|
||||
void activeStations();
|
||||
void checkBeaconInterval();
|
||||
void checkDisplayInterval();
|
||||
void validateFreqs();
|
||||
void typeOfPacket(const String& packet, uint8_t packetType);
|
||||
void typeOfPacket(const String& packet, const uint8_t packetType);
|
||||
void print(const String& text);
|
||||
void println(const String& text);
|
||||
void checkRebootMode();
|
||||
|
||||
Reference in New Issue
Block a user