more const cleaning

This commit is contained in:
richonguzman
2024-06-05 23:49:16 -04:00
parent 18de124c04
commit c89ca7316f
10 changed files with 21 additions and 21 deletions
+4 -4
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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();