diff --git a/core/net/mac/framer-802154.c b/core/net/mac/framer-802154.c index 47e53ec61..ecffdd23d 100644 --- a/core/net/mac/framer-802154.c +++ b/core/net/mac/framer-802154.c @@ -65,13 +65,23 @@ static uint8_t initialized = 0; * sending to. If this value is 0xffff, the device is not * associated. */ -static const uint16_t mac_dst_pan_id = IEEE802154_PANID; +static uint16_t mac_dst_pan_id = IEEE802154_PANID; /** \brief The 16-bit identifier of the PAN on which the device is * operating. If this value is 0xffff, the device is not * associated. */ -static const uint16_t mac_src_pan_id = IEEE802154_PANID; +static uint16_t mac_src_pan_id = IEEE802154_PANID; + +/*---------------------------------------------------------------------------*/ +void framer_802154_set_panid(uint16_t panid){ + mac_dst_pan_id = panid; + mac_src_pan_id = panid; +} +/*---------------------------------------------------------------------------*/ +uint16_t framer_802154_get_panid(){ + return mac_dst_pan_id; +} /*---------------------------------------------------------------------------*/ static int @@ -175,7 +185,6 @@ create(void) PRINTF("15.4-OUT: %2X", params.fcf.frame_type); PRINTADDR(params.dest_addr); PRINTF("%d %u (%u)\n", len, packetbuf_datalen(), packetbuf_totlen()); - return len; } else { PRINTF("15.4-OUT: too large header: %u\n", len); diff --git a/core/net/mac/framer-802154.h b/core/net/mac/framer-802154.h index fe4fced80..3cbb52446 100644 --- a/core/net/mac/framer-802154.h +++ b/core/net/mac/framer-802154.h @@ -39,8 +39,12 @@ #ifndef FRAMER_802154_H_ #define FRAMER_802154_H_ +#include #include "net/mac/framer.h" extern const struct framer framer_802154; -#endif /* FRAMER_802154_H_ */ +void framer_802154_set_panid(uint16_t panid); +uint16_t framer_802154_get_panid(); + +#endif /* __FRAMER_802154_H__ */