DESERT 4.0.0
uw-phy-WakeUp.h
Go to the documentation of this file.
1//
2// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28//
29
39#ifndef UW_WAKEUP_H
40#define UW_WAKEUP_H
41
42#include "wake-up-pkt-hdr.h"
43#include <map>
44#include <mphy.h>
45
46#define UW_WAKEUP_MODNAME "WKUP"
47#define DROP_REASON_BELOW_THRESHOLD "DBT"
48
52class MPhy_WakeUp : public MPhy
53{
54
55public:
63 virtual ~MPhy_WakeUp();
69 virtual int getModulationType(Packet *);
75 virtual double
76 getTxDuration(Packet *p)
77 {
78 return (ToneDuration_);
79 }
86 virtual double getPER(double snr, int nbits);
91 virtual int
106 virtual int command(int argc, const char *const *argv);
107
108protected:
113 virtual void startTx(Packet *p);
118 virtual void endTx(Packet *p);
123 virtual void startRx(Packet *p);
129 virtual void endRx(Packet *p);
135 virtual double getNoisePower(Packet *p);
142 virtual MSpectralMask *getTxSpectralMask(Packet *p);
147 virtual void dropPacket(Packet *p);
151 void
156
160 virtual void waitForUser();
161
162 Packet *PktRx;
164 static bool
166 static int modid;
168
169 /* input */
176 double MaxTxRange_;
180};
181
182#endif /* UW_WAKEUP_H */
Definition uw-phy-WakeUp.h:53
bool txActive
Definition uw-phy-WakeUp.h:167
virtual double getTxDuration(Packet *p)
Definition uw-phy-WakeUp.h:76
virtual void endRx(Packet *p)
Definition uw-phy-WakeUp.cpp:318
virtual void endTx(Packet *p)
Definition uw-phy-WakeUp.cpp:210
virtual ~MPhy_WakeUp()
Definition uw-phy-WakeUp.cpp:120
MPhy_WakeUp()
Definition uw-phy-WakeUp.cpp:106
Packet * PktRx
Definition uw-phy-WakeUp.h:162
double MaxTxRange_
Definition uw-phy-WakeUp.h:176
virtual void startRx(Packet *p)
Definition uw-phy-WakeUp.cpp:218
virtual double getPER(double snr, int nbits)
Definition uw-phy-WakeUp.cpp:468
virtual MSpectralMask * getTxSpectralMask(Packet *p)
Definition uw-phy-WakeUp.cpp:176
virtual void waitForUser()
Definition uw-phy-WakeUp.cpp:476
void incrDroppedPktsTxPending()
Definition uw-phy-WakeUp.h:152
int droppedPktsTxPending
Definition uw-phy-WakeUp.h:178
virtual double getNoisePower(Packet *p)
Definition uw-phy-WakeUp.cpp:147
virtual int getDroppedPktsTxPending()
Definition uw-phy-WakeUp.h:92
virtual int command(int argc, const char *const *argv)
Definition uw-phy-WakeUp.cpp:125
static bool initialized
Definition uw-phy-WakeUp.h:165
double ToneDuration_
Definition uw-phy-WakeUp.h:174
virtual void startTx(Packet *p)
Definition uw-phy-WakeUp.cpp:182
virtual int getModulationType(Packet *)
Definition uw-phy-WakeUp.cpp:140
static int modid
Definition uw-phy-WakeUp.h:166
double AcquisitionThreshold_dB_
Definition uw-phy-WakeUp.h:170
virtual void dropPacket(Packet *p)
Definition uw-phy-WakeUp.cpp:445
Provides the definition of the Wake Up Tone Packet Header.