author | Mitch Watrous <watrous@u.washington.edu> |
Wed, 18 May 2011 17:24:04 -0700 | |
changeset 7241 | 0a7a16b599e8 |
parent 7142 | 89a701fec3a1 |
child 7343 | b3e668a5949c |
permissions | -rw-r--r-- |
6349 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2009 CTTC |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Nicola Baldo <nbaldo@cttc.es> |
|
19 |
*/ |
|
20 |
||
21 |
||
22 |
#ifndef SPECTRUM_CHANNEL_H |
|
23 |
#define SPECTRUM_CHANNEL_H |
|
24 |
||
25 |
#include <ns3/object.h> |
|
26 |
#include <ns3/nstime.h> |
|
27 |
#include <ns3/channel.h> |
|
28 |
#include <ns3/spectrum-type.h> |
|
29 |
||
30 |
namespace ns3 { |
|
31 |
||
32 |
||
33 |
class PacketBurst; |
|
34 |
class SpectrumValue; |
|
35 |
class SpectrumPhy; |
|
36 |
class SpectrumPropagationLossModel; |
|
37 |
class PropagationDelayModel; |
|
38 |
||
39 |
/** |
|
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7142
diff
changeset
|
40 |
* \ingroup spectrum |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7142
diff
changeset
|
41 |
* |
6349 | 42 |
* Defines the interface for spectrum-aware channel implementations |
43 |
* |
|
44 |
*/ |
|
45 |
class SpectrumChannel : public Channel |
|
46 |
{ |
|
47 |
public: |
|
48 |
virtual ~SpectrumChannel (); |
|
49 |
static TypeId GetTypeId (void); |
|
50 |
||
51 |
||
52 |
/** |
|
53 |
* set the propagation loss model to be used |
|
54 |
* \param loss Ptr to the propagation loss model to be used. |
|
55 |
*/ |
|
56 |
virtual void AddSpectrumPropagationLossModel (Ptr<SpectrumPropagationLossModel> loss) = 0; |
|
57 |
||
58 |
/** |
|
59 |
* set the propagation delay model to be used |
|
60 |
* \param delay Ptr to the propagation delay model to be used. |
|
61 |
*/ |
|
62 |
virtual void SetPropagationDelayModel (Ptr<PropagationDelayModel> delay) = 0; |
|
63 |
||
64 |
||
65 |
/** |
|
66 |
* Used by attached PHY instances to transmit waveforms on the channel |
|
67 |
* |
|
68 |
* @param p the PacketBurst associated with the waveform being transmitted |
|
6706
0a030d4fcc5b
LTE module from GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
6704
diff
changeset
|
69 |
* @param txPsd the Power Spectral Density of the |
6349 | 70 |
* waveform, in linear units. The exact unit will depend on the |
71 |
* type of transmission medium involved: W for radio communications, Pa for |
|
72 |
* underwater acoustic communications. Other transmission media to be defined. |
|
6706
0a030d4fcc5b
LTE module from GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
6704
diff
changeset
|
73 |
* @param st spectrum type |
6349 | 74 |
* @param duration duration of the packet transmission. It is |
75 |
* assumed that the Power Spectral Density remains constant for the |
|
76 |
* whole duration of the transmission. In other words, all waveform |
|
77 |
* have a rect shape with respect to time. |
|
78 |
* @param sender the SpectrumPhy instance making this function call |
|
79 |
*/ |
|
80 |
virtual void StartTx (Ptr<PacketBurst> p, Ptr <SpectrumValue> txPsd, SpectrumType st, Time duration, Ptr<SpectrumPhy> sender) = 0; |
|
81 |
||
82 |
/** |
|
83 |
* @brief add a SpectrumPhy to a channel, so it can receive packets |
|
84 |
* |
|
85 |
* This method is used to attach a SpectrumPhy instance to a |
|
86 |
* SpectrumChannel instance, so that the SpectrumPhy can receive |
|
87 |
* packets sent on that channel. Note that a SpectrumPhy that only |
|
88 |
* transmits (without receiveing ever) does not need to be added to |
|
7142
89a701fec3a1
run check-style.py on src/spectrum
Nicola Baldo <nicola@baldo.biz>
parents:
6801
diff
changeset
|
89 |
* the channel. |
6349 | 90 |
* |
91 |
* This method is to be implemented by all classes inheriting from |
|
7142
89a701fec3a1
run check-style.py on src/spectrum
Nicola Baldo <nicola@baldo.biz>
parents:
6801
diff
changeset
|
92 |
* SpectrumChannel. |
6349 | 93 |
* |
94 |
* @param phy the SpectrumPhy instance to be added to the channel as |
|
7142
89a701fec3a1
run check-style.py on src/spectrum
Nicola Baldo <nicola@baldo.biz>
parents:
6801
diff
changeset
|
95 |
* a receiver. |
6349 | 96 |
*/ |
97 |
virtual void AddRx (Ptr<SpectrumPhy> phy) = 0; |
|
98 |
||
99 |
}; |
|
100 |
||
101 |
||
102 |
||
103 |
} |
|
104 |
||
105 |
||
106 |
||
107 |
#endif /* SPECTRUM_CHANNEL_H */ |