Add small delay before constructing packet

pull/15/head
sh123 2021-01-29 15:16:41 +02:00
rodzic 30601b75e8
commit a69a9d1416
2 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -75,7 +75,7 @@ void Service::setupWifi(const String &wifiName, const String &wifiKey)
WiFi.begin(wifiName.c_str(), wifiKey.c_str());
while (WiFi.status() != WL_CONNECTED) {
delay(500);
delay(CfgConnRetryMs);
Serial.print(".");
}
Serial.println("ok");
@ -89,7 +89,7 @@ void Service::reconnectWifi()
while (WiFi.status() != WL_CONNECTED || WiFi.localIP() == IPAddress(0,0,0,0)) {
WiFi.reconnect();
delay(500);
delay(CfgConnRetryMs);
Serial.print(".");
}
@ -118,7 +118,7 @@ void Service::setupLora(int loraFreq, int bw, byte sf, byte cr, byte pwr, byte s
while (!LoRa.begin(loraFreq)) {
Serial.print(".");
delay(500);
delay(CfgConnRetryMs);
}
LoRa.setSyncWord(sync);
LoRa.setSpreadingFactor(sf);
@ -342,6 +342,7 @@ void Service::processTx()
}
}
}
yield();
}
}
@ -355,6 +356,7 @@ bool Service::kissProcessCommand(unsigned char rxByte) {
switch (rxByte) {
case KissCmd::Data:
delay(CfgPollDelayMs); // LoRa may drop packet if removed
if (LoRa.beginPacket() == 0) return false;
kissState_ = KissState::GetData;
break;

Wyświetl plik

@ -74,6 +74,7 @@ private:
const String CfgLoraprsVersion = "LoRAPRS 0.1";
const int CfgConnRetryMs = 500;
const int CfgPollDelayMs = 5;
const int CfgLoraTxQueueSize = 1024;