Mailing list archive (omnetpp-l at omnetpp.org)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omnetpp-l] SingleChannelRadio.cc of mfo4 question



Hi,
at the line 158 of the file contrib/nic/radios/SingleChannelRadio.cc (full text here)

there is the call of this method:


bool SingleChannelRadio::switchTo(RadioState::States s, simtime_t delta)
{
    bool success = true;
 
    EV << "current state:" << state.getState() << ", last state:" << RadioState::SWITCH_TO_SLEEP
       << " handlingTimer:" << handlingTimer << endl;
    if((state.getState() < RadioState::SWITCH_TO_SLEEP) && (handlingTimer == false))
    {
        state.setState(s);
        scheduleAt(simTime() + delta, timer);
        bb->publishBBItem(stateCat, &state, nicModuleId);
    } else {
  EV << "error, radio couldn't be switched!\n";
        success = false;
    }
    return success;
}

I don't understand why the if condition is always depending on 

"RadioState::SWITCH_TO_SLEEP"

and not on the method input "s", can anybody explain me?


thanks

Giorgio




_______________________________________________
Omnetpp-l mailing list
Omnetpp-l at xxx
http://lists.omnetpp.org/mailman/listinfo/omnetpp-l

Home | Main Index | Thread Index