A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
default-power-save-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef DEFAULT_POWER_SAVE_MANAGER_H
10#define DEFAULT_POWER_SAVE_MANAGER_H
11
12#include "power-save-manager.h"
13
14namespace ns3
15{
16
17/**
18 * @ingroup wifi
19 *
20 * DefaultPowerSaveManager is the default power save manager.
21 */
23{
24 public:
25 /**
26 * @brief Get the type ID.
27 * @return the object TypeId
28 */
29 static TypeId GetTypeId();
30
32 ~DefaultPowerSaveManager() override;
33
34 protected:
35 /**
36 * Put the PHY operating on the given link to sleep, if no reason to stay awake.
37 *
38 * @param linkId the ID of the given link
39 */
40 void GoToSleepIfPossible(linkId_t linkId);
41
42 void DoNotifyAssocCompleted() override;
43 void DoNotifyDisassociation() override;
44 void DoNotifyPmModeChanged(WifiPowerManagementMode pmMode, linkId_t linkId) override;
45 void DoNotifyReceivedBeacon(const MgtBeaconHeader& beacon, linkId_t linkId) override;
47 void DoNotifyReceivedGroupcast(Ptr<const WifiMpdu> mpdu, linkId_t linkId) override;
48 void DoNotifyRequestAccess(Ptr<Txop> txop, linkId_t linkId) override;
49 void DoNotifyChannelReleased(Ptr<Txop> txop, linkId_t linkId) override;
50 void DoTxDropped(WifiMacDropReason reason, Ptr<const WifiMpdu> mpdu) override;
51
52 std::map<linkId_t, EventId> m_wakeUpEvents; ///< events scheduled to wake up PHYs
53 std::map<linkId_t, EventId> m_sleepEvents; ///< events scheduled to set PHYs to sleep
54 Time m_psmTimeout; ///< the extra time during which the PHY is kept in active state before
55 ///< being put to sleep state
56 Time m_listenAdvance; ///< the amount of time the STA wakes up in advance prior to the TBTT
57};
58
59} // namespace ns3
60
61#endif /* DEFAULT_POWER_SAVE_MANAGER_H */
void DoNotifyReceivedFrameAfterPsPoll(Ptr< const WifiMpdu > mpdu, linkId_t linkId) override
Notify subclasses of the reception of a frame in response to a PS-Poll frame on the given link.
void DoNotifyRequestAccess(Ptr< Txop > txop, linkId_t linkId) override
Notify subclasses that the given TXOP is requesting channel access on the given link.
std::map< linkId_t, EventId > m_sleepEvents
events scheduled to set PHYs to sleep
std::map< linkId_t, EventId > m_wakeUpEvents
events scheduled to wake up PHYs
Time m_listenAdvance
the amount of time the STA wakes up in advance prior to the TBTT
void DoNotifyDisassociation() override
Notify subclasses that the non-AP STA/MLD has disassociated.
void DoNotifyReceivedGroupcast(Ptr< const WifiMpdu > mpdu, linkId_t linkId) override
Notify subclasses of the reception of a groupcast frame (possibly after a DTIM) on the given link.
void DoNotifyPmModeChanged(WifiPowerManagementMode pmMode, linkId_t linkId) override
Notify subclasses that the Power Management mode of the non-AP STA operating on the given link has ch...
void DoNotifyAssocCompleted() override
Notify subclasses that the non-AP STA/MLD has completed association with an AP.
void DoNotifyReceivedBeacon(const MgtBeaconHeader &beacon, linkId_t linkId) override
Notify subclasses that a Beacon frame has been received from the associated AP on the given link.
void GoToSleepIfPossible(linkId_t linkId)
Put the PHY operating on the given link to sleep, if no reason to stay awake.
void DoTxDropped(WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu) override
Notify subclasses that the given MPDU has been discarded for the given reason.
static TypeId GetTypeId()
Get the type ID.
void DoNotifyChannelReleased(Ptr< Txop > txop, linkId_t linkId) override
Notify subclasses that the given TXOP is releasing the channel on the given link.
Time m_psmTimeout
the extra time during which the PHY is kept in active state before being put to sleep state
Implement the header for management frames of type beacon.
PowerSaveManager is an abstract base class.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
a unique identifier for an interface.
Definition type-id.h:50
WifiMacDropReason
The reason why an MPDU was dropped.
Definition wifi-mac.h:71
WifiPowerManagementMode
Enumeration for power management modes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t linkId_t
IEEE 802.11be D7.0 Figure 9-207e—Link ID Info field format.
Definition wifi-utils.h:74