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 "ns3/application.h"
13
14
namespace
ns3
15
{
16
namespace
lorawan
17
{
18
19
class
LorawanMac
;
20
21
/**
22
* @ingroup lorawan
23
*
24
* Packet sender application to send a single packet
25
*/
26
class
OneShotSender
:
public
Application
27
{
28
public
:
29
OneShotSender
();
//!< Default constructor
30
~OneShotSender
()
override
;
//!< Destructor
31
32
/**
33
* Construct a new OneShotSender object with provided send time.
34
*
35
* @param sendTime The Time of sending.
36
*/
37
OneShotSender
(
Time
sendTime);
38
39
/**
40
* Register this type.
41
* @return The object TypeId.
42
*/
43
static
TypeId
GetTypeId
();
44
45
/**
46
* Send a packet using the LoraNetDevice's Send method.
47
*/
48
void
SendPacket
();
49
50
/**
51
* Set the time at which this app will send a packet.
52
*
53
* @param sendTime The Time of sending.
54
*/
55
void
SetSendTime
(
Time
sendTime);
56
57
/**
58
* Start the application by scheduling the first SendPacket event.
59
*/
60
void
StartApplication
()
override
;
61
62
/**
63
* Stop the application.
64
*/
65
void
StopApplication
()
override
;
66
67
private
:
68
Time
m_sendTime
;
//!< The time at which to send the packet.
69
EventId
m_sendEvent
;
//!< The sending event.
70
Ptr<LorawanMac>
m_mac
;
//!< The MAC layer of this node.
71
};
72
73
}
// namespace lorawan
74
}
// namespace ns3
75
76
#endif
/* ONE_SHOT_APPLICATION */
ns3::Application::Application
Application()
Definition
application.cc:49
ns3::EventId
An identifier for simulation events.
Definition
event-id.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
ns3::lorawan::LorawanMac
Class representing the LoRaWAN MAC layer.
Definition
lorawan-mac.h:36
ns3::lorawan::OneShotSender::m_sendEvent
EventId m_sendEvent
The sending event.
Definition
one-shot-sender.h:69
ns3::lorawan::OneShotSender::SendPacket
void SendPacket()
Send a packet using the LoraNetDevice's Send method.
Definition
one-shot-sender.cc:60
ns3::lorawan::OneShotSender::m_mac
Ptr< LorawanMac > m_mac
The MAC layer of this node.
Definition
one-shot-sender.h:70
ns3::lorawan::OneShotSender::~OneShotSender
~OneShotSender() override
Destructor.
Definition
one-shot-sender.cc:46
ns3::lorawan::OneShotSender::StartApplication
void StartApplication() override
Start the application by scheduling the first SendPacket event.
Definition
one-shot-sender.cc:70
ns3::lorawan::OneShotSender::OneShotSender
OneShotSender()
Default constructor.
Definition
one-shot-sender.cc:35
ns3::lorawan::OneShotSender::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
one-shot-sender.cc:26
ns3::lorawan::OneShotSender::SetSendTime
void SetSendTime(Time sendTime)
Set the time at which this app will send a packet.
Definition
one-shot-sender.cc:52
ns3::lorawan::OneShotSender::StopApplication
void StopApplication() override
Stop the application.
Definition
one-shot-sender.cc:90
ns3::lorawan::OneShotSender::m_sendTime
Time m_sendTime
The time at which to send the packet.
Definition
one-shot-sender.h:68
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
one-shot-sender.h
Generated on
for ns-3 by
1.15.0