Changed to use short address mode with short rime addresses

This commit is contained in:
nifi 2010-03-12 14:49:21 +00:00
parent efda8edcc5
commit 2cf0fb9cce

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: framer-802154.c,v 1.5 2010/03/09 20:40:11 adamdunkels Exp $
* $Id: framer-802154.c,v 1.6 2010/03/12 14:49:21 nifi Exp $
*/
/**
@ -109,7 +109,12 @@ create(void)
\todo For phase 1 the addresses are all long. We'll need a mechanism
in the rime attributes to tell the mac to use long or short for phase 2.
*/
params.fcf.src_addr_mode = FRAME802154_LONGADDRMODE;
if(sizeof(rimeaddr_t) == 2) {
/* Use short address mode if rimeaddr size is short. */
params.fcf.src_addr_mode = FRAME802154_SHORTADDRMODE;
} else {
params.fcf.src_addr_mode = FRAME802154_LONGADDRMODE;
}
params.dest_pid = mac_dst_pan_id;
/*
@ -125,7 +130,12 @@ create(void)
} else {
rimeaddr_copy((rimeaddr_t *)&params.dest_addr,
packetbuf_addr(PACKETBUF_ADDR_RECEIVER));
params.fcf.dest_addr_mode = FRAME802154_LONGADDRMODE;
/* Use short address mode if rimeaddr size is small */
if(sizeof(rimeaddr_t) == 2) {
params.fcf.dest_addr_mode = FRAME802154_SHORTADDRMODE;
} else {
params.fcf.dest_addr_mode = FRAME802154_LONGADDRMODE;
}
}
/* Set the source PAN ID to the global variable. */