From e30a8293acafe75c485e2eb36c5b4caaad7a8d68 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Fri, 29 May 2020 17:12:20 +0200 Subject: [PATCH] do not try a second time to use SendBuffer at failure --- mini-beieli-node.ino | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/mini-beieli-node.ino b/mini-beieli-node.ino index 366e66c..a0c2b6c 100644 --- a/mini-beieli-node.ino +++ b/mini-beieli-node.ino @@ -798,33 +798,13 @@ void startSendingUplink(bool firstTime) if (config_data.debug_level > 0) { gCatena.SafePrintf("SendBuffer firstTime\n"); } - bool success = gLoRaWAN.SendBuffer((uint8_t*)&lora_data_first, sizeof(LORA_data_first), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); - // we try a second time if not successful... - if (! success) { - if (config_data.debug_level > 0) { - gCatena.SafePrintf("SendBuffer was not successful, we try a second time...\n"); - } - os_runloop_once(); - //gCatena.poll(); - delay(500); - gLoRaWAN.SendBuffer((uint8_t*)&lora_data_first, sizeof(LORA_data_first), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); - } + gLoRaWAN.SendBuffer((uint8_t*)&lora_data_first, sizeof(LORA_data_first), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); package_counter++; } else { if (config_data.debug_level > 0) { gCatena.SafePrintf("SendBuffer not firstTime\n"); } - bool success = gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); - // we try a second time if not successful... - if (! success) { - if (config_data.debug_level > 0) { - gCatena.SafePrintf("SendBuffer was not successful, we try a second time...\n"); - } - os_runloop_once(); - //gCatena.poll(); - delay(500); - gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); - } + gLoRaWAN.SendBuffer((uint8_t*)&lora_data, sizeof(LORA_data), sendBufferDoneCb, NULL, fConfirmed, kUplinkPort); package_counter++; }