TestRadio.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // Copyright (C) 2013 Opensim Ltd.
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser General Public License
  6. // as published by the Free Software Foundation; either version 2
  7. // of the License, or (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. //
  17. // author: Levente Meszaros (levy@omnetpp.org)
  18. //
  19. #ifndef __INET_TESTRADIO_H_
  20. #define __INET_TESTRADIO_H_
  21. #include "inet/common/INETDefs.h"
  22. #include "inet/common/lifecycle/ILifecycle.h"
  23. namespace inet {
  24. class INET_API TestRadio : public cSimpleModule, public ILifecycle {
  25. private:
  26. bool receiverTurnedOn;
  27. bool transmitterTurnedOn;
  28. cMessage turnOnReceiver;
  29. cMessage turnOffReceiver;
  30. cMessage turnOnTransmitter;
  31. cMessage turnOffTransmitter;
  32. IDoneCallback * doneCallback;
  33. public:
  34. TestRadio() { }
  35. virtual bool handleOperationStage(LifecycleOperation *operation, int stage, IDoneCallback *doneCallback);
  36. protected:
  37. virtual void initialize(int stage);
  38. virtual void handleMessage(cMessage * message);
  39. };
  40. }
  41. #endif