Update CSMA logic

pull/15/head
sh123 2020-12-08 15:26:14 +02:00
rodzic 0ee6fa034d
commit 79acf18f98
2 zmienionych plików z 15 dodań i 13 usunięć

Wyświetl plik

@ -148,7 +148,8 @@ void Service::loop()
onLoraDataAvailable(packetSize); onLoraDataAvailable(packetSize);
} }
// TX path // TX path
else if (random(0, 255) < CfgCsmaPersistence) { else {
if (random(0, 255) < CfgCsmaPersistence) {
if (serialBt_.available()) { if (serialBt_.available()) {
onBtDataAvailable(); onBtDataAvailable();
} }
@ -162,6 +163,7 @@ void Service::loop()
else { else {
delay(CfgCsmaSlotTimeMs); delay(CfgCsmaSlotTimeMs);
} }
}
delay(CfgPollDelayMs); delay(CfgPollDelayMs);
} }

Wyświetl plik

@ -66,7 +66,7 @@ private:
const String CfgLoraprsVersion = "LoRAPRS 0.1"; const String CfgLoraprsVersion = "LoRAPRS 0.1";
const int CfgPollDelayMs = 10; const int CfgPollDelayMs = 1;
// tx when lower than this value from random 0..255 // tx when lower than this value from random 0..255
// use lower value for high traffic, use 255 for real time // use lower value for high traffic, use 255 for real time