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
frame-capture-model.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7
*/
8
9
#include "
frame-capture-model.h
"
10
11
#include "ns3/nstime.h"
12
#include "ns3/simulator.h"
13
14
namespace
ns3
15
{
16
17
NS_OBJECT_ENSURE_REGISTERED
(FrameCaptureModel);
18
19
TypeId
20
FrameCaptureModel::GetTypeId
()
21
{
22
static
TypeId
tid =
TypeId
(
"ns3::FrameCaptureModel"
)
23
.
SetParent
<
Object
>()
24
.SetGroupName(
"Wifi"
)
25
.AddAttribute(
"CaptureWindow"
,
26
"The duration of the capture window."
,
27
TimeValue
(
MicroSeconds
(16)),
28
MakeTimeAccessor
(&
FrameCaptureModel::m_captureWindow
),
29
MakeTimeChecker
());
30
return
tid;
31
}
32
33
bool
34
FrameCaptureModel::IsInCaptureWindow
(
Time
timePreambleDetected)
const
35
{
36
return
(timePreambleDetected +
m_captureWindow
>=
Simulator::Now
());
37
}
38
39
}
// namespace ns3
ns3::FrameCaptureModel::IsInCaptureWindow
virtual bool IsInCaptureWindow(Time timePreambleDetected) const
This method returns true if the capture window duration has not elapsed yet, false otherwise.
Definition
frame-capture-model.cc:34
ns3::FrameCaptureModel::m_captureWindow
Time m_captureWindow
Capture window duration.
Definition
frame-capture-model.h:60
ns3::FrameCaptureModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
frame-capture-model.cc:20
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Simulator::Now
static Time Now()
Return the current simulation virtual time.
Definition
simulator.cc:197
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TimeValue
Definition
nstime.h:1395
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
frame-capture-model.h
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition
nstime.h:1332
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeTimeAccessor
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition
nstime.h:1396
ns3::MakeTimeChecker
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition
nstime.h:1416
src
wifi
model
frame-capture-model.cc
Generated on Fri Nov 8 2024 13:59:07 for ns-3 by
1.11.0