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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
#ifndef ONE_SHOT_SENDER_H
10
#define ONE_SHOT_SENDER_H
11
12
#include "
lorawan-mac.h
"
13
14
#include "ns3/application.h"
15
#include "ns3/attribute.h"
16
#include "ns3/nstime.h"
17
18
namespace
ns3
19
{
20
namespace
lorawan
21
{
22
23
/**
24
* \ingroup lorawan
25
*
26
* Packet sender application to send a single packet
27
*/
28
class
OneShotSender
:
public
Application
29
{
30
public
:
31
OneShotSender
();
//!< Default constructor
32
~OneShotSender
()
override
;
//!< Destructor
33
34
/**
35
* Construct a new OneShotSender object with provided send time.
36
*
37
* \param sendTime The Time of sending.
38
*/
39
OneShotSender
(
Time
sendTime);
40
41
/**
42
* Register this type.
43
* \return The object TypeId.
44
*/
45
static
TypeId
GetTypeId
();
46
47
/**
48
* Send a packet using the LoraNetDevice's Send method.
49
*/
50
void
SendPacket
();
51
52
/**
53
* Set the time at which this app will send a packet.
54
*
55
* \param sendTime The Time of sending.
56
*/
57
void
SetSendTime
(
Time
sendTime);
58
59
/**
60
* Start the application by scheduling the first SendPacket event.
61
*/
62
void
StartApplication
()
override
;
63
64
/**
65
* Stop the application.
66
*/
67
void
StopApplication
()
override
;
68
69
private
:
70
Time
m_sendTime
;
//!< The time at which to send the packet.
71
EventId
m_sendEvent
;
//!< The sending event.
72
Ptr<LorawanMac>
m_mac
;
//!< The MAC layer of this node.
73
};
74
75
}
// namespace lorawan
76
77
}
// namespace ns3
78
#endif
/* ONE_SHOT_APPLICATION */
ns3::Application
The base class for all ns3 applications.
Definition
application.h:51
ns3::EventId
An identifier for simulation events.
Definition
event-id.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lorawan::OneShotSender
Packet sender application to send a single packet.
Definition
one-shot-sender.h:29
ns3::lorawan::OneShotSender::m_sendEvent
EventId m_sendEvent
The sending event.
Definition
one-shot-sender.h:71
ns3::lorawan::OneShotSender::SendPacket
void SendPacket()
Send a packet using the LoraNetDevice's Send method.
Definition
one-shot-sender.cc:63
ns3::lorawan::OneShotSender::m_mac
Ptr< LorawanMac > m_mac
The MAC layer of this node.
Definition
one-shot-sender.h:72
ns3::lorawan::OneShotSender::~OneShotSender
~OneShotSender() override
Destructor.
Definition
one-shot-sender.cc:49
ns3::lorawan::OneShotSender::StartApplication
void StartApplication() override
Start the application by scheduling the first SendPacket event.
Definition
one-shot-sender.cc:73
ns3::lorawan::OneShotSender::OneShotSender
OneShotSender()
Default constructor.
Definition
one-shot-sender.cc:38
ns3::lorawan::OneShotSender::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
one-shot-sender.cc:29
ns3::lorawan::OneShotSender::SetSendTime
void SetSendTime(Time sendTime)
Set the time at which this app will send a packet.
Definition
one-shot-sender.cc:55
ns3::lorawan::OneShotSender::StopApplication
void StopApplication() override
Stop the application.
Definition
one-shot-sender.cc:93
ns3::lorawan::OneShotSender::m_sendTime
Time m_sendTime
The time at which to send the packet.
Definition
one-shot-sender.h:70
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 Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0