A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
wifi-phy-state-helper.h
Go to the documentation of this file.
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 WIFI_PHY_STATE_HELPER_H
21
#define WIFI_PHY_STATE_HELPER_H
22
23
#include "
wifi-phy.h
"
24
#include "ns3/traced-callback.h"
25
#include "ns3/object.h"
26
#include <vector>
27
28
namespace
ns3 {
29
35
class
WifiPhyStateHelper
:
public
Object
36
{
37
public
:
38
static
TypeId
GetTypeId
(
void
);
39
40
WifiPhyStateHelper
();
41
42
void
SetReceiveOkCallback
(
WifiPhy::RxOkCallback
callback);
43
void
SetReceiveErrorCallback
(
WifiPhy::RxErrorCallback
callback);
44
void
RegisterListener
(
WifiPhyListener
*listener);
45
enum
WifiPhy::State
GetState
(
void
);
46
bool
IsStateCcaBusy
(
void
);
47
bool
IsStateIdle
(
void
);
48
bool
IsStateBusy
(
void
);
49
bool
IsStateRx
(
void
);
50
bool
IsStateTx
(
void
);
51
bool
IsStateSwitching
(
void
);
52
Time
GetStateDuration
(
void
);
53
Time
GetDelayUntilIdle
(
void
);
54
Time
GetLastRxStartTime
(
void
)
const
;
55
56
void
SwitchToTx
(
Time
txDuration,
Ptr<const Packet>
packet,
WifiMode
txMode,
WifiPreamble
preamble, uint8_t txPower);
57
void
SwitchToRx
(
Time
rxDuration);
58
void
SwitchToChannelSwitching
(
Time
switchingDuration);
59
void
SwitchFromRxEndOk
(
Ptr<Packet>
packet,
double
snr,
WifiMode
mode,
enum
WifiPreamble
preamble);
60
void
SwitchFromRxEndError
(
Ptr<const Packet>
packet,
double
snr);
61
void
SwitchMaybeToCcaBusy
(
Time
duration);
62
63
TracedCallback<Time,Time,enum WifiPhy::State>
m_stateLogger
;
64
private
:
65
typedef
std::vector<WifiPhyListener *>
Listeners
;
66
67
void
LogPreviousIdleAndCcaBusyStates
(
void
);
68
69
void
NotifyTxStart
(
Time
duration);
70
void
NotifyWakeup
(
void
);
71
void
NotifyRxStart
(
Time
duration);
72
void
NotifyRxEndOk
(
void
);
73
void
NotifyRxEndError
(
void
);
74
void
NotifyMaybeCcaBusyStart
(
Time
duration);
75
void
NotifySwitchingStart
(
Time
duration);
76
void
DoSwitchFromRx
(
void
);
77
78
bool
m_rxing
;
79
Time
m_endTx
;
80
Time
m_endRx
;
81
Time
m_endCcaBusy
;
82
Time
m_endSwitching
;
83
Time
m_startTx
;
84
Time
m_startRx
;
85
Time
m_startCcaBusy
;
86
Time
m_startSwitching
;
87
Time
m_previousStateChangeTime
;
88
89
Listeners
m_listeners
;
90
TracedCallback<Ptr<const Packet>
, double,
WifiMode
,
enum
WifiPreamble
>
m_rxOkTrace
;
91
TracedCallback<Ptr<const Packet>
,
double
>
m_rxErrorTrace
;
92
TracedCallback<Ptr<const Packet>
,
WifiMode
,
WifiPreamble
,uint8_t>
m_txTrace
;
93
WifiPhy::RxOkCallback
m_rxOkCallback
;
94
WifiPhy::RxErrorCallback
m_rxErrorCallback
;
95
};
96
97
}
// namespace ns3
98
99
#endif
/* WIFI_PHY_STATE_HELPER_H */
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::WifiPhyStateHelper::DoSwitchFromRx
void DoSwitchFromRx(void)
Definition:
wifi-phy-state-helper.cc:392
ns3::WifiPhyStateHelper::GetStateDuration
Time GetStateDuration(void)
Definition:
wifi-phy-state-helper.cc:117
ns3::Ptr< const Packet >
ns3::Callback< void, Ptr< Packet >, double, WifiMode, enum WifiPreamble >
ns3::WifiPhyStateHelper::m_stateLogger
TracedCallback< Time, Time, enum WifiPhy::State > m_stateLogger
Definition:
wifi-phy-state-helper.h:63
ns3::WifiPhyStateHelper::NotifyWakeup
void NotifyWakeup(void)
ns3::WifiPhyStateHelper::m_endCcaBusy
Time m_endCcaBusy
Definition:
wifi-phy-state-helper.h:81
ns3::WifiPhy::State
State
Definition:
wifi-phy.h:123
ns3::TracedCallback
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Definition:
traced-callback.h:43
ns3::WifiPhyStateHelper::m_startCcaBusy
Time m_startCcaBusy
Definition:
wifi-phy-state-helper.h:85
ns3::WifiPhyStateHelper::m_endTx
Time m_endTx
Definition:
wifi-phy-state-helper.h:79
ns3::WifiPhyStateHelper::SwitchToChannelSwitching
void SwitchToChannelSwitching(Time switchingDuration)
Definition:
wifi-phy-state-helper.cc:324
ns3::WifiPhyStateHelper::NotifyRxEndError
void NotifyRxEndError(void)
Definition:
wifi-phy-state-helper.cc:210
ns3::WifiPhyStateHelper::SetReceiveOkCallback
void SetReceiveOkCallback(WifiPhy::RxOkCallback callback)
Definition:
wifi-phy-state-helper.cc:68
ns3::WifiMode
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition:
wifi-mode.h:91
ns3::WifiPhyStateHelper::Listeners
std::vector< WifiPhyListener * > Listeners
Definition:
wifi-phy-state-helper.h:65
ns3::WifiPhyStateHelper::SwitchToTx
void SwitchToTx(Time txDuration, Ptr< const Packet > packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower)
Definition:
wifi-phy-state-helper.cc:255
ns3::WifiPreamble
WifiPreamble
Definition:
wifi-preamble.h:29
ns3::WifiPhyStateHelper::IsStateIdle
bool IsStateIdle(void)
Definition:
wifi-phy-state-helper.cc:84
ns3::WifiPhyStateHelper::GetDelayUntilIdle
Time GetDelayUntilIdle(void)
Definition:
wifi-phy-state-helper.cc:123
ns3::WifiPhyStateHelper::m_endSwitching
Time m_endSwitching
Definition:
wifi-phy-state-helper.h:82
ns3::WifiPhyStateHelper::m_rxOkTrace
TracedCallback< Ptr< const Packet >, double, WifiMode, enum WifiPreamble > m_rxOkTrace
Definition:
wifi-phy-state-helper.h:90
ns3::WifiPhyStateHelper::IsStateSwitching
bool IsStateSwitching(void)
Definition:
wifi-phy-state-helper.cc:109
ns3::WifiPhyStateHelper::NotifyTxStart
void NotifyTxStart(Time duration)
Definition:
wifi-phy-state-helper.cc:186
ns3::WifiPhyListener
receive notifications about phy events.
Definition:
wifi-phy.h:44
ns3::WifiPhyStateHelper::NotifySwitchingStart
void NotifySwitchingStart(Time duration)
Definition:
wifi-phy-state-helper.cc:226
ns3::WifiPhyStateHelper::m_endRx
Time m_endRx
Definition:
wifi-phy-state-helper.h:80
ns3::WifiPhyStateHelper::IsStateRx
bool IsStateRx(void)
Definition:
wifi-phy-state-helper.cc:99
ns3::WifiPhyStateHelper::m_previousStateChangeTime
Time m_previousStateChangeTime
Definition:
wifi-phy-state-helper.h:87
ns3::WifiPhyStateHelper::SetReceiveErrorCallback
void SetReceiveErrorCallback(WifiPhy::RxErrorCallback callback)
Definition:
wifi-phy-state-helper.cc:73
ns3::WifiPhyStateHelper::NotifyMaybeCcaBusyStart
void NotifyMaybeCcaBusyStart(Time duration)
Definition:
wifi-phy-state-helper.cc:218
ns3::WifiPhyStateHelper::m_rxErrorCallback
WifiPhy::RxErrorCallback m_rxErrorCallback
Definition:
wifi-phy-state-helper.h:94
ns3::WifiPhyStateHelper::WifiPhyStateHelper
WifiPhyStateHelper()
Definition:
wifi-phy-state-helper.cc:52
ns3::WifiPhyStateHelper::SwitchFromRxEndError
void SwitchFromRxEndError(Ptr< const Packet > packet, double snr)
Definition:
wifi-phy-state-helper.cc:380
ns3::WifiPhyStateHelper::m_startSwitching
Time m_startSwitching
Definition:
wifi-phy-state-helper.h:86
ns3::WifiPhyStateHelper::m_startTx
Time m_startTx
Definition:
wifi-phy-state-helper.h:83
ns3::WifiPhyStateHelper::NotifyRxEndOk
void NotifyRxEndOk(void)
Definition:
wifi-phy-state-helper.cc:202
ns3::WifiPhyStateHelper::SwitchFromRxEndOk
void SwitchFromRxEndOk(Ptr< Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
Definition:
wifi-phy-state-helper.cc:368
ns3::WifiPhyStateHelper::GetTypeId
static TypeId GetTypeId(void)
Definition:
wifi-phy-state-helper.cc:32
ns3::WifiPhyStateHelper::GetState
enum WifiPhy::State GetState(void)
Definition:
wifi-phy-state-helper.cc:160
ns3::WifiPhyStateHelper::IsStateBusy
bool IsStateBusy(void)
Definition:
wifi-phy-state-helper.cc:89
wifi-phy.h
ns3::WifiPhyStateHelper::m_startRx
Time m_startRx
Definition:
wifi-phy-state-helper.h:84
ns3::WifiPhyStateHelper
Definition:
wifi-phy-state-helper.h:35
ns3::WifiPhyStateHelper::IsStateCcaBusy
bool IsStateCcaBusy(void)
Definition:
wifi-phy-state-helper.cc:94
ns3::WifiPhyStateHelper::m_txTrace
TracedCallback< Ptr< const Packet >, WifiMode, WifiPreamble, uint8_t > m_txTrace
Definition:
wifi-phy-state-helper.h:92
ns3::WifiPhyStateHelper::m_listeners
Listeners m_listeners
Definition:
wifi-phy-state-helper.h:89
ns3::WifiPhyStateHelper::m_rxing
bool m_rxing
Definition:
wifi-phy-state-helper.h:78
ns3::WifiPhyStateHelper::m_rxErrorTrace
TracedCallback< Ptr< const Packet >, double > m_rxErrorTrace
Definition:
wifi-phy-state-helper.h:91
ns3::WifiPhyStateHelper::IsStateTx
bool IsStateTx(void)
Definition:
wifi-phy-state-helper.cc:104
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::WifiPhyStateHelper::SwitchToRx
void SwitchToRx(Time rxDuration)
Definition:
wifi-phy-state-helper.cc:292
ns3::WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates
void LogPreviousIdleAndCcaBusyStates(void)
Definition:
wifi-phy-state-helper.cc:235
ns3::WifiPhyStateHelper::GetLastRxStartTime
Time GetLastRxStartTime(void) const
Definition:
wifi-phy-state-helper.cc:154
ns3::WifiPhyStateHelper::NotifyRxStart
void NotifyRxStart(Time duration)
Definition:
wifi-phy-state-helper.cc:194
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::WifiPhyStateHelper::RegisterListener
void RegisterListener(WifiPhyListener *listener)
Definition:
wifi-phy-state-helper.cc:78
ns3::WifiPhyStateHelper::SwitchMaybeToCcaBusy
void SwitchMaybeToCcaBusy(Time duration)
Definition:
wifi-phy-state-helper.cc:405
ns3::WifiPhyStateHelper::m_rxOkCallback
WifiPhy::RxOkCallback m_rxOkCallback
Definition:
wifi-phy-state-helper.h:93
src
wifi
model
wifi-phy-state-helper.h
Generated on Sat Nov 16 2013 16:17:55 for ns-3 by
1.8.5