diff --git a/src/lr-wpan/model/lr-wpan-mac-trailer.cc b/src/lr-wpan/model/lr-wpan-mac-trailer.cc index 9393a2862..a69cc0ce9 100644 --- a/src/lr-wpan/model/lr-wpan-mac-trailer.cc +++ b/src/lr-wpan/model/lr-wpan-mac-trailer.cc @@ -28,7 +28,8 @@ namespace ns3 NS_OBJECT_ENSURE_REGISTERED(LrWpanMacTrailer); -const uint16_t LrWpanMacTrailer::LR_WPAN_MAC_FCS_LENGTH = 2; +/// The length in octets of the IEEE 802.15.4 MAC FCS field +constexpr uint16_t LR_WPAN_MAC_FCS_LENGTH = 2; LrWpanMacTrailer::LrWpanMacTrailer() : m_fcs(0), diff --git a/src/lr-wpan/model/lr-wpan-mac-trailer.h b/src/lr-wpan/model/lr-wpan-mac-trailer.h index 16c0637e0..ba14b2abe 100644 --- a/src/lr-wpan/model/lr-wpan-mac-trailer.h +++ b/src/lr-wpan/model/lr-wpan-mac-trailer.h @@ -38,11 +38,6 @@ class Packet; class LrWpanMacTrailer : public Trailer { public: - /** - * The length in octets of the IEEE 802.15.4 MAC FCS field - */ - static const uint16_t LR_WPAN_MAC_FCS_LENGTH; - /** * Get the type ID. * diff --git a/src/lr-wpan/model/lr-wpan-phy.cc b/src/lr-wpan/model/lr-wpan-phy.cc index 61b981890..3f62cbcd1 100644 --- a/src/lr-wpan/model/lr-wpan-phy.cc +++ b/src/lr-wpan/model/lr-wpan-phy.cc @@ -50,13 +50,13 @@ NS_LOG_COMPONENT_DEFINE("LrWpanPhy"); NS_OBJECT_ENSURE_REGISTERED(LrWpanPhy); -// Table 22 in section 6.4.1 of ieee802.15.4 -const uint32_t LrWpanPhy::aMaxPhyPacketSize = 127; // max PSDU in octets -const uint32_t LrWpanPhy::aTurnaroundTime = 12; // RX-to-TX or TX-to-RX in symbol periods - -// IEEE802.15.4-2006 Table 1 in section 6.1.1. and IEEE 802.15.4c-2009, IEEE 802.15.4d-2009 -// The index follows LrWpanPhyOption (kb/s and ksymbol/s) -const LrWpanPhyDataAndSymbolRates LrWpanPhy::dataSymbolRates[IEEE_802_15_4_INVALID_PHY_OPTION] = { +/** + * The data and symbol rates for the different PHY options. + * See Table 1 in section 6.1.1 IEEE 802.15.4-2006, IEEE 802.15.4c-2009, IEEE 802.15.4d-2009. + * Bit rate is in kbit/s. Symbol rate is in ksymbol/s. + * The index follows LrWpanPhyOption (kb/s and ksymbol/s) + */ +static const LrWpanPhyDataAndSymbolRates dataSymbolRates[IEEE_802_15_4_INVALID_PHY_OPTION]{ {20.0, 20.0}, {40.0, 40.0}, {20.0, 20.0}, @@ -68,20 +68,23 @@ const LrWpanPhyDataAndSymbolRates LrWpanPhy::dataSymbolRates[IEEE_802_15_4_INVAL {250.0, 62.5}, }; -// IEEE802.15.4-2006,IEEE 802.15.4c-2009, IEEE 802.15.4d-2009 Table 19 and Table 20 in section 6.3. -// The PHR is 1 octet and it follows phySymbolsPerOctet in Table 23 -// The index follows LrWpanPhyOption -const LrWpanPhyPpduHeaderSymbolNumber - LrWpanPhy::ppduHeaderSymbolNumbers[IEEE_802_15_4_INVALID_PHY_OPTION] = { - {32.0, 8.0, 8.0}, - {32.0, 8.0, 8.0}, - {32.0, 8.0, 8.0}, - {2.0, 1.0, 0.4}, - {6.0, 1.0, 1.6}, - {8.0, 2.0, 2.0}, - {8.0, 2.0, 2.0}, - {8.0, 2.0, 2.0}, - {8.0, 2.0, 2.0}, +/** + * The preamble, SFD, and PHR lengths in symbols for the different PHY options. + * See Table 19 and Table 20 in section 6.3 IEEE 802.15.4-2006, IEEE 802.15.4c-2009, IEEE + * 802.15.4d-2009. + * The PHR is 1 octet and it follows phySymbolsPerOctet in Table 23. + * The index follows LrWpanPhyOption. + */ +const LrWpanPhyPpduHeaderSymbolNumber ppduHeaderSymbolNumbers[IEEE_802_15_4_INVALID_PHY_OPTION]{ + {32.0, 8.0, 8.0}, + {32.0, 8.0, 8.0}, + {32.0, 8.0, 8.0}, + {2.0, 1.0, 0.4}, + {6.0, 1.0, 1.6}, + {8.0, 2.0, 2.0}, + {8.0, 2.0, 2.0}, + {8.0, 2.0, 2.0}, + {8.0, 2.0, 2.0}, }; TypeId diff --git a/src/lr-wpan/model/lr-wpan-phy.h b/src/lr-wpan/model/lr-wpan-phy.h index 94d6f8942..ac7ac9e10 100644 --- a/src/lr-wpan/model/lr-wpan-phy.h +++ b/src/lr-wpan/model/lr-wpan-phy.h @@ -529,21 +529,6 @@ class LrWpanPhy : public SpectrumPhy LrWpanPhyEnumeration oldState, LrWpanPhyEnumeration newState); - protected: - /** - * The data and symbol rates for the different PHY options. - * See Table 1 in section 6.1.1 IEEE 802.15.4-2006, IEEE 802.15.4c-2009, IEEE 802.15.4d-2009. - * Bit rate is in kbit/s. Symbol rate is in ksymbol/s. - */ - static const LrWpanPhyDataAndSymbolRates dataSymbolRates[IEEE_802_15_4_INVALID_PHY_OPTION]; - /** - * The preamble, SFD, and PHR lengths in symbols for the different PHY options. - * See Table 19 and Table 20 in section 6.3 IEEE 802.15.4-2006, IEEE 802.15.4c-2009, IEEE - * 802.15.4d-2009. - */ - static const LrWpanPhyPpduHeaderSymbolNumber - ppduHeaderSymbolNumbers[IEEE_802_15_4_INVALID_PHY_OPTION]; - private: /** * The second is true if the first is flagged as error/invalid.