INET: casting error in layered apsk transmission

47 views
Skip to first unread message

n.airscor

unread,
Sep 6, 2019, 3:24:41 AM9/6/19
to OMNeT++ Users
Hello everybody!

I am working on INET layered transmission for my project and am using 5 nodes having APSK Layered Transmitter and Receiver.

The problem is that whenever one of the radios transmits, the following runtime error occurs:

check_and_cast(): Cannot cast (inet::physicallayer::LayeredReception*) to type 'const inet::physicallayer::ScalarReception *' -- in module (inet::physicallayer::ApskRadio)

This happens in the following code fragment  in the ApskLayeredReciver::computeNoise():

for (auto reception : *interferingReceptions) {
        const ISignalAnalogModel *signalAnalogModel = reception->getAnalogModel();
        const INarrowbandSignal *narrowbandSignalAnalogModel = check_and_cast<const INarrowbandSignal *>(signalAnalogModel);
        Hz signalCarrierFrequency = narrowbandSignalAnalogModel->getCarrierFrequency();
        Hz signalBandwidth = narrowbandSignalAnalogModel->getBandwidth();
        if (commonCarrierFrequency == signalCarrierFrequency && commonBandwidth >= signalBandwidth)
            addReception(check_and_cast<const ScalarReception *>(reception), noiseStartTime, noiseEndTime, powerChanges);

I tried to recreate this error in layeredApsk example but found that in that case, the control nevers flows into the for loop.

Can anyone please help me with this?

bests,
Nikita  

Levente Mészáros

unread,
Sep 10, 2019, 8:20:02 AM9/10/19
to OMNeT++ Discussion List
Thanks for reporting this issue. Indeed, the ScalarAnalogModelBase::computeNoise function assumes that the reception is a ScalarReception, but this is not the case when a layered model is used. A new code path has to be added in the above function which handles the LayeredReception with a ScalarSignalAnalogModel inside.

I would like to suggest adding a new bug to the INET github page with an example to reproduce this.

Regards,
levy

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/3c76b373-8e5d-48e1-92cd-11c988827005%40googlegroups.com.

n.airscor

unread,
Sep 10, 2019, 10:15:32 AM9/10/19
to OMNeT++ Users
Hi!

Thanks for the reply!

I'm sure I'm missing something but this error doesn't occur in case of the layeredApsk example with more than 2 radios. All the initial parameter settings fo both the layeredApsk and my own ini file are either the same or comparable. Would this still be a "reportable" bug or an issue with my setup?
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages