From 7aa4e94e454b721a7f885552493a6c5af081d79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 30 Jan 2023 17:14:12 +0100 Subject: [PATCH] Do not send when region unset --- src/mesh/RadioLibInterface.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 6bba720e5..ef69f722c 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -108,20 +108,15 @@ ErrorCode RadioLibInterface::send(meshtastic_MeshPacket *p) if (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_UNSET) { if (disabled || !config.lora.tx_enabled) { - - if (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_UNSET) { - if (disabled || !config.lora.tx_enabled) { - LOG_WARN("send - !config.lora.tx_enabled\n"); - packetPool.release(p); - return ERRNO_DISABLED; - } - - } else { - LOG_WARN("send - lora tx disable because RegionCode_Unset\n"); - packetPool.release(p); - return ERRNO_DISABLED; - } + LOG_WARN("send - !config.lora.tx_enabled\n"); + packetPool.release(p); + return ERRNO_DISABLED; } + + } else { + LOG_WARN("send - lora tx disable because RegionCode_Unset\n"); + packetPool.release(p); + return ERRNO_DISABLED; } #else