fix presets, use new lib
This commit is contained in:
+6
-6
@@ -239,8 +239,8 @@
|
||||
<label for="lora-preset-selector">LoRa Presets</label>
|
||||
<select id="lora-preset-selector">
|
||||
<option value="long_fast">LongFast (Default)</option>
|
||||
<option value="long_moderate">LongModerate</option>
|
||||
<option value="long_slow">LongSlow</option>
|
||||
<option value="very_long_slow">VeryLongSlow</option>
|
||||
<option value="medium_slow">MediumSlow</option>
|
||||
<option value="medium_fast">MediumFast</option>
|
||||
<option value="short_slow">ShortSlow</option>
|
||||
@@ -366,11 +366,11 @@
|
||||
|
||||
const loraPresets = {
|
||||
'long_fast': { bw: 250.0, sf: 11, cr: 5 },
|
||||
'long_slow': { bw: 125.0, sf: 12, cr: 5 },
|
||||
'very_long_slow': { bw: 31.25, sf: 12, cr: 8 },
|
||||
'medium_slow': { bw: 250.0, sf: 10, cr: 8 },
|
||||
'medium_fast': { bw: 250.0, sf: 9, cr: 7 },
|
||||
'short_slow': { bw: 250.0, sf: 8, cr: 7 },
|
||||
'long_slow': { bw: 125.0, sf: 12, cr: 8 },
|
||||
'long_moderate': { bw: 125.0, sf: 11, cr: 8 },
|
||||
'medium_slow': { bw: 250.0, sf: 10, cr: 5 },
|
||||
'medium_fast': { bw: 250.0, sf: 9, cr: 5 },
|
||||
'short_slow': { bw: 250.0, sf: 8, cr: 5 },
|
||||
'short_fast': { bw: 250.0, sf: 7, cr: 5 },
|
||||
};
|
||||
|
||||
|
||||
+5
-17
@@ -3,23 +3,11 @@
|
||||
#include <iterator>
|
||||
|
||||
uint32_t TMAttack::getRandomTarget() {
|
||||
uint16_t cnt = 0; // todo handle it in lib better
|
||||
uint32_t srcnode = 0;
|
||||
do {
|
||||
cnt++;
|
||||
auto it = meshtasticCompact->nodeinfo_db.begin();
|
||||
int rnd = esp_random() % NodeInfoDB::MAX_NODES;
|
||||
for (int o = 0; o < rnd; o++) {
|
||||
if (it != meshtasticCompact->nodeinfo_db.end()) {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
if (it == meshtasticCompact->nodeinfo_db.end()) {
|
||||
return 0;
|
||||
}
|
||||
srcnode = it->node_id;
|
||||
} while (cnt < 100 && srcnode == 0);
|
||||
return srcnode;
|
||||
auto ret = meshtasticCompact->nodeinfo_db.getRandomNode();
|
||||
if (ret) {
|
||||
return ret->node_id;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TMAttack::atkRndPos() {
|
||||
|
||||
Reference in New Issue
Block a user