phymac-clmsg.cc

Go to the documentation of this file.
00001 
00002 /*
00003  * Copyright (c) 2007 Regents of the SIGNET lab, University of Padova.
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 3. Neither the name of the University of Padova (SIGNET lab) nor the 
00015  *    names of its contributors may be used to endorse or promote products 
00016  *    derived from this software without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00019  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
00020  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
00021  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
00022  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00023  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00024  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
00025  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
00026  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
00027  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
00028  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  */
00030 
00031 
00044 #include "phymac-clmsg.h"
00045 
00046 
00047 ClMessage_t CLMSG_PHY2MAC_ENDTX;
00048 ClMessage_t CLMSG_PHY2MAC_STARTRX;
00049 ClMessage_t CLMSG_PHY2MAC_CCA;
00050 ClMessage_t CLMSG_MAC2PHY_GETTXDURATION;
00051 
00052 ClMsgPhy2MacEndTx::ClMsgPhy2MacEndTx(const Packet* p)
00053   : pkt(p),
00054     ClMessage(CLMSG_PHY2MAC_VERBOSITY, CLMSG_PHY2MAC_ENDTX)
00055 {
00056 }
00057 
00058 ClMessage* ClMsgPhy2MacEndTx::copy()
00059 {
00060   // Supporting only synchronous messages!!!
00061   assert(0);
00062 }
00063 
00064 
00065 
00066 
00067 ClMsgPhy2MacStartRx::ClMsgPhy2MacStartRx(const Packet* p)
00068   : pkt(p),
00069     ClMessage(CLMSG_PHY2MAC_VERBOSITY, CLMSG_PHY2MAC_STARTRX)
00070 {
00071 }
00072 
00073 ClMessage* ClMsgPhy2MacStartRx::copy()
00074 {
00075   // Supporting only synchronous messages!!!
00076   assert(0);
00077 }
00078 
00079 
00080 
00081 ClMsgPhy2MacCCA::ClMsgPhy2MacCCA(bool new_cca)
00082   : CCA(new_cca),
00083     ClMessage(CLMSG_PHY2MAC_VERBOSITY, CLMSG_PHY2MAC_CCA)
00084 {
00085 }
00086 
00087 ClMessage* ClMsgPhy2MacCCA::copy()
00088 {
00089   // Supporting only synchronous messages!!!
00090   assert(0);
00091 }
00092 
00093 // messaggi cross-layer mac2phy
00094 
00095 ClMsgMac2PhyGetTxDuration::ClMsgMac2PhyGetTxDuration(Packet* p)
00096   : pkt(p),
00097     ClMessage(CLMSG_MAC2PHY_VERBOSITY, CLMSG_MAC2PHY_GETTXDURATION)
00098 {
00099 }
00100 
00101 ClMsgMac2PhyGetTxDuration::ClMsgMac2PhyGetTxDuration(int moduleId, Packet*p)
00102   : pkt(p), ClMessage(CLMSG_MAC2PHY_VERBOSITY, CLMSG_MAC2PHY_GETTXDURATION, UNICAST, moduleId)
00103 {
00104 }
00105 
00106 ClMessage* ClMsgMac2PhyGetTxDuration::copy()
00107 {
00108   // Supporting only synchronous messages!!!
00109   assert(0);
00110 }
00111 
00112 
00114 void ClMsgMac2PhyGetTxDuration::setDuration(double time)
00115 {
00116   duration = time;
00117 }
00118 
00119 double ClMsgMac2PhyGetTxDuration::getDuration()
00120 {
00121   return(duration);
00122 }

Generated on Wed Nov 26 15:47:28 2008 for NS-MIRACLE library by  doxygen 1.5.2