A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
one-shot-sender.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Davide Magrin <magrinda@dei.unipd.it>
18
*/
19
20
#ifndef ONE_SHOT_SENDER_H
21
#define ONE_SHOT_SENDER_H
22
23
#include "
lorawan-mac.h
"
24
25
#include "ns3/application.h"
26
#include "ns3/attribute.h"
27
#include "ns3/nstime.h"
28
29
namespace
ns3
30
{
31
namespace
lorawan
32
{
33
34
/**
35
* \ingroup lorawan
36
*
37
* Packet sender application to send a single packet
38
*/
39
class
OneShotSender
:
public
Application
40
{
41
public
:
42
OneShotSender
();
//!< Default constructor
43
~OneShotSender
()
override
;
//!< Destructor
44
45
/**
46
* Construct a new OneShotSender object with provided send time.
47
*
48
* \param sendTime The Time of sending.
49
*/
50
OneShotSender
(
Time
sendTime);
51
52
/**
53
* Register this type.
54
* \return The object TypeId.
55
*/
56
static
TypeId
GetTypeId
();
57
58
/**
59
* Send a packet using the LoraNetDevice's Send method.
60
*/
61
void
SendPacket
();
62
63
/**
64
* Set the time at which this app will send a packet.
65
*
66
* \param sendTime The Time of sending.
67
*/
68
void
SetSendTime
(
Time
sendTime);
69
70
/**
71
* Start the application by scheduling the first SendPacket event.
72
*/
73
void
StartApplication
()
override
;
74
75
/**
76
* Stop the application.
77
*/
78
void
StopApplication
()
override
;
79
80
private
:
81
Time
m_sendTime
;
//!< The time at which to send the packet.
82
EventId
m_sendEvent
;
//!< The sending event.
83
Ptr<LorawanMac>
m_mac
;
//!< The MAC layer of this node.
84
};
85
86
}
// namespace lorawan
87
88
}
// namespace ns3
89
#endif
/* ONE_SHOT_APPLICATION */
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:62
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:56
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lorawan::OneShotSender
Packet sender application to send a single packet.
Definition:
one-shot-sender.h:40
ns3::lorawan::OneShotSender::m_sendEvent
EventId m_sendEvent
The sending event.
Definition:
one-shot-sender.h:82
ns3::lorawan::OneShotSender::SendPacket
void SendPacket()
Send a packet using the LoraNetDevice's Send method.
Definition:
one-shot-sender.cc:74
ns3::lorawan::OneShotSender::m_mac
Ptr< LorawanMac > m_mac
The MAC layer of this node.
Definition:
one-shot-sender.h:83
ns3::lorawan::OneShotSender::~OneShotSender
~OneShotSender() override
Destructor.
Definition:
one-shot-sender.cc:60
ns3::lorawan::OneShotSender::StartApplication
void StartApplication() override
Start the application by scheduling the first SendPacket event.
Definition:
one-shot-sender.cc:84
ns3::lorawan::OneShotSender::OneShotSender
OneShotSender()
Default constructor.
Definition:
one-shot-sender.cc:49
ns3::lorawan::OneShotSender::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
one-shot-sender.cc:40
ns3::lorawan::OneShotSender::SetSendTime
void SetSendTime(Time sendTime)
Set the time at which this app will send a packet.
Definition:
one-shot-sender.cc:66
ns3::lorawan::OneShotSender::StopApplication
void StopApplication() override
Stop the application.
Definition:
one-shot-sender.cc:104
ns3::lorawan::OneShotSender::m_sendTime
Time m_sendTime
The time at which to send the packet.
Definition:
one-shot-sender.h:81
lorawan-mac.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
one-shot-sender.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6