Skip to content

Commit

Permalink
net/emcute: use correct number of retries
Browse files Browse the repository at this point in the history
syncsend() is used also for the initial packet, so resending
while (retries <= EMCUTE_N_RETRY) is the correct behavior.
  • Loading branch information
haukepetersen committed May 28, 2018
1 parent 202fd41 commit 7f2fb5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/net/application_layer/emcute/emcute.c
Expand Up @@ -118,7 +118,7 @@ static int syncsend(uint8_t resp, size_t len, bool unlock)
* remove was called */
thread_flags_clear(TFLAGS_ANY);

for (unsigned retries = 0; retries < EMCUTE_N_RETRY; retries++) {
for (unsigned retries = 0; retries <= EMCUTE_N_RETRY; retries++) {
DEBUG("[emcute] syncsend: sending round %i\n", retries);
sock_udp_send(&sock, tbuf, len, &gateway);

Expand All @@ -128,7 +128,7 @@ static int syncsend(uint8_t resp, size_t len, bool unlock)
DEBUG("[emcute] syncsend: got response [%i]\n", result);
xtimer_remove(&timer);
res = result;
retries = EMCUTE_N_RETRY;
break;
}
}

Expand Down

0 comments on commit 7f2fb5e

Please sign in to comment.