class
NrChAccessManagerThe 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.
Requesting the channel
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().
Configuration
Any channel access manager attribute can be set through the helper methods NrHelper::SetAttribute
on the pointer. The list of attributes is reported below, in the Attributes section.
Introspection did not find any typical Config paths.
Attributes
- GrantDuration: Duration of grant for transmitting.
- Set with class: ns3::TimeValue
- Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
- Initial value: +60000000000.0ns
- Flags: construct write read
No TraceSources are defined for this type.
Size of this type is 56 bytes (on a 64-bit architecture).
Derived classes
- class NrAlwaysOnAccessManager
- A Channel access manager that sees the channel always free for transmitting.
Public types
- using AccessDeniedCallback = std::function<void()>
- A function that signal that the channel is denied and the request should be retried.
- using AccessGrantedCallback = std::function<void(const Time&time)>
- A function that signal that the channel has been earned.
Public static functions
- static auto GetTypeId() -> TypeId
- Get the type ID.
Constructors, destructors, conversion operators
- NrChAccessManager()
- ChannelAccessManager constructor.
- ~NrChAccessManager() override
- ~ChannelAccessManager
Public functions
- void Cancel() pure virtual
- Cancel a previously invoked request for accesing the channel.
- auto GetGrantDuration() const -> Time
- Get grant duration time.
- auto GetNrGnbMac() -> Ptr<NrGnbMac>
- Getter for MAC instance to which is connected this channel access manager.
- auto GetNrSpectrumPhy() -> Ptr<NrSpectrumPhy>
- Getter for spectrum phy instance to which is connected this channel access manager.
- void RequestAccess() pure virtual
- RequestAccess.
- void SetAccessDeniedCallback(const AccessDeniedCallback& cb) pure virtual
- Set Access-Denied Callback.
- void SetAccessGrantedCallback(const AccessGrantedCallback& cb) pure virtual
- Set Access-Granted Callback.
- void SetGrantDuration(Time grantDuration)
- Set duration of grant for transmission.
- void SetNrGnbMac(Ptr<NrGnbMac> mac) virtual
- Set MAC instance for this channel access manager.
- void SetNrSpectrumPhy(Ptr<NrSpectrumPhy> spectrumPhy) virtual
- Set spectrum phy instance for this channel access manager.
Function documentation
Time ns3:: NrChAccessManager:: GetGrantDuration() const
Get grant duration time.
Returns | default grant duration |
---|
Ptr<NrGnbMac> ns3:: NrChAccessManager:: GetNrGnbMac()
Getter for MAC instance to which is connected this channel access manager.
Returns | pointer to MAC instance |
---|
Ptr<NrSpectrumPhy> ns3:: NrChAccessManager:: GetNrSpectrumPhy()
Getter for spectrum phy instance to which is connected this channel access manager.
Returns | pointer to spectrum phy instance |
---|
void ns3:: NrChAccessManager:: RequestAccess() pure virtual
RequestAccess.
When the channel is granted, the callback set with SetAccessGrantedCallback() will be called.
void ns3:: NrChAccessManager:: SetAccessDeniedCallback(const AccessDeniedCallback& cb) pure virtual
Set Access-Denied Callback.
Parameters | |
---|---|
cb | the callback to invoke when the channel access is denied |
void ns3:: NrChAccessManager:: SetAccessGrantedCallback(const AccessGrantedCallback& cb) pure virtual
Set Access-Granted Callback.
Parameters | |
---|---|
cb | the callback to invoke when the channel access is granted |
void ns3:: NrChAccessManager:: SetGrantDuration(Time grantDuration)
Set duration of grant for transmission.
Parameters | |
---|---|
grantDuration | duration of grant |
void ns3:: NrChAccessManager:: SetNrGnbMac(Ptr<NrGnbMac> mac) virtual
Set MAC instance for this channel access manager.
Parameters | |
---|---|
mac | gNB mac instance |
void ns3:: NrChAccessManager:: SetNrSpectrumPhy(Ptr<NrSpectrumPhy> spectrumPhy) virtual
Set spectrum phy instance for this channel access manager.
Parameters | |
---|---|
spectrumPhy | specturm phy instance |