A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-types.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 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#include "wifi-types.h"
10
11#include "wifi-phy.h"
12
13namespace ns3
14{
15
16WifiChannelConfig::WifiChannelConfig(const std::list<TupleWithoutUnits>& tuples)
17{
18 std::for_each(tuples.cbegin(), tuples.cend(), [this](auto&& t) {
19 segments.emplace_back(std::make_from_tuple<SegmentWithoutUnits>(t));
20 });
21}
22
24WifiChannelConfig::FromString(const std::string& settings, WifiStandard standard)
25{
27 value.DeserializeFromString(settings, WifiPhy::GetChannelSegmentsChecker());
28 auto channelCfg = WifiChannelConfig(value.Get());
29 if (standard != WIFI_STANDARD_UNSPECIFIED)
30 {
31 WifiPhy::SetUnspecifiedChannelParams(channelCfg, standard);
32 }
33 return channelCfg;
34}
35
36} // namespace ns3
static void SetUnspecifiedChannelParams(WifiChannelConfig &channelCfg, WifiStandard standard)
The ChannelSettings attribute allows users to leave some parameters (e.g., the channel width) unspeci...
Definition wifi-phy.cc:1226
AttributeContainerValue< ChannelTupleValue, ';'> ChannelSettingsValue
AttributeValue type of a ChannelSegments object.
Definition wifi-phy.h:959
static Ptr< const AttributeChecker > GetChannelSegmentsChecker()
Get a checker for the ChannelSettings attribute, which can be used to deserialize a ChannelSegments o...
Definition wifi-phy.cc:371
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
@ WIFI_STANDARD_UNSPECIFIED
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Struct defining the configuration of a wifi channel, which can be made of one or multiple channel seg...
Definition wifi-types.h:94
static WifiChannelConfig FromString(const std::string &settings, WifiStandard standard=WIFI_STANDARD_UNSPECIFIED)
Get the wifi channel config from a WifiPhy::ChannelSettings string.
Definition wifi-types.cc:24