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);
|
onLoraDataAvailable(packetSize);
|
||||||
}
|
}
|
||||||
// TX path
|
// TX path
|
||||||
else if (random(0, 255) < CfgCsmaProbBoundary) {
|
else if (random(0, 255) < CfgCsmaPersistence) {
|
||||||
if (serialBt_.available()) {
|
if (serialBt_.available()) {
|
||||||
onBtDataAvailable();
|
onBtDataAvailable();
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,9 @@ void Service::loop()
|
||||||
sendPeriodicBeacon();
|
sendPeriodicBeacon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
delay(CfgCsmaSlotTimeMs);
|
||||||
|
}
|
||||||
delay(CfgPollDelayMs);
|
delay(CfgPollDelayMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,11 +66,11 @@ private:
|
||||||
|
|
||||||
const String CfgLoraprsVersion = "LoRAPRS 0.1";
|
const String CfgLoraprsVersion = "LoRAPRS 0.1";
|
||||||
|
|
||||||
// tune depending on TOA, higher value for higher time on air
|
const int CfgPollDelayMs = 10;
|
||||||
const int CfgPollDelayMs = 500;
|
|
||||||
|
|
||||||
// tx when lower than this value from random 0..255, use lower value for high traffic
|
// 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 CfgPinSs = 5;
|
||||||
const byte CfgPinRst = 26;
|
const byte CfgPinRst = 26;
|
||||||
|
|
Ładowanie…
Reference in New Issue