Changes to how airtime noise is gathered.

This commit is contained in:
Jm 2021-02-20 23:53:17 -08:00
parent fc5030ff7b
commit 7ffe601743

View File

@ -114,7 +114,6 @@ ErrorCode RadioLibInterface::send(MeshPacket *p)
// Count the packet toward our TX airtime utilization. // Count the packet toward our TX airtime utilization.
// We only count it if it can be added to the TX queue. // We only count it if it can be added to the TX queue.
airTime->logAirtime(TX_LOG, xmitMsec); airTime->logAirtime(TX_LOG, xmitMsec);
// airTime.logAirtime(TX_LOG, xmitMsec);
// We want all sending/receiving to be done by our daemon thread, We use a delay here because this packet might have been sent // We want all sending/receiving to be done by our daemon thread, We use a delay here because this packet might have been sent
// in response to a packet we just received. So we want to make sure the other side has had a chance to reconfigure its radio // in response to a packet we just received. So we want to make sure the other side has had a chance to reconfigure its radio
@ -245,13 +244,14 @@ void RadioLibInterface::handleReceiveInterrupt()
size_t length = iface->getPacketLength(); size_t length = iface->getPacketLength();
xmitMsec = getPacketTime(length); xmitMsec = getPacketTime(length);
airTime->logAirtime(RX_ALL_LOG, xmitMsec);
// airTime.logAirtime(RX_ALL_LOG, xmitMsec);
int state = iface->readData(radiobuf, length); int state = iface->readData(radiobuf, length);
if (state != ERR_NONE) { if (state != ERR_NONE) {
DEBUG_MSG("ignoring received packet due to error=%d\n", state); DEBUG_MSG("ignoring received packet due to error=%d\n", state);
rxBad++; rxBad++;
airTime->logAirtime(RX_ALL_LOG, xmitMsec);
} else { } else {
// Skip the 4 headers that are at the beginning of the rxBuf // Skip the 4 headers that are at the beginning of the rxBuf
int32_t payloadLen = length - sizeof(PacketHeader); int32_t payloadLen = length - sizeof(PacketHeader);
@ -261,6 +261,7 @@ void RadioLibInterface::handleReceiveInterrupt()
if (payloadLen < 0) { if (payloadLen < 0) {
DEBUG_MSG("ignoring received packet too short\n"); DEBUG_MSG("ignoring received packet too short\n");
rxBad++; rxBad++;
airTime->logAirtime(RX_ALL_LOG, xmitMsec);
} else { } else {
const PacketHeader *h = (PacketHeader *)radiobuf; const PacketHeader *h = (PacketHeader *)radiobuf;
@ -287,9 +288,8 @@ void RadioLibInterface::handleReceiveInterrupt()
printPacket("Lora RX", mp); printPacket("Lora RX", mp);
xmitMsec = getPacketTime(mp); //xmitMsec = getPacketTime(mp);
airTime->logAirtime(RX_LOG, xmitMsec); airTime->logAirtime(RX_LOG, xmitMsec);
// airTime.logAirtime(RX_LOG, xmitMsec);
deliverToReceiver(mp); deliverToReceiver(mp);
} }