A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
simple-frame-capture-model.h
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#ifndef SIMPLE_FRAME_CAPTURE_MODEL_H
10#define SIMPLE_FRAME_CAPTURE_MODEL_H
11
12#include "frame-capture-model.h"
13#include "wifi-units.h"
14
15namespace ns3
16{
17/**
18 * \ingroup wifi
19 *
20 * A simple threshold-based model for frame capture effect.
21 * If the new incoming frame arrives while the receiver is
22 * receiving the preamble of another frame and the SIR of
23 * the new incoming frame is above a fixed margin, then
24 * the current frame is dropped and the receiver locks
25 * onto the new incoming frame.
26 */
28{
29 public:
30 /**
31 * \brief Get the type ID.
32 * \return the object TypeId
33 */
34 static TypeId GetTypeId();
35
37 ~SimpleFrameCaptureModel() override;
38
39 /**
40 * Sets the frame capture margin.
41 *
42 * \param margin the frame capture margin
43 */
44 void SetMargin(dB_u margin);
45 /**
46 * Return the frame capture margin.
47 *
48 * \return the frame capture margin
49 */
50 dB_u GetMargin() const;
51
52 /**
53 * This method returns whether the reception should be switched to a
54 * new incoming frame.
55 *
56 * \param currentEvent the event of the current frame
57 * \param newEvent the event of the new incoming frame
58 *
59 * \return true if the reception should be switched to a new incoming frame,
60 * false otherwise
61 */
62 bool CaptureNewFrame(Ptr<Event> currentEvent, Ptr<Event> newEvent) const override;
63
64 private:
65 dB_u m_margin; ///< margin for determining if a new frame
66};
67
68} // namespace ns3
69
70#endif /* SIMPLE_FRAME_CAPTURE_MODEL_H */
the interface for Wifi's frame capture models
Smart pointer class similar to boost::intrusive_ptr.
A simple threshold-based model for frame capture effect.
static TypeId GetTypeId()
Get the type ID.
dB_u GetMargin() const
Return the frame capture margin.
dB_u m_margin
margin for determining if a new frame
bool CaptureNewFrame(Ptr< Event > currentEvent, Ptr< Event > newEvent) const override
This method returns whether the reception should be switched to a new incoming frame.
void SetMargin(dB_u margin)
Sets the frame capture margin.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Declaration of the SI units (as weak types aliases) used across wifi module.