Set sender and receiver packet attributes on incoming packets: patch by Gidon Ernst

This commit is contained in:
adamdunkels 2009-08-20 18:59:17 +00:00
parent d13f47a64f
commit 522f991f14
1 changed files with 8 additions and 2 deletions

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: xmac.c,v 1.34 2009/06/22 11:14:11 nifi Exp $
* $Id: xmac.c,v 1.35 2009/08/20 18:59:17 adamdunkels Exp $
*/
/**
@ -57,7 +57,7 @@
#define WITH_CHANNEL_CHECK 0 /* Seems to work badly when enabled */
#define WITH_TIMESYNCH 0
#define WITH_QUEUE 0
#define WITH_ACK_OPTIMIZATION 1
#define WITH_ACK_OPTIMIZATION 0
#define WITH_RANDOM_WAIT_BEFORE_SEND 0
struct announcement_data {
@ -614,6 +614,12 @@ read_packet(void)
asleep. */
off();
/* Set sender and receiver packet attributes */
if(!rimeaddr_cmp(&hdr->receiver, &rimeaddr_null)) {
packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, &hdr->receiver);
}
packetbuf_set_addr(PACKETBUF_ADDR_SENDER, &hdr->sender);
#if XMAC_CONF_COMPOWER
/* Accumulate the power consumption for the packet reception. */
compower_accumulate(&current_packet);