João P.
João P.

Reputation: 55

How to get SIgnal Strength (RSSI) on omnet++ from an inet Radio Model?

I'm working on a routing protocol on omnet++ and I need to get the connection strength or RSSI for decisions purposes. How do I get the signal strength of a wireless connection on a omnet++ simulation between nodes? I've gone through several Radio models descriptions but couldn't find any clear way to simply get the strength of the connection. The closest I got was tha the Radio Model ApskScalarRadio had the minSNIR.

Upvotes: 1

Views: 929

Answers (1)

Joe
Joe

Reputation: 257

Here's an implementation of the method "computeIsReceptionPossible" I used to record the Signal Power in an derived class called "ApskScalarReceiverNotifier", that extends "ApskScalarReceiver". Perhaps this will guide you in an direction that will help.

    bool ApskScalarReceiverNotifier::computeIsReceptionPossible(const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part) const
{
    auto apksTransmission = dynamic_cast<const ApskScalarTransmission *>(reception->getTransmission());

    auto castreception = dynamic_cast<const ScalarReception *>(reception);
    auto strength = castreception->getPower();

    cOutVector powerVector;
    powerVector.setName("powerVector");
    powerVector.record(static_cast<double>(strength.get()));

    return apksTransmission && FlatReceiverBase::computeIsReceptionPossible(listening, reception, part);

}

I'm not a pro at writing C++, however this approach worked perfectly for gathering the statistics.

Upvotes: 1

Related Questions