00001 #ifndef SIMPLEMACLAYER_H_
00002 #define SIMPLEMACLAYER_H_
00003
00004 #include <omnetpp.h>
00005 #include "MacToPhyInterface.h"
00006 #include "MacToPhyControlInfo.h"
00007 #include "Signal_.h"
00008 #include "MacPkt_m.h"
00009 #include "BaseModule.h"
00010
00021 class SimpleMacLayer:public BaseModule {
00022 protected:
00024 MacToPhyInterface* phy;
00025
00027 int dataOut;
00028 int dataIn;
00029
00030 int myIndex;
00031
00033 int nextReceiver;
00034
00035 enum {
00037 TEST_MACPKT = 12121
00038 };
00039
00041 DimensionSet dimensions;
00042
00043 protected:
00044
00049 Mapping* createMapping(simtime_t time, simtime_t length, double freqFrom, double freqTo, double value);
00050
00051 void handleMacPkt(MacPkt* pkt);
00052 void handleTXOver();
00053
00057 void broadCastPacket();
00058
00059 void sendDown(MacPkt* pkt);
00060
00064 MacPkt* createMacPkt(simtime_t length);
00065
00066 void log(std::string msg);
00067
00068 public:
00069
00070 virtual void initialize(int stage);
00071
00072 virtual void handleMessage(cMessage* msg);
00073 };
00074
00075 #endif