mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 02:09:57 +00:00
Merge pull request #4895 from meshtastic/4884-unset-rx
Don't process RX when region unset
This commit is contained in:
commit
ef1f0cb074
@ -167,7 +167,7 @@ ErrorCode RadioLibInterface::send(meshtastic_MeshPacket *p)
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG_WARN("send - lora tx disable because RegionCode_Unset\n");
|
||||
LOG_WARN("send - lora tx disabled because RegionCode_Unset\n");
|
||||
packetPool.release(p);
|
||||
return ERRNO_DISABLED;
|
||||
}
|
||||
@ -379,6 +379,14 @@ void RadioLibInterface::handleReceiveInterrupt()
|
||||
|
||||
xmitMsec = getPacketTime(length);
|
||||
|
||||
#ifndef DISABLE_WELCOME_UNSET
|
||||
if (config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UNSET) {
|
||||
LOG_WARN("recv - lora rx disabled because RegionCode_Unset\n");
|
||||
airTime->logAirtime(RX_ALL_LOG, xmitMsec);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
int state = iface->readData(radiobuf, length);
|
||||
if (state != RADIOLIB_ERR_NONE) {
|
||||
LOG_ERROR("ignoring received packet due to error=%d\n", state);
|
||||
|
Loading…
Reference in New Issue
Block a user