RxPacket freeze fix

This commit is contained in:
richonguzman 2024-10-14 12:49:01 -03:00
parent 55378bb9f3
commit c0641986aa
2 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@
<div class="container d-none" id="received-packets">
<div class="row my-5 d-flex align-items-top">
<div class="col-12">
<h3>Last 20 received packets list</h3>
<h3>Last 10 received packets list</h3>
<table class="table mt-4">
<thead>
<tr>

View File

@ -177,14 +177,14 @@ namespace LoRa_Utils {
Utils::println("(RSSI:" + String(rssi) + " / SNR:" + String(snr) + " / FreqErr:" + String(freqError) + ")");
if (!Config.lowPowerMode && !Config.digi.ecoMode) {
if (receivedPackets.size() >= 10) {
receivedPackets.erase(receivedPackets.begin());
}
ReceivedPacket receivedPacket;
receivedPacket.rxTime = NTP_Utils::getFormatedTime();
receivedPacket.packet = packet.substring(3);
receivedPacket.RSSI = rssi;
receivedPacket.SNR = snr;
if (receivedPackets.size() >= 20) {
receivedPackets.erase(receivedPackets.begin());
}
receivedPackets.push_back(receivedPacket);
}