ChannelControl Class Reference

Simu5G: ChannelControl Class Reference
Simu5G

#include <ChannelControl.h>

Inheritance diagram for ChannelControl:
[legend]

Public Member Functions

RadioRef registerRadio (cModule *radioModule, cGate *radioInGate=nullptr) override
void unregisterRadio (RadioRef r) override
cModule * getRadioModule (RadioRef r) const override
cGate * getRadioGate (RadioRef r) const override
int getRadioChannel (RadioRef r) const override
void setRadioPosition (RadioRef r, const inet::Coord &pos) override
void setRadioChannel (RadioRef r, int channel) override
int getNumChannels () override
const TransmissionList & getOngoingTransmissions (int channel) override
void sendToChannel (RadioRef srcRadio, AirFrame *airFrame) override
double getInterferenceRange (RadioRef r) override
void disableReception (RadioRef r) override
void enableReception (RadioRef r) override
double getPropagationSpeed () override

Protected Types

typedef std::vector< TransmissionList > ChannelTransmissionLists

Protected Member Functions

virtual double calcInterfDist ()
void initialize (int stage) override
virtual void purgeOngoingTransmissions ()
virtual void checkChannel (int channel)
virtual const RadioRefVector & getNeighbors (RadioRef h)
virtual void addOngoingTransmission (RadioRef h, AirFrame *frame)
virtual RadioRef lookupRadio (cModule *radioModule)

Protected Attributes

simtime_t lastOngoingTransmissionsUpdate = 0
double maxInterferenceDistance
int numChannels

Detailed Description

Monitors which radios are "in range". Supports multiple channels.

See also
ChannelAccess

Member Typedef Documentation

◆ ChannelTransmissionLists

typedef std::vector<TransmissionList> ChannelTransmissionLists
protected

keeps track of ongoing transmissions; this is needed when a radio switches to another channel (then it needs to know whether the target channel is empty or busy)

Member Function Documentation

◆ calcInterfDist()

virtual double calcInterfDist ( )
protectedvirtual

Calculate interference distance

Reimplemented in LteChannelControl.

◆ initialize()

void initialize ( int stage)
overrideprotected

Reads init parameters and calculates a maximum interference distance

◆ purgeOngoingTransmissions()

virtual void purgeOngoingTransmissions ( )
protectedvirtual

Throws away expired transmissions.

◆ checkChannel()

virtual void checkChannel ( int channel)
protectedvirtual

Validate the channel identifier

◆ getNeighbors()

virtual const RadioRefVector & getNeighbors ( RadioRef h)
protectedvirtual

Get the list of modules in range of the given host

◆ addOngoingTransmission()

virtual void addOngoingTransmission ( RadioRef h,
AirFrame * frame )
protectedvirtual

Notifies the channel control with an ongoing transmission

◆ lookupRadio()

virtual RadioRef lookupRadio ( cModule * radioModule)
protectedvirtual

Returns the "handle" of a previously registered radio. The pointer to the registering (radio) module must be provided

◆ registerRadio()

RadioRef registerRadio ( cModule * radioModule,
cGate * radioInGate = nullptr )
overridevirtual

Registers the given radio. If radioInGate==NULL, the "radioIn" gate is assumed

Implements IChannelControl.

◆ unregisterRadio()

void unregisterRadio ( RadioRef r)
overridevirtual

Unregisters the given radio

Implements IChannelControl.

◆ getRadioModule()

cModule * getRadioModule ( RadioRef r) const
inlineoverridevirtual

Returns the host module that contains the given radio

Implements IChannelControl.

◆ getRadioGate()

cGate * getRadioGate ( RadioRef r) const
inlineoverridevirtual

Returns the input gate of the host for receiving AirFrames

Implements IChannelControl.

◆ getRadioChannel()

int getRadioChannel ( RadioRef r) const
inlineoverridevirtual

Returns the channel the given radio listens on

Implements IChannelControl.

◆ setRadioPosition()

void setRadioPosition ( RadioRef r,
const inet::Coord & pos )
overridevirtual

To be called when the host moved; updates proximity info

Implements IChannelControl.

◆ setRadioChannel()

void setRadioChannel ( RadioRef r,
int channel )
overridevirtual

Called when host switches channel

Implements IChannelControl.

◆ getNumChannels()

int getNumChannels ( )
inlineoverridevirtual

Returns the number of radio channels (frequencies) simulated

Implements IChannelControl.

References numChannels.

◆ getOngoingTransmissions()

const TransmissionList & getOngoingTransmissions ( int channel)
overridevirtual

Provides a list of transmissions currently on the air

Implements IChannelControl.

◆ sendToChannel()

void sendToChannel ( RadioRef srcRadio,
AirFrame * airFrame )
overridevirtual

Called from ChannelAccess, to transmit a frame to the radios in range, on the frame's channel

Implements IChannelControl.

Reimplemented in LteChannelControl.

◆ getInterferenceRange()

double getInterferenceRange ( RadioRef r)
inlineoverridevirtual

Returns the maximum interference distance

Implements IChannelControl.

References maxInterferenceDistance.

◆ disableReception()

void disableReception ( RadioRef r)
inlineoverridevirtual

Disable the reception in the reference module

Implements IChannelControl.

◆ enableReception()

void enableReception ( RadioRef r)
inlineoverridevirtual

Enable the reception in the reference module

Implements IChannelControl.

◆ getPropagationSpeed()

double getPropagationSpeed ( )
inlineoverridevirtual

Returns propagation speed of the signal in meters/sec

Implements IChannelControl.

Member Data Documentation

◆ lastOngoingTransmissionsUpdate

simtime_t lastOngoingTransmissionsUpdate = 0
protected

used to clear the transmission list from time to time

◆ maxInterferenceDistance

double maxInterferenceDistance
protected

the maximum interference distance in the network.

Referenced by getInterferenceRange().

◆ numChannels

int numChannels
protected

the number of controlled channels

Referenced by getNumChannels().