Error setting up SpectrumWifiPhy

33 views
Skip to first unread message

Trail Error

unread,
Jun 6, 2019, 7:08:01 AM6/6/19
to ns-3-users

Hey! I'm new to ns-3.

I am trying to simulate interference between LTE and Wi-Fi using MultiModelSpectrumChannel. However, when I run my code, I get the following error:

msg="SpectrumWifiPhy misses channel and WifiSpectrumPhyInterface objects at initialization time", file=../src/wifi/model/spectrum-wifi-phy.cc, line=92
terminate called without an active exception

I have added WifiSpectrumPhyInterface and channel. But it still shows me the same error? Any help? Following is my code snippet:

Ptr<MultiModelSpectrumChannel> spectrumChannel = CreateObject<MultiModelSpectrumChannel> ();    Ptr<SpectrumWifiPhy> wifiPhy = CreateObject<SpectrumWifiPhy>();
    wifiPhy
-> SetChannel(spectrumChannel);
    wifiPhy
-> CreateWifiSpectrumPhyInterface(staDevices.Get(0));
    uint16_t freq
= 2400;
    uint16_t channelWidth
= 20;
    wifiPhy
->SetFrequency(freq);
    wifiPhy
->SetChannelWidth(channelWidth);
     


Reply all
Reply to author
Forward
0 new messages