diff --git a/include/nuttx/net/sixlowpan.h b/include/nuttx/net/sixlowpan.h index 0d403d25bb8..be3bfa76365 100644 --- a/include/nuttx/net/sixlowpan.h +++ b/include/nuttx/net/sixlowpan.h @@ -333,17 +333,28 @@ struct rimeaddr_s * 2) i_dsn must be set to a random value. After that, it will be managed * by the network. * 3) i_nodeaddr must be set after the MAC is assigned an address. + * 4) On network TX poll operations, the IEEE802.15.4 MAC needs to provide + * the i_frame buffer with size greater than or equal to + * CONFIG_NET_6LOWPAN_FRAMELEN. No dev.d_buf need be provided in this + * case. The entire is TX is performed using only the i_frame buffer. + * 5) On network input RX oprations, both buffers must be provided. The size + * of the i_frame buffer is, again, greater than or equal to + * CONFIG_NET_6LOWPAN_FRAMELEN. The larger dev.d_buf must have a size + * of at least . The dev.d_buf is used for de-compressing each + * frame and reassembling any fragmented packets to create the full input + * packet that is provided to the applicatino. * * Frame Organization: * - * Content Offset - * +----------------+ 0 - * | Frame Header | - * +----------------+ i_dataoffset - * | Data | - * +----------------+ i_framelen - * | Unused | - * +----------------+ CONFIG_NET_6LOWPAN_FRAMELEN + * Content Offset + * +------------------+ 0 + * | Frame Header | + * +------------------+ i_dataoffset + * | Procotol Headers | + * | Data Payload | + * +------------------+ i_framelen + * | Unused | + * +------------------+ CONFIG_NET_6LOWPAN_FRAMELEN */ struct ieee802154_driver_s diff --git a/net/sixlowpan/sixlowpan_framer.c b/net/sixlowpan/sixlowpan_framer.c index 611e204a9f8..2b528dea10d 100644 --- a/net/sixlowpan/sixlowpan_framer.c +++ b/net/sixlowpan/sixlowpan_framer.c @@ -109,35 +109,6 @@ static inline uint8_t sixlowpan_addrlen(uint8_t addrmode) } } -/**************************************************************************** - * Function: sixlowpan_isbroadcast - * - * Description: - * Return the address length associated with a 2-bit address mode - * - * Input parameters: - * addrmode - The address mode - * - * Returned Value: - * The address length associated with the address mode. - * - ****************************************************************************/ - -static bool sixlowpan_isbroadcast(uint8_t mode, FAR uint8_t *addr) -{ - int i = ((mode == FRAME802154_SHORTADDRMODE) ? 2 : 8); - - while (i-- > 0) - { - if (addr[i] != 0xff) - { - return false; - } - } - - return true; -} - /**************************************************************************** * Function: sixlowpan_addrnull * diff --git a/net/sixlowpan/sixlowpan_input.c b/net/sixlowpan/sixlowpan_input.c index 964d988be72..ce520f8e5e3 100644 --- a/net/sixlowpan/sixlowpan_input.c +++ b/net/sixlowpan/sixlowpan_input.c @@ -46,6 +46,39 @@ #ifdef CONFIG_NET_6LOWPAN +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Function: sixlowpan_isbroadcast + * + * Description: + * Return the address length associated with a 2-bit address mode + * + * Input parameters: + * addrmode - The address mode + * + * Returned Value: + * The address length associated with the address mode. + * + ****************************************************************************/ + +static bool sixlowpan_isbroadcast(uint8_t mode, FAR uint8_t *addr) +{ + int i = ((mode == FRAME802154_SHORTADDRMODE) ? 2 : 8); + + while (i-- > 0) + { + if (addr[i] != 0xff) + { + return false; + } + } + + return true; +} + /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/net/sixlowpan/sixlowpan_utils.c b/net/sixlowpan/sixlowpan_utils.c index a12394407f6..f00eaeae4c3 100644 --- a/net/sixlowpan/sixlowpan_utils.c +++ b/net/sixlowpan/sixlowpan_utils.c @@ -46,14 +46,15 @@ ****************************************************************************/ /* Frame Organization: * - * Content Offset - * +----------------+ 0 - * | Frame Header | - * +----------------+ i_dataoffset - * | Data | - * +----------------+ i_framelen - * | Unused | - * +----------------+ CONFIG_NET_6LOWPAN_FRAMELEN + * Content Offset + * +------------------+ 0 + * | Frame Header | + * +------------------+ i_dataoffset + * | Procotol Headers | + * | Data Payload | + * +------------------+ i_framelen + * | Unused | + * +------------------+ CONFIG_NET_6LOWPAN_FRAMELEN */ /****************************************************************************