array of size 1 indexed by 1

47 views
Skip to first unread message

Hassaan Ghazi

unread,
Jul 30, 2015, 6:27:18 PM7/30/15
to OMNeT++ Users
hi,
im running omnet 4.4
during my simulation i get an error which says
array of size 1 indexed by 1  id=22
im not able to find the where the error is because i have so many arrays and i have tried to correct them.
is there any way to find on which line the error is?
ill appreciate the help.

thanks

Alfonso Ariza Quintana

unread,
Jul 31, 2015, 4:00:36 AM7/31/15
to omn...@googlegroups.com

 

You can use the debug, if you set a break point where the message is writing, and using the stack you can determine where the error was detected.

--
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.
Visit this group at http://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Hassaan Ghazi

unread,
Jul 31, 2015, 6:10:51 AM7/31/15
to OMNeT++ Users, hassaan...@gmail.com
i found where the error is,

void Ieee80211AgentSTA::dumpAPList(Ieee80211Prim_ScanConfirm *resp)
{
    EV << "Received AP list:\n";
    for (int i=0; i<(int)resp->getBssListArraySize(); i++)
    {
        Ieee80211Prim_BSSDescription& bssDesc = resp->getBssList(i);
        EV << "    " << i << ". "
           << " address=" << bssDesc.getBSSID()
           << " channel=" << bssDesc.getChannelNumber()
           << " SSID=" << bssDesc.getSSID()
           << " beaconIntvl=" << bssDesc.getBeaconInterval()
           << " rxPower=" << bssDesc.getRxPower()
           << " bandwidth=" << bssDesc.getBandwidth()
           << " delay=" << bssDesc.getDelay()
           << endl;
        // later: supportedRates
    }
}

this loop should run three times as i have 3 APs in my network.
but the value is 1 and does not increase so the loop runs only once.
and this is where the error is generated from

Ieee80211Prim_BSSDescription& Ieee80211Prim_ScanConfirm::getBssList(unsigned int k)
{
    if (k>=bssList_arraysize) throw cRuntimeError("1 Array of size %d indexed by %d", bssList_arraysize, k);
    return bssList_var[k];
}

but i still dont understand how to resolve this error

Alfonso Ariza Quintana

unread,
Jul 31, 2015, 6:52:30 AM7/31/15
to omn...@googlegroups.com

Strange

 

getBssListArraySize() returns bssList_arraysize, with indication, the list should have an element (element 0) and the loop should only execute 1 time (value i = 0), the loop should break after this

--

Hassaan Ghazi

unread,
Jul 31, 2015, 9:47:21 AM7/31/15
to OMNeT++ Users, hassaan...@gmail.com
yes i understand this but i dont understand why is this error is generated.
i added one more AP and added 2 more parameters to the beacon.
but that should be added automatically.
can someone kindly explain about this error.
i would really appreciate the help
thanks

Hassaan Ghazi

unread,
Jul 31, 2015, 7:17:14 PM7/31/15
to OMNeT++ Users, aari...@hotmail.com
i managed to find and correct the error.
and are you sure that the loop would run only once? 
because in inet handover example there are atleast 2 APs so i think this loop would run twice.
I added one more AP so it should run 3 times.
but strangely its running only once.
anyone else would like to comment on this please?
thanks

Hassaan Ghazi

unread,
Aug 1, 2015, 7:48:26 AM8/1/15
to OMNeT++ Users
problem solved.


On Friday, July 31, 2015 at 12:27:18 AM UTC+2, Hassaan Ghazi wrote:
Reply all
Reply to author
Forward
0 new messages