src/devices/wifi/cr-mac-stations.h
changeset 2545 7a38029a2e5b
parent 2544 2e6e1a6e0d94
child 2546 3fc951966b1b
equal deleted inserted replaced
2544:2e6e1a6e0d94 2545:7a38029a2e5b
     1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2005,2006 INRIA
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License version 2 as 
       
     7  * published by the Free Software Foundation;
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    17  *
       
    18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
       
    19  */
       
    20 #ifndef CR_MAC_STATIONS_H
       
    21 #define CR_MAC_STATIONS_H
       
    22 
       
    23 #include <stdint.h>
       
    24 
       
    25 #include "mac-stations.h"
       
    26 
       
    27 namespace ns3 {
       
    28 
       
    29 /**
       
    30  * \brief use constant rates for data and control transmissions
       
    31  *
       
    32  * This class uses always the same transmission rate for every
       
    33  * packet sent.
       
    34  */
       
    35 class CrMacStations : public MacStations 
       
    36 {
       
    37 public:
       
    38   CrMacStations (WifiMode dataMode, WifiMode ctlMode);
       
    39   virtual ~CrMacStations ();
       
    40 
       
    41   WifiMode GetDataMode (void) const;
       
    42   WifiMode GetCtlMode (void) const;
       
    43 private:
       
    44   virtual class MacStation *CreateStation (void);
       
    45 
       
    46   WifiMode m_dataMode;
       
    47   WifiMode m_ctlMode;
       
    48 };
       
    49 
       
    50 
       
    51 class CrMacStation : public MacStation
       
    52 {
       
    53 public:
       
    54   CrMacStation (CrMacStations *stations);
       
    55   virtual ~CrMacStation ();
       
    56 
       
    57   virtual void ReportRxOk (double rxSnr, WifiMode txMode);
       
    58   virtual void ReportRtsFailed (void);
       
    59   virtual void ReportDataFailed (void);
       
    60   virtual void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr);
       
    61   virtual void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr);
       
    62   virtual void ReportFinalRtsFailed (void);
       
    63   virtual void ReportFinalDataFailed (void);
       
    64 
       
    65 private:
       
    66   virtual CrMacStations *GetStations (void) const;
       
    67   virtual WifiMode DoGetDataMode (uint32_t size);
       
    68   virtual WifiMode DoGetRtsMode (void);
       
    69   CrMacStations *m_stations;
       
    70 };
       
    71 
       
    72 } // namespace ns3
       
    73 
       
    74 
       
    75 
       
    76 #endif /* CR_MAC_STATIONS_H */