netdev2_ieee802154: remove NETDEV2_IEEE802154_PAN_COMP flag

This commit is contained in:
Martine Lenders 2016-09-30 13:04:14 +02:00
parent d1c3233242
commit 9f29e56020
4 changed files with 12 additions and 10 deletions

View File

@ -100,7 +100,6 @@ void at86rf2xx_reset(at86rf2xx_t *dev)
/* set default TX power */
at86rf2xx_set_txpower(dev, AT86RF2XX_DEFAULT_TXPOWER);
/* set default options */
at86rf2xx_set_option(dev, NETDEV2_IEEE802154_PAN_COMP, true);
at86rf2xx_set_option(dev, AT86RF2XX_OPT_AUTOACK, true);
at86rf2xx_set_option(dev, AT86RF2XX_OPT_CSMA, true);
at86rf2xx_set_option(dev, AT86RF2XX_OPT_TELL_RX_START, false);

View File

@ -38,7 +38,7 @@ extern "C" {
* @{
*/
#define NETDEV2_IEEE802154_SEND_MASK (0x0068) /**< flags to take for send packets */
#define NETDEV2_IEEE802154_SEND_MASK (0x0028) /**< flags to take for send packets */
#define NETDEV2_IEEE802154_RESV1 (0x0001) /**< reserved flag */
#define NETDEV2_IEEE802154_RAW (0x0002) /**< pass raw frame to upper layer */
/**
@ -52,7 +52,6 @@ extern "C" {
* @brief request ACK from receiver
*/
#define NETDEV2_IEEE802154_ACK_REQ (0x0020)
#define NETDEV2_IEEE802154_PAN_COMP (0x0040) /**< compress source PAN ID */
#define NETDEV2_IEEE802154_RESV3 (0x0080) /**< reserved flag */
/**
* @}

View File

@ -119,9 +119,8 @@ extern "C" {
* first byte of the IEEE 802.15.4 FCF. This means that
* it encompasses the type values,
* @ref IEEE802154_FCF_SECURITY_EN,
* @ref IEEE802154_FCF_FRAME_PEND,
* @ref IEEE802154_FCF_ACK_REQ, and
* @ref IEEE802154_FCF_PAN_COMP.
* @ref IEEE802154_FCF_FRAME_PEND, and
* @ref IEEE802154_FCF_ACK_REQ.
* Additionally the @ref IEEE802154_BCAST flag can be set
* do ignore @p dst and @p dst_len and just set `ff:ff`
* (broadcast) as destination address

View File

@ -82,11 +82,16 @@ size_t ieee802154_set_frame_hdr(uint8_t *buf, const uint8_t *src, size_t src_len
}
/* fill in source PAN ID (if applicable) */
if (!(flags & IEEE802154_FCF_PAN_COMP) && (src_len != 0)) {
if (src_len != 0) {
if ((dst_len != 0) && (src_pan.u16 == dst_pan.u16)) {
buf[0] |= IEEE802154_FCF_PAN_COMP;
}
else {
/* (little endian) */
buf[pos++] = src_pan.u8[0];
buf[pos++] = src_pan.u8[1];
}
}
/* fill in source address */
switch (src_len) {