src/devices/wifi/wifi-phy.h
changeset 1964 041240a915f8
parent 1920 1d4864775cf8
child 1977 4303409f3d8e
equal deleted inserted replaced
1963:007214146da7 1964:041240a915f8
    70 
    70 
    71 
    71 
    72 class WifiPhy
    72 class WifiPhy
    73 {
    73 {
    74 public:
    74 public:
    75   typedef Callback<void,Packet const , double, WifiMode, enum WifiPreamble> SyncOkCallback;
    75   typedef Callback<void,Packet, double, WifiMode, enum WifiPreamble> SyncOkCallback;
    76   typedef Callback<void,Packet const , double> SyncErrorCallback;
    76   typedef Callback<void,Packet, double> SyncErrorCallback;
    77 
    77 
    78   WifiPhy (Ptr<WifiNetDevice> device);
    78   WifiPhy (Ptr<WifiNetDevice> device);
    79   virtual ~WifiPhy ();
    79   virtual ~WifiPhy ();
    80 
    80 
    81   void SetChannel (Ptr<WifiChannel> channel);
    81   void SetChannel (Ptr<WifiChannel> channel);
    95   Time GetStateDuration (void);
    95   Time GetStateDuration (void);
    96   Time GetDelayUntilIdle (void);
    96   Time GetDelayUntilIdle (void);
    97 
    97 
    98   Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const;
    98   Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const;
    99 
    99 
   100   void Configure80211a (void);
       
   101   void SetEdThresholdDbm (double rxThreshold);
       
   102   void SetRxNoiseDb (double rxNoise);  
       
   103   void SetTxPowerIncrementsDbm (double txPowerBase, 
       
   104                                 double txPowerEnd, 
       
   105                                 int nTxPower);
       
   106   void SetRxTxGainDbm (double rxGainDbm, double txGainDbm);
       
   107   uint32_t GetNModes (void) const;
   100   uint32_t GetNModes (void) const;
   108   WifiMode GetMode (uint32_t mode) const;
   101   WifiMode GetMode (uint32_t mode) const;
   109   uint32_t GetModeBitRate (uint8_t mode) const;
   102   uint32_t GetModeBitRate (uint8_t mode) const;
   110   uint32_t GetNTxpower (void) const;
   103   uint32_t GetNTxpower (void) const;
   111   /* return snr: W/W */
   104   /* return snr: W/W */
   132   typedef std::list<WifiPhyListener *> Listeners;
   125   typedef std::list<WifiPhyListener *> Listeners;
   133   typedef std::list<Ptr<RxEvent> > Events;
   126   typedef std::list<Ptr<RxEvent> > Events;
   134   typedef std::vector <NiChange> NiChanges;
   127   typedef std::vector <NiChange> NiChanges;
   135 
   128 
   136 private:  
   129 private:  
       
   130   void Configure80211a (void);
   137   char const *StateToString (enum WifiPhyState state);
   131   char const *StateToString (enum WifiPhyState state);
   138   enum WifiPhyState GetState (void);
   132   enum WifiPhyState GetState (void);
   139   double GetEdThresholdW (void) const;
   133   double GetEdThresholdW (void) const;
   140   double DbmToW (double dbm) const;
   134   double DbmToW (double dbm) const;
   141   double DbToRatio (double db) const;
   135   double DbToRatio (double db) const;