00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef UWBIRMAC_H
00034 #define UWBIRMAC_H
00035
00036 #include "BaseMacLayer.h"
00037 #include "Decider.h"
00038 #include "MacToPhyControlInfo.h"
00039 #include "PhyToMacControlInfo.h"
00040 #include "Signal_.h"
00041 #include "MacToPhyInterface.h"
00042 #include "UWBIRMacPkt_m.h"
00043 #include "IEEE802154A.h"
00044 #include "RadioUWBIR.h"
00045 #include "DeciderResultUWBIR.h"
00046 #include "Packet.h"
00047 #include "UWBIRMacPkt.h"
00048 #include <vector>
00049 #include <utility>
00050
00051 using namespace std;
00052
00053
00064 class UWBIRMac : public BaseMacLayer {
00065
00066 public:
00067
00068 virtual void initialize(int stage);
00069
00070 virtual void finish();
00071
00072 UWBIRMac(): packet(100) { }
00073
00074 protected:
00075 bool debug;
00076 bool stats;
00077 bool trace;
00078 bool rsDecoder;
00079 bool packetsAlwaysValid;
00080 double totalRxBits, errRxBits;
00081 MacToPhyInterface* phy;
00082 Packet packet;
00083 int catPacket;
00084 int prf;
00085 cOutVector packetsBER;
00086 cOutVector dataLengths;
00087 cOutVector erroneousSymbols;
00088 cOutVector sentPulses;
00089 cOutVector receivedPulses;
00090 cOutVector meanPacketBER;
00091 cOutVector packetSuccessRate;
00092 cOutVector packetSuccessRateNoRS;
00093 cOutVector ber;
00094 cStdDev meanBER;
00095 cOutVector RSErrorRate;
00096 cOutVector success, successNoRS;
00097
00098 long nbReceivedPacketsNoRS, nbReceivedPacketsRS;
00099 long nbSentPackets;
00100 long nbSymbolErrors, nbSymbolsReceived;
00101 long nbHandledRxPackets;
00102 long nbFramesDropped;
00103
00104
00105 void prepareData(UWBIRMacPkt* packet, IEEE802154A::config cfg = IEEE802154A::cfg_mandatory_4M);
00106
00107 void handleLowerMsg(cPacket *msg);
00108
00109 bool validatePacket(UWBIRMacPkt * mac);
00110
00111 void initCounters();
00112
00113 };
00114
00115 #endif // UWBIRMAC_H
00116