Hi all, I am trying to implement in ns2 a period timer in Mac class level. However, it is generating a infinite loop. Please, see my implementation:
//.h class MyTimer : public Mac802_15_4Timer { public: MyTimer(MacClass *a) : Mac802_15_4Timer() {a_=a;} virtual void handle(Event *e); protected: MacClass *a_; }; //.cc void MyTimer::handle(Event *e) { a_->Test(); } void MacClass::Test() {o myTimer->start(0.5); // periodic timer 0.5 seconds } How can I use the stop method of Timer function to implement periodic event in MAC layer? I did the same procedure on Routing layer and it is possible! What is wrong? Thanks in advance. Jose Aguiar