Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo pourtibo driver_mbed_TH02
Diff: main.cpp
- Revision:
- 26:f07f5febf97f
- Parent:
- 18:1720bc3831ea
- Child:
- 46:a124538e2891
--- a/main.cpp Tue Jun 19 14:15:24 2018 +0100
+++ b/main.cpp Thu Jun 28 12:45:20 2018 +0100
@@ -145,7 +145,6 @@
return 0;
}
-
/**
* Sends a message to the Network Server
*/
@@ -174,6 +173,13 @@
if (retcode < 0) {
retcode == LORAWAN_STATUS_WOULD_BLOCK ? printf("send - WOULD BLOCK\r\n")
: printf("\r\n send() - Error code %d \r\n", retcode);
+
+ if (retcode == LORAWAN_STATUS_WOULD_BLOCK) {
+ //retry in 3 seconds
+ if (MBED_CONF_LORA_DUTY_CYCLE_ON) {
+ ev_queue.call_in(3000, send_message);
+ }
+ }
return;
}
@@ -253,6 +259,12 @@
case JOIN_FAILURE:
printf("\r\n OTAA Failed - Check Keys \r\n");
break;
+ case UPLINK_REQUIRED:
+ printf("\r\n Uplink required by NS \r\n");
+ if (MBED_CONF_LORA_DUTY_CYCLE_ON) {
+ send_message();
+ }
+ break;
default:
MBED_ASSERT("Unknown Event");
}