diff --git a/src/inet/common/INETDefs.h b/src/inet/common/INETDefs.h index 1072233582b..6b4ef98c852 100644 --- a/src/inet/common/INETDefs.h +++ b/src/inet/common/INETDefs.h @@ -167,6 +167,8 @@ extern INET_API OPP_THREAD_LOCAL int evFlags; #define SIMULATION_SHARED_COUNTER(FIELD,...) \ getSimulationOrSharedDataManager()->getSharedCounter((std::string(opp_typename(typeid(*this)))+"::"+#FIELD).c_str(), ## __VA_ARGS__) +#define SIMTIME_DELTA SimTime(std::pow(10.0, SimTime().getScaleExp())) + } // namespace inet #ifdef INET_WITH_SELFDOC diff --git a/src/inet/physicallayer/wireless/common/radio/packetlevel/Radio.cc b/src/inet/physicallayer/wireless/common/radio/packetlevel/Radio.cc index ab6e50421ba..29482551edc 100644 --- a/src/inet/physicallayer/wireless/common/radio/packetlevel/Radio.cc +++ b/src/inet/physicallayer/wireless/common/radio/packetlevel/Radio.cc @@ -535,7 +535,7 @@ bool Radio::isListeningPossible() const const simtime_t now = simTime(); const Coord& position = antenna->getMobility()->getCurrentPosition(); // TODO use 2 * minInterferenceTime for lookahead? or maybe simply use 0 duration listening? - const IListening *listening = receiver->createListening(this, now, now + 1E-12, position, position); + const IListening *listening = receiver->createListening(this, now, now + SIMTIME_DELTA, position, position); const IListeningDecision *listeningDecision = medium->listenOnMedium(this, listening); bool isListeningPossible = listeningDecision->isListeningPossible(); delete listening;