lr-wpan: Move private constants from header to implementation file

This commit is contained in:
Eduardo Almeida
2022-12-06 19:12:55 +00:00
parent 5a4b72fa3d
commit cc2117fc1f
4 changed files with 26 additions and 42 deletions

View File

@@ -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),

View File

@@ -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.
*

View File

@@ -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

View File

@@ -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.