wifi: Remove unused parameters in MacLow::ReceiveError
authorSébastien Deronne <sebastien.deronne@gmail.com>
Sat, 22 Sep 2018 17:56:59 +0200
changeset 13807 497681985a58
parent 13806 a6d601c5d1f9
child 13808 100f4abf36a4
wifi: Remove unused parameters in MacLow::ReceiveError
src/wifi/model/mac-low.cc
src/wifi/model/mac-low.h
src/wifi/model/qos-txop.cc
src/wifi/model/qos-txop.h
src/wifi/model/wifi-phy-state-helper.cc
src/wifi/model/wifi-phy-state-helper.h
src/wifi/test/spectrum-wifi-phy-test.cc
--- a/src/wifi/model/mac-low.cc	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/model/mac-low.cc	Sat Sep 22 17:56:59 2018 +0200
@@ -265,7 +265,7 @@
 MacLow::ResetPhy (void)
 {
   m_phy->SetReceiveOkCallback (MakeNullCallback<void, Ptr<Packet>, double, WifiTxVector> ());
-  m_phy->SetReceiveErrorCallback (MakeNullCallback<void, Ptr<Packet>, double> ());
+  m_phy->SetReceiveErrorCallback (MakeNullCallback<void> ());
   RemovePhyMacLowListener (m_phy);
   m_phy = 0;
 }
@@ -307,7 +307,7 @@
 }
 
 bool
-MacLow::GetCtsToSelfSupported () const
+MacLow::GetCtsToSelfSupported (void) const
 {
   return m_ctsToSelfSupported;
 }
@@ -379,13 +379,13 @@
 }
 
 Time
-MacLow::GetBasicBlockAckTimeout () const
+MacLow::GetBasicBlockAckTimeout (void) const
 {
   return m_basicBlockAckTimeout;
 }
 
 Time
-MacLow::GetCompressedBlockAckTimeout () const
+MacLow::GetCompressedBlockAckTimeout (void) const
 {
   return m_compressedBlockAckTimeout;
 }
@@ -399,14 +399,12 @@
 Time
 MacLow::GetSifs (void) const
 {
-  NS_LOG_FUNCTION (this);
   return m_sifs;
 }
 
 Time
 MacLow::GetRifs (void) const
 {
-  NS_LOG_FUNCTION (this);
   return m_rifs;
 }
 
@@ -618,9 +616,9 @@
 }
 
 void
-MacLow::ReceiveError (Ptr<Packet> packet, double rxSnr)
+MacLow::ReceiveError (void)
 {
-  NS_LOG_FUNCTION (this << packet << rxSnr);
+  NS_LOG_FUNCTION (this);
   NS_LOG_DEBUG ("rx failed");
   if (IsCfPeriod () && m_currentHdr.IsCfPoll ())
     {
@@ -1319,7 +1317,7 @@
 }
 
 void
-MacLow::NotifyAckTimeoutResetNow ()
+MacLow::NotifyAckTimeoutResetNow (void)
 {
   for (ChannelAccessManagersCI i = m_channelAccessManagers.begin (); i != m_channelAccessManagers.end (); i++)
     {
@@ -1337,7 +1335,7 @@
 }
 
 void
-MacLow::NotifyCtsTimeoutResetNow ()
+MacLow::NotifyCtsTimeoutResetNow (void)
 {
   for (ChannelAccessManagersCI i = m_channelAccessManagers.begin (); i != m_channelAccessManagers.end (); i++)
     {
--- a/src/wifi/model/mac-low.h	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/model/mac-low.h	Sat Sep 22 17:56:59 2018 +0200
@@ -179,7 +179,7 @@
    *
    * \return true if CTS-to-self is supported, false otherwise
    */
-  bool GetCtsToSelfSupported () const;
+  bool GetCtsToSelfSupported (void) const;
   /**
    * Return the MAC address of this MacLow.
    *
@@ -197,13 +197,13 @@
    *
    * \return Basic Block ACK timeout
    */
-  Time GetBasicBlockAckTimeout () const;
+  Time GetBasicBlockAckTimeout (void) const;
   /**
    * Return Compressed Block ACK timeout of this MacLow.
    *
    * \return Compressed Block ACK timeout
    */
-  Time GetCompressedBlockAckTimeout () const;
+  Time GetCompressedBlockAckTimeout (void) const;
   /**
    * Return CTS timeout of this MacLow.
    *
@@ -325,13 +325,10 @@
    */
   void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
   /**
-   * \param packet packet received.
-   * \param rxSnr snr of packet received.
-   *
    * This method is typically invoked by the lower PHY layer to notify
    * the MAC layer that a packet was unsuccessfully received.
    */
-  void ReceiveError (Ptr<Packet> packet, double rxSnr);
+  void ReceiveError (void);
   /**
    * \param duration switching delay duration.
    *
@@ -629,7 +626,7 @@
   /**
    * Notify ChannelAccessManager that ACK timer should be reset.
    */
-  void NotifyAckTimeoutResetNow ();
+  void NotifyAckTimeoutResetNow (void);
   /**
    * Notify ChannelAccessManager that CTS timer should be started for the given duration.
    *
@@ -639,7 +636,7 @@
   /**
    * Notify ChannelAccessManager that CTS timer should be reset.
    */
-  void NotifyCtsTimeoutResetNow ();
+  void NotifyCtsTimeoutResetNow (void);
   /**
    * Reset NAV after CTS was missed when the NAV was
    * set with RTS.
--- a/src/wifi/model/qos-txop.cc	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/model/qos-txop.cc	Sat Sep 22 17:56:59 2018 +0200
@@ -748,7 +748,7 @@
 void
 QosTxop::StartAccessIfNeeded (void)
 {
-  //NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this);
   if (m_currentPacket == 0
       && (!m_queue->IsEmpty () || m_baManager->HasPackets ())
       && !IsAccessRequested ())
@@ -971,7 +971,7 @@
 }
 
 bool
-QosTxop::IsTxopFragmentation () const
+QosTxop::IsTxopFragmentation (void) const
 {
   if (GetTxopLimit ().IsZero ())
     {
@@ -986,7 +986,7 @@
 }
 
 uint32_t
-QosTxop::GetTxopFragmentSize () const
+QosTxop::GetTxopFragmentSize (void) const
 {
   Time txopDuration = GetTxopLimit ();
   if (txopDuration.IsZero ())
@@ -1019,7 +1019,7 @@
 }
 
 uint32_t
-QosTxop::GetNTxopFragment () const
+QosTxop::GetNTxopFragment (void) const
 {
   uint32_t fragmentSize = GetTxopFragmentSize ();
   uint32_t nFragments = (m_currentPacket->GetSize () / fragmentSize);
@@ -1339,7 +1339,7 @@
 }
 
 bool
-QosTxop::SetupBlockAckIfNeeded ()
+QosTxop::SetupBlockAckIfNeeded (void)
 {
   NS_LOG_FUNCTION (this);
   uint8_t tid = m_currentHdr.GetQosTid ();
@@ -1530,7 +1530,7 @@
 }
 
 void
-QosTxop::DoInitialize ()
+QosTxop::DoInitialize (void)
 {
   NS_LOG_FUNCTION (this);
   ResetCw ();
@@ -1560,7 +1560,7 @@
 }
 
 bool
-QosTxop::IsQosTxop () const
+QosTxop::IsQosTxop (void) const
 {
   return true;
 }
--- a/src/wifi/model/qos-txop.h	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/model/qos-txop.h	Sat Sep 22 17:56:59 2018 +0200
@@ -109,7 +109,7 @@
    *
    * \returns true if QoS TXOP.
    */
-  bool IsQosTxop () const;
+  bool IsQosTxop (void) const;
 
   /**
    * Set WifiRemoteStationsManager this QosTxop is associated to.
@@ -430,7 +430,7 @@
    *
    * \return true if we tried to set up block ACK, false otherwise.
    */
-  bool SetupBlockAckIfNeeded ();
+  bool SetupBlockAckIfNeeded (void);
   /**
    * Sends an ADDBA Request to establish a block ack agreement with sta
    * addressed by <i>recipient</i> for tid <i>tid</i>.
@@ -506,19 +506,19 @@
    * \return true if the current packet is fragmented because of an exceeded TXOP duration,
    *         false otherwise
    */
-  bool IsTxopFragmentation () const;
+  bool IsTxopFragmentation (void) const;
   /**
    * Calculate the size of the current TXOP fragment.
    *
    * \return the size of the current TXOP fragment
    */
-  uint32_t GetTxopFragmentSize () const;
+  uint32_t GetTxopFragmentSize (void) const;
   /**
    * Calculate the number of TXOP fragments needed for the transmission of the current packet.
    *
    * \return the number of TXOP fragments needed for the transmission of the current packet
    */
-  uint32_t GetNTxopFragment () const;
+  uint32_t GetNTxopFragment (void) const;
   /**
    * Calculate the size of the next TXOP fragment.
    *
--- a/src/wifi/model/wifi-phy-state-helper.cc	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/model/wifi-phy-state-helper.cc	Sat Sep 22 17:56:59 2018 +0200
@@ -480,7 +480,7 @@
   DoSwitchFromRx ();
   if (!m_rxErrorCallback.IsNull ())
     {
-      m_rxErrorCallback (packet, snr);
+      m_rxErrorCallback ();
     }
 }
 
--- a/src/wifi/model/wifi-phy-state-helper.h	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/model/wifi-phy-state-helper.h	Sat Sep 22 17:56:59 2018 +0200
@@ -36,6 +36,8 @@
 class Packet;
 
 /**
+ * Callback if packet successfully received
+ *
  * arg1: packet received successfully
  * arg2: snr of packet
  * arg3: TXVECTOR of packet
@@ -43,10 +45,9 @@
  */
 typedef Callback<void, Ptr<Packet>, double, WifiTxVector> RxOkCallback;
 /**
- * arg1: packet received unsuccessfully
- * arg2: snr of packet
+ * Callback if packet unsuccessfully received
  */
-typedef Callback<void, Ptr<Packet>, double> RxErrorCallback;
+typedef Callback<void> RxErrorCallback;
 
 /**
  * \ingroup wifi
--- a/src/wifi/test/spectrum-wifi-phy-test.cc	Sat Sep 22 17:29:39 2018 +0200
+++ b/src/wifi/test/spectrum-wifi-phy-test.cc	Sat Sep 22 17:56:59 2018 +0200
@@ -55,6 +55,7 @@
    */
   SpectrumWifiPhyBasicTest (std::string name);
   virtual ~SpectrumWifiPhyBasicTest ();
+
 protected:
   virtual void DoSetup (void);
   Ptr<SpectrumWifiPhy> m_phy; ///< Phy
@@ -78,11 +79,10 @@
   void SpectrumWifiPhyRxSuccess (Ptr<Packet> p, double snr, WifiTxVector txVector);
   /**
    * Spectrum wifi receive failure function
-   * \param p the packet
-   * \param snr the SNR
    */
-  void SpectrumWifiPhyRxFailure (Ptr<Packet> p, double snr);
+  void SpectrumWifiPhyRxFailure (void);
   uint32_t m_count; ///< count
+
 private:
   virtual void DoRun (void);
 };
@@ -144,9 +144,9 @@
 }
 
 void
-SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxFailure (Ptr<Packet> p, double snr)
+SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxFailure (void)
 {
-  NS_LOG_FUNCTION (this << p << snr);
+  NS_LOG_FUNCTION (this);
   m_count++;
 }