From a929065461a7adb9c691f259cef054b7939eb12c Mon Sep 17 00:00:00 2001 From: Alessandro Aimi Date: Wed, 23 Oct 2024 11:20:33 +0200 Subject: [PATCH] Refactor missed frequency fields --- model/end-device-lorawan-mac.cc | 4 ++-- model/end-device-lorawan-mac.h | 4 ++-- model/lora-interference-helper.h | 16 ++++++++-------- model/sub-band.h | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/model/end-device-lorawan-mac.cc b/model/end-device-lorawan-mac.cc index 91fc1e9a5e..d3cc443428 100644 --- a/model/end-device-lorawan-mac.cc +++ b/model/end-device-lorawan-mac.cc @@ -886,8 +886,8 @@ EndDeviceLorawanMac::SetLogicalChannel(uint8_t chIndex, } void -EndDeviceLorawanMac::AddSubBand(double startFrequencyHz, - double endFrequencyHz, +EndDeviceLorawanMac::AddSubBand(uint32_t startFrequencyHz, + uint32_t endFrequencyHz, double dutyCycle, double maxTxPowerDbm) { diff --git a/model/end-device-lorawan-mac.h b/model/end-device-lorawan-mac.h index fa1438dd3f..d8bdae1529 100644 --- a/model/end-device-lorawan-mac.h +++ b/model/end-device-lorawan-mac.h @@ -331,8 +331,8 @@ class EndDeviceLorawanMac : public LorawanMac * \param dutyCycle The SubBand's duty cycle, in fraction form. * \param maxTxPowerDbm The maximum transmission power allowed on the SubBand. */ - void AddSubBand(double startFrequencyHz, - double endFrequencyHz, + void AddSubBand(uint32_t startFrequencyHz, + uint32_t endFrequencyHz, double dutyCycle, double maxTxPowerDbm); diff --git a/model/lora-interference-helper.h b/model/lora-interference-helper.h index 254dc84e0a..9965d14f19 100644 --- a/model/lora-interference-helper.h +++ b/model/lora-interference-helper.h @@ -108,9 +108,9 @@ class LoraInterferenceHelper /** * Get the frequency this event was on. * - * \return The carrier frequency as a double. + * \return The carrier frequency [Hz] as a uint32_t. */ - double GetFrequency() const; + uint32_t GetFrequency() const; /** * Print the current event in a human readable form. @@ -120,12 +120,12 @@ class LoraInterferenceHelper void Print(std::ostream& stream) const; private: - Time m_startTime; //!< The time this signal begins (at the device). - Time m_endTime; //!< The time this signal ends (at the device). - uint8_t m_sf; //!< The spreading factor of this signal. - double m_rxPowerdBm; //!< The power of this event in dBm (at the device). - Ptr m_packet; //!< The packet this event was generated for. - double m_frequencyHz; //!< The frequency this event was on. + Time m_startTime; //!< The time this signal begins (at the device). + Time m_endTime; //!< The time this signal ends (at the device). + uint8_t m_sf; //!< The spreading factor of this signal. + double m_rxPowerdBm; //!< The power of this event in dBm (at the device). + Ptr m_packet; //!< The packet this event was generated for. + uint32_t m_frequencyHz; //!< The carrier frequency [Hz] this event was on. }; /** diff --git a/model/sub-band.h b/model/sub-band.h index 93e586f41f..2717d5ec9f 100644 --- a/model/sub-band.h +++ b/model/sub-band.h @@ -127,8 +127,8 @@ class SubBand : public Object double GetMaxTxPowerDbm() const; private: - double m_firstFrequencyHz; //!< Starting frequency of the subband, in Hz - double m_lastFrequencyHz; //!< Ending frequency of the subband, in Hz + uint32_t m_firstFrequencyHz; //!< Starting frequency of the subband, in Hz + uint32_t m_lastFrequencyHz; //!< Ending frequency of the subband, in Hz double m_dutyCycle; //!< The duty cycle that needs to be enforced on this subband Time m_nextTransmissionTime; //!< The next time a transmission will be allowed in this subband double m_maxTxPowerDbm; //!< The maximum transmission power that is admitted on this subband