Added a MAC layer return value that informs the caller that a packet did not receive a MAC layer acknowledgement

This commit is contained in:
adamdunkels 2010-02-03 01:17:32 +00:00
parent 4bc4f033e8
commit d68af249ec
3 changed files with 16 additions and 5 deletions

View File

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: cxmac.c,v 1.7 2010/02/02 23:28:58 adamdunkels Exp $ * $Id: cxmac.c,v 1.8 2010/02/03 01:17:32 adamdunkels Exp $
*/ */
/** /**
@ -738,7 +738,11 @@ send_packet(void)
LEDS_OFF(LEDS_BLUE); LEDS_OFF(LEDS_BLUE);
if(collisions == 0) { if(collisions == 0) {
return MAC_TX_OK; if(!is_broadcast && !got_strobe_ack) {
return MAC_TX_NOACK;
} else {
return MAC_TX_OK;
}
} else { } else {
someone_is_sending++; someone_is_sending++;
return MAC_TX_COLLISION; return MAC_TX_COLLISION;

View File

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: mac.h,v 1.9 2010/02/02 23:28:58 adamdunkels Exp $ * $Id: mac.h,v 1.10 2010/02/03 01:17:32 adamdunkels Exp $
*/ */
/** /**
@ -80,6 +80,9 @@ enum {
collision. */ collision. */
MAC_TX_COLLISION, MAC_TX_COLLISION,
/**< The MAC layer did not get an acknowledgement for the packet. */
MAC_TX_NOACK,
/**< The MAC layer transmission could not be performed because of an /**< The MAC layer transmission could not be performed because of an
error. The upper layer may try again later. */ error. The upper layer may try again later. */
MAC_TX_ERR, MAC_TX_ERR,

View File

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: xmac.c,v 1.51 2010/02/02 23:28:58 adamdunkels Exp $ * $Id: xmac.c,v 1.52 2010/02/03 01:17:32 adamdunkels Exp $
*/ */
/** /**
@ -676,7 +676,11 @@ send_packet(void)
LEDS_OFF(LEDS_BLUE); LEDS_OFF(LEDS_BLUE);
if(collisions == 0) { if(collisions == 0) {
return MAC_TX_OK; if(!is_broadcast && !got_strobe_ack) {
return MAC_TX_NOACK;
} else {
return MAC_TX_OK;
}
} else { } else {
someone_is_sending++; someone_is_sending++;
return MAC_TX_COLLISION; return MAC_TX_COLLISION;