1

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.

João P.
  • 55
  • 6
  • Possible duplicate of [OMNET++: How to obtain wireless signal power?](https://stackoverflow.com/questions/51365240/omnet-how-to-obtain-wireless-signal-power) – Rudi Apr 02 '19 at 12:05
  • That unfortunately doesn't help me with my question. – João P. Apr 02 '19 at 12:14
  • Hmm. As far as I see, it answers exactly your question. You want to have information about the received packet's signal to noise ration in an upper layer. The above question contains code sample that shows exactly how to do that... – Rudi Apr 02 '19 at 12:22

1 Answers1

1

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.

Joe
  • 216
  • 4
  • 18