如何从inet无线电模型中获得omnet ++上的信号强度(RSSI)?

时间:2019-04-02 11:55:03

标签: omnet++ inet

我正在使用omnet ++上的路由协议,因此我需要获取连接强度或RSSI以用于决策目的。 如何在节点之间的omnet ++模拟中获得无线连接的信号强度? 我已经看过一些Radio模型的描述,但是找不到简单的方法来简单地获得连接的强度。我最接近的是无线电模型ApskScalarRadio的minSNIR。

1 个答案:

答案 0 :(得分:0)

这是方法“ computeIsReceptionPossible”的实现,我用来将信号功率记录在名为“ ApskScalarReceiverNotifier”的派生类中,该派生类扩展了“ ApskScalarReceiver”。也许这会引导您朝着有帮助的方向前进。

    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);

}

我不是编写C ++的专家,但是这种方法非常适合收集统计信息。