/home/ltracy/workspace/NSUAN/uan/uan-mac.h

00001 #ifndef UANMAC_H_
00002 #define UANMAC_H_
00003 
00036 #define UAN_MAC_DEFAULTCW 10
00037 #define UAN_MAC_DEFAULTSS 0.5
00038 #define MAC_DEBUGF
00039 
00040 #include "mac.h"
00041 #include "uan-phy.h"
00042 #include "uan-tools.h"
00043 
00044 
00045 #include "packet.h"
00046 
00047 
00048 class UanPhy;
00049 
00050 class UanMac : public Mac {
00051         friend class UanEventTimer;
00052         
00053 public:
00055         UanMac();
00056 
00064         virtual void recv(Packet *p, Handler *h);
00065         
00074         virtual void send(Packet *p, Handler *h);
00075         
00086         virtual int     command(int argc, const char*const* argv);
00087         
00089         virtual void transStateChange(int s);
00090         
00092         double bw();
00093         
00094 protected:
00096         int CW;
00097         
00099         double slotSize;
00100         
00102         double bandwidth;
00103         
00105         bool useCS;
00106         
00108         void startSendTimer(void);
00109         
00111         UanEventTimer *sendTimer;
00112         
00114         static void sendHandler(void *);
00115         
00117         double sendTime;
00118         
00120         Packet *pktTx;
00122         Handler *hanTx;
00123         
00125         UanPhy *phy;
00126         
00128         void debugf(char *fmt, ...);
00129 };
00130 #endif /*UANMAC_H_*/

Generated on Mon Oct 1 12:12:43 2007 for UANModule by  doxygen 1.5.1