kopia lustrzana https://github.com/sh123/esp32_loraprs
Update CSMA logic
rodzic
0ee6fa034d
commit
79acf18f98
|
@ -148,19 +148,21 @@ void Service::loop()
|
||||||
onLoraDataAvailable(packetSize);
|
onLoraDataAvailable(packetSize);
|
||||||
}
|
}
|
||||||
// TX path
|
// TX path
|
||||||
else if (random(0, 255) < CfgCsmaPersistence) {
|
|
||||||
if (serialBt_.available()) {
|
|
||||||
onBtDataAvailable();
|
|
||||||
}
|
|
||||||
else if (aprsisConn_.available() > 0) {
|
|
||||||
onAprsisDataAvailable();
|
|
||||||
}
|
|
||||||
else if (needsBeacon()) {
|
|
||||||
sendPeriodicBeacon();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
delay(CfgCsmaSlotTimeMs);
|
if (random(0, 255) < CfgCsmaPersistence) {
|
||||||
|
if (serialBt_.available()) {
|
||||||
|
onBtDataAvailable();
|
||||||
|
}
|
||||||
|
else if (aprsisConn_.available() > 0) {
|
||||||
|
onAprsisDataAvailable();
|
||||||
|
}
|
||||||
|
else if (needsBeacon()) {
|
||||||
|
sendPeriodicBeacon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delay(CfgCsmaSlotTimeMs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delay(CfgPollDelayMs);
|
delay(CfgPollDelayMs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Ładowanie…
Reference in New Issue