From b1ef3fdf41092c4396d735a3500b68d6d7cc6783 Mon Sep 17 00:00:00 2001 From: Amit Geron Date: Wed, 8 Jul 2015 22:10:03 +0300 Subject: [PATCH 1/2] Fix indentation --- core/net/rime/stunicast.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/net/rime/stunicast.c b/core/net/rime/stunicast.c index 75b406e9a..1d69b2e20 100644 --- a/core/net/rime/stunicast.c +++ b/core/net/rime/stunicast.c @@ -112,10 +112,10 @@ send(void *ptr) PRINTF("%d.%d: stunicast: resend to %d.%d\n", linkaddr_node_addr.u8[0],linkaddr_node_addr.u8[1], c->receiver.u8[0], c->receiver.u8[1]); - if(c->buf) { - queuebuf_to_packetbuf(c->buf); - unicast_send(&c->c, &c->receiver); - stunicast_set_timer(c, CLOCK_SECOND); + if(c->buf) { + queuebuf_to_packetbuf(c->buf); + unicast_send(&c->c, &c->receiver); + stunicast_set_timer(c, CLOCK_SECOND); } /* if(c->u->sent != NULL) { c->u->sent(c); From bf3a5de75ebe8972a6d4b02c763b71654d3c8e38 Mon Sep 17 00:00:00 2001 From: Amit Geron Date: Wed, 8 Jul 2015 22:13:44 +0300 Subject: [PATCH 2/2] Fix stunicast timer restart Instead of hard coded setting the resend timer to CLOCK_SECOND, restart it, so that the time between ANY following transmissions will be as passed to stunicast_send_stubborn. --- core/net/rime/stunicast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/net/rime/stunicast.c b/core/net/rime/stunicast.c index 1d69b2e20..d7e1e8231 100644 --- a/core/net/rime/stunicast.c +++ b/core/net/rime/stunicast.c @@ -115,7 +115,7 @@ send(void *ptr) if(c->buf) { queuebuf_to_packetbuf(c->buf); unicast_send(&c->c, &c->receiver); - stunicast_set_timer(c, CLOCK_SECOND); + ctimer_restart(&c->t); } /* if(c->u->sent != NULL) { c->u->sent(c);