mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* new RX delays based on SNR
This commit is contained in:
parent
29e62b9ce2
commit
7da0a5f7ec
13 changed files with 116 additions and 23 deletions
|
|
@ -138,6 +138,7 @@ struct NodePrefs { // persisted to file
|
|||
float freq;
|
||||
uint8_t tx_power_dbm;
|
||||
uint8_t unused[3];
|
||||
float rx_delay_base;
|
||||
};
|
||||
|
||||
class MyMesh : public mesh::Mesh {
|
||||
|
|
@ -246,6 +247,10 @@ protected:
|
|||
return _prefs.airtime_factor;
|
||||
}
|
||||
|
||||
int calcRxDelay(float score, uint32_t air_time) const override {
|
||||
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
|
||||
}
|
||||
|
||||
#if ROOM_IS_ALSO_REPEATER
|
||||
bool allowPacketForward(const mesh::Packet* packet) override {
|
||||
return true; // Yes, allow packet to be forwarded
|
||||
|
|
@ -484,6 +489,7 @@ public:
|
|||
|
||||
// defaults
|
||||
_prefs.airtime_factor = 1.0; // one half
|
||||
_prefs.rx_delay_base = 10.0;
|
||||
strncpy(_prefs.node_name, ADVERT_NAME, sizeof(_prefs.node_name)-1);
|
||||
_prefs.node_name[sizeof(_prefs.node_name)-1] = 0; // truncate if necessary
|
||||
_prefs.node_lat = ADVERT_LAT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue