clear transmission flag if send failed

This commit is contained in:
nifi 2009-12-18 14:49:42 +00:00
parent 23d5f84a46
commit 7b2b93e6e6

View file

@ -34,7 +34,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: runicast.c,v 1.7 2009/11/08 19:40:18 adamdunkels Exp $ * $Id: runicast.c,v 1.8 2009/12/18 14:49:42 nifi Exp $
*/ */
/** /**
@ -213,6 +213,7 @@ int
runicast_send(struct runicast_conn *c, const rimeaddr_t *receiver, runicast_send(struct runicast_conn *c, const rimeaddr_t *receiver,
uint8_t max_retransmissions) uint8_t max_retransmissions)
{ {
int ret;
if(runicast_is_transmitting(c)) { if(runicast_is_transmitting(c)) {
PRINTF("%d.%d: runicast: already transmitting\n", PRINTF("%d.%d: runicast: already transmitting\n",
rimeaddr_node_addr.u8[0],rimeaddr_node_addr.u8[1]); rimeaddr_node_addr.u8[0],rimeaddr_node_addr.u8[1]);
@ -228,7 +229,11 @@ runicast_send(struct runicast_conn *c, const rimeaddr_t *receiver,
PRINTF("%d.%d: runicast: sending packet %d\n", PRINTF("%d.%d: runicast: sending packet %d\n",
rimeaddr_node_addr.u8[0],rimeaddr_node_addr.u8[1], rimeaddr_node_addr.u8[0],rimeaddr_node_addr.u8[1],
c->sndnxt); c->sndnxt);
return stunicast_send_stubborn(&c->c, receiver, REXMIT_TIME); ret = stunicast_send_stubborn(&c->c, receiver, REXMIT_TIME);
if(!ret) {
c->is_tx = 0;
}
return ret;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** @} */ /** @} */