mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* new Packet type: PAYLOAD_TYPE_TRACE
This commit is contained in:
parent
ef95462345
commit
0db15db625
9 changed files with 135 additions and 8 deletions
|
|
@ -105,7 +105,7 @@ void Dispatcher::checkRecv() {
|
|||
pkt->payload_len = len - i; // payload is remainder
|
||||
memcpy(pkt->payload, &raw[i], pkt->payload_len);
|
||||
|
||||
score = _radio->packetScore(_radio->getLastSNR(), len);
|
||||
score = _radio->packetScore(pkt->_snr = _radio->getLastSNR(), len);
|
||||
air_time = _radio->getEstAirtimeFor(len);
|
||||
}
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ void Dispatcher::checkRecv() {
|
|||
#if MESH_PACKET_LOGGING
|
||||
Serial.printf("PACKET: recv, len=%d (type=%d, route=%s, payload_len=%d) SNR=%d RSSI=%d score=%d\n",
|
||||
2 + pkt->path_len + pkt->payload_len, pkt->getPayloadType(), pkt->isRouteDirect() ? "D" : "F", pkt->payload_len,
|
||||
(int)_radio->getLastSNR(), (int)_radio->getLastRSSI(), (int)(score*1000));
|
||||
(int)pkt->getSNR(), (int)_radio->getLastRSSI(), (int)(score*1000));
|
||||
#endif
|
||||
|
||||
if (pkt->isRouteFlood()) {
|
||||
|
|
@ -198,6 +198,7 @@ Packet* Dispatcher::obtainNewPacket() {
|
|||
n_full_events++;
|
||||
} else {
|
||||
pkt->payload_len = pkt->path_len = 0;
|
||||
pkt->_snr = 0;
|
||||
}
|
||||
return pkt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue