do not try a second time to use SendBuffer at failure

This commit is contained in:
Joerg Lehmann 2020-05-29 17:12:20 +02:00
parent 174f8b360f
commit e30a8293ac
1 changed files with 2 additions and 22 deletions

View File

@ -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);
}
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);
}
package_counter++;
}