5G-LENA nr-v3.1-14-g738b08bc
The 5G/NR module for the ns-3 simulator
|
The Channel Access Manager class. More...
#include "nr-ch-access-manager.h"
Public Types | |
typedef std::function< void()> | AccessDeniedCallback |
A function that signal that the channel is denied and the request should be retried. | |
typedef std::function< void(const Time &time)> | AccessGrantedCallback |
A function that signal that the channel has been earned. | |
Public Member Functions | |
NrChAccessManager () | |
ChannelAccessManager constructor. | |
~NrChAccessManager () override | |
~ChannelAccessManager | |
virtual void | Cancel ()=0 |
Cancel a previously invoked request for accessing the channel. | |
Time | GetGrantDuration () const |
Get grant duration time. | |
Ptr< NrGnbMac > | GetNrGnbMac () |
Getter for MAC instance to which is connected this channel access manager. | |
Ptr< NrSpectrumPhy > | GetNrSpectrumPhy () |
Getter for spectrum phy instance to which is connected this channel access manager. | |
virtual void | RequestAccess ()=0 |
RequestAccess. | |
virtual void | SetAccessDeniedCallback (const AccessDeniedCallback &cb)=0 |
Set Access-Denied Callback. | |
virtual void | SetAccessGrantedCallback (const AccessGrantedCallback &cb)=0 |
Set Access-Granted Callback. | |
void | SetGrantDuration (Time grantDuration) |
Set duration of grant for transmission. | |
virtual void | SetNrGnbMac (Ptr< NrGnbMac > mac) |
Set MAC instance for this channel access manager. | |
virtual void | SetNrSpectrumPhy (Ptr< NrSpectrumPhy > spectrumPhy) |
Set spectrum phy instance for this channel access manager. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
The Channel Access Manager class.
This is the interface for any channel access manager. A channel access manager is responsible to listen to the channel, informing the PHY when it is free for transmitting.
The PHY would call the method RequestAccess(). Then, when the channel is available for transmission, the channel access manager would call the callback set with the method SetAccessGrantedCallback(). If the channel cannot be access, then the callback set with SetAccessDeniedCallback() will be called, instead. The request can be cancelled by calling Cancel().
Any channel access manager attribute can be set through the helper methods NrHelper::SetUeChannelAccessManagerAttribute() or NrHelper::SetGnbChannelAccessManagerAttribute(). Another option is directly calling SetAttribute
on the pointer. The list of attributes is reported below, in the Attributes section.
Introspection did not find any typical Config paths.
No TraceSources are defined for this type.
Size of this type is 80 bytes (on a 64-bit architecture).
Definition at line 46 of file nr-ch-access-manager.h.
typedef std::function<void()> ns3::NrChAccessManager::AccessDeniedCallback |
A function that signal that the channel is denied and the request should be retried.
Definition at line 85 of file nr-ch-access-manager.h.
typedef std::function<void(const Time& time)> ns3::NrChAccessManager::AccessGrantedCallback |
A function that signal that the channel has been earned.
Definition at line 80 of file nr-ch-access-manager.h.
ns3::NrChAccessManager::NrChAccessManager | ( | ) |
ChannelAccessManager constructor.
Definition at line 31 of file nr-ch-access-manager.cc.
|
override |
~ChannelAccessManager
Definition at line 36 of file nr-ch-access-manager.cc.
|
pure virtual |
Cancel a previously invoked request for accessing the channel.
Implemented in ns3::NrAlwaysOnAccessManager.
Time ns3::NrChAccessManager::GetGrantDuration | ( | ) | const |
Get grant duration time.
Definition at line 49 of file nr-ch-access-manager.cc.
Referenced by GetTypeId().
Ptr< NrGnbMac > ns3::NrChAccessManager::GetNrGnbMac | ( | ) |
Getter for MAC instance to which is connected this channel access manager.
Definition at line 77 of file nr-ch-access-manager.cc.
Ptr< NrSpectrumPhy > ns3::NrChAccessManager::GetNrSpectrumPhy | ( | ) |
Getter for spectrum phy instance to which is connected this channel access manager.
Definition at line 63 of file nr-ch-access-manager.cc.
|
static |
Get the type ID.
Definition at line 17 of file nr-ch-access-manager.cc.
References GetGrantDuration(), and SetGrantDuration().
|
pure virtual |
RequestAccess.
When the channel is granted, the callback set with SetAccessGrantedCallback() will be called.
Implemented in ns3::NrAlwaysOnAccessManager.
|
pure virtual |
Set Access-Denied Callback.
cb | the callback to invoke when the channel access is denied |
Implemented in ns3::NrAlwaysOnAccessManager.
|
pure virtual |
Set Access-Granted Callback.
cb | the callback to invoke when the channel access is granted |
Implemented in ns3::NrAlwaysOnAccessManager.
void ns3::NrChAccessManager::SetGrantDuration | ( | Time | grantDuration | ) |
Set duration of grant for transmission.
grantDuration | duration of grant |
Definition at line 42 of file nr-ch-access-manager.cc.
Referenced by GetTypeId().
|
virtual |
Set MAC instance for this channel access manager.
mac | gNB mac instance |
Definition at line 70 of file nr-ch-access-manager.cc.
|
virtual |
Set spectrum phy instance for this channel access manager.
spectrumPhy | spectrum phy instance |
Definition at line 56 of file nr-ch-access-manager.cc.