kopia lustrzana https://github.com/sh123/esp32_loraprs
Update CSMA logic to take SlotTime into account
rodzic
6e3c25bf29
commit
a33ff5cd30
|
@ -148,7 +148,7 @@ void Service::loop()
|
|||
onLoraDataAvailable(packetSize);
|
||||
}
|
||||
// TX path
|
||||
else if (random(0, 255) < CfgCsmaProbBoundary) {
|
||||
else if (random(0, 255) < CfgCsmaPersistence) {
|
||||
if (serialBt_.available()) {
|
||||
onBtDataAvailable();
|
||||
}
|
||||
|
@ -159,6 +159,9 @@ void Service::loop()
|
|||
sendPeriodicBeacon();
|
||||
}
|
||||
}
|
||||
else {
|
||||
delay(CfgCsmaSlotTimeMs);
|
||||
}
|
||||
delay(CfgPollDelayMs);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,11 +66,11 @@ private:
|
|||
|
||||
const String CfgLoraprsVersion = "LoRAPRS 0.1";
|
||||
|
||||
// tune depending on TOA, higher value for higher time on air
|
||||
const int CfgPollDelayMs = 500;
|
||||
const int CfgPollDelayMs = 10;
|
||||
|
||||
// tx when lower than this value from random 0..255, use lower value for high traffic
|
||||
const long CfgCsmaProbBoundary = 100;
|
||||
const long CfgCsmaPersistence = 100;
|
||||
const long CfgCsmaSlotTimeMs = 500;
|
||||
|
||||
const byte CfgPinSs = 5;
|
||||
const byte CfgPinRst = 26;
|
||||
|
|
Ładowanie…
Reference in New Issue