Skip to content

Commit

Permalink
apps/lorawan: set GNRC timeout error code
Browse files Browse the repository at this point in the history
  • Loading branch information
olegart committed Dec 27, 2019
1 parent 9006181 commit f40939d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/lorawan/main-node.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ extern "C" {
#define LORAWAN_SENDNEXT_DELAY_MS 10000U
#define LORAWAN_MIN_TX_DELAY_MS 5000U
#define LORAWAN_GNRC_TIMEOUT_MS 20000U
#define LORAWAN_GNRC_TIMEOUT_ERROR 111U

#define LORAWAN_PORT_DEFAULT 2

Expand Down Expand Up @@ -370,7 +371,7 @@ static void *sender_thread(void *arg) {

msg_t _timeout_msg;
_timeout_msg.type = GNRC_NETERR_MSG_TYPE;
_timeout_msg.content.value = 111; /* Some error */
_timeout_msg.content.value = LORAWAN_GNRC_TIMEOUT_ERROR; /* Some error */
lptimer_t _timeout_timer;
lptimer_set_msg(&_timeout_timer, LORAWAN_GNRC_TIMEOUT_MS, &_timeout_msg, sender_pid);

Expand All @@ -382,7 +383,7 @@ static void *sender_thread(void *arg) {

lptimer_remove(&_timeout_timer);

if (msg.content.value == 111) {
if (msg.content.value == LORAWAN_GNRC_TIMEOUT_ERROR) {
puts("[LoRa] GNRC timeout");
}

Expand Down Expand Up @@ -472,7 +473,7 @@ static void *sender_thread(void *arg) {

msg_t _timeout_msg;
_timeout_msg.type = GNRC_NETERR_MSG_TYPE;
_timeout_msg.content.value = 111; /* Some error */
_timeout_msg.content.value = LORAWAN_GNRC_TIMEOUT_ERROR; /* Some error */
lptimer_t _timeout_timer;
lptimer_set_msg(&_timeout_timer, LORAWAN_GNRC_TIMEOUT_MS, &_timeout_msg, sender_pid);

Expand All @@ -481,7 +482,7 @@ static void *sender_thread(void *arg) {
msg_receive(&msg);
} while (msg.type != GNRC_NETERR_MSG_TYPE);

if (msg.content.value == 111) {
if (msg.content.value == LORAWAN_GNRC_TIMEOUT_ERROR) {
puts("[LoRa] GNRC timeout");
}

Expand Down

0 comments on commit f40939d

Please sign in to comment.