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