From fe1d889e7dc4241d815aad640d7215a25996bc17 Mon Sep 17 00:00:00 2001 From: Grygoriy Fuchedzhy Date: Sun, 17 Jan 2010 22:10:40 +0200 Subject: [PATCH] using new IEEE 802.15.4 defs in mrf_tx function --- fw/mrf/mrf_impl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fw/mrf/mrf_impl.h b/fw/mrf/mrf_impl.h index 84f339c..71e2dc1 100644 --- a/fw/mrf/mrf_impl.h +++ b/fw/mrf/mrf_impl.h @@ -128,8 +128,11 @@ void mrf_tx(uint16_t pan_id, uint16_t short_addr, const uint8_t* data, uint8_t d { uint16_t addr = MRF_BUF_TX_NORMAL; - mrf_write_long_addr(addr++, 11); - mrf_write_long_addr(addr++, 11 + data_length); + // frame control + seq.num. + addressing fields + const uint8_t hdr_length = 2 + 1 + 2*(IEEE802_15_4_SHORT_ADDR_LENGTH + IEEE802_15_4_PAN_ID_LENGTH); + + mrf_write_long_addr(addr++, hdr_length); + mrf_write_long_addr(addr++, hdr_length + data_length); // frame control mrf_write_long_addr(addr++, IEEE802_15_4_DATA | IEEE802_15_4_ACK_REQ); -- 2.11.4.GIT