From c805c90ed52153d3a2dba0c86adf809b014a97e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 28 Feb 2023 20:34:44 +0100 Subject: [PATCH] wifi: Introduce wifi-types header file --- src/wifi/CMakeLists.txt | 2 +- src/wifi/model/he/he-phy.h | 1 + src/wifi/model/phy-entity.h | 23 +------------- .../rate-control/minstrel-ht-wifi-manager.h | 2 +- .../model/{wifi-mpdu-type.h => wifi-types.h} | 31 ++++++++++++++++--- 5 files changed, 31 insertions(+), 28 deletions(-) rename src/wifi/model/{wifi-mpdu-type.h => wifi-types.h} (69%) diff --git a/src/wifi/CMakeLists.txt b/src/wifi/CMakeLists.txt index 7ca9f84d6..3d7ca929d 100644 --- a/src/wifi/CMakeLists.txt +++ b/src/wifi/CMakeLists.txt @@ -298,7 +298,6 @@ set(header_files model/wifi-mac.h model/wifi-mgt-header.h model/wifi-mode.h - model/wifi-mpdu-type.h model/wifi-mpdu.h model/wifi-net-device.h model/wifi-opt-field.h @@ -323,6 +322,7 @@ set(header_files model/wifi-tx-parameters.h model/wifi-tx-timer.h model/wifi-tx-vector.h + model/wifi-types.h model/wifi-utils.h model/yans-error-rate-model.h model/yans-wifi-channel.h diff --git a/src/wifi/model/he/he-phy.h b/src/wifi/model/he/he-phy.h index c5d7743b7..fb5c9926e 100644 --- a/src/wifi/model/he/he-phy.h +++ b/src/wifi/model/he/he-phy.h @@ -27,6 +27,7 @@ #include "ns3/callback.h" #include "ns3/vht-phy.h" #include "ns3/wifi-phy-band.h" +#include "ns3/wifi-types.h" #include diff --git a/src/wifi/model/phy-entity.h b/src/wifi/model/phy-entity.h index bbefd4a68..19ffea1c9 100644 --- a/src/wifi/model/phy-entity.h +++ b/src/wifi/model/phy-entity.h @@ -23,10 +23,10 @@ #ifndef PHY_ENTITY_H #define PHY_ENTITY_H -#include "wifi-mpdu-type.h" #include "wifi-phy-band.h" #include "wifi-ppdu.h" #include "wifi-tx-vector.h" +#include "wifi-types.h" #include "ns3/event-id.h" #include "ns3/nstime.h" @@ -50,27 +50,6 @@ namespace ns3 { -/// SignalNoiseDbm structure -struct SignalNoiseDbm -{ - double signal; ///< signal strength in dBm - double noise; ///< noise power in dBm -}; - -/// MpduInfo structure -struct MpduInfo -{ - MpduType type; ///< type of MPDU - uint32_t mpduRefNumber; ///< MPDU ref number -}; - -/// RxSignalInfo structure containing info on the received signal -struct RxSignalInfo -{ - double snr; ///< SNR in linear scale - double rssi; ///< RSSI in dBm -}; - /** * A map of the received power (Watts) for each band */ diff --git a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h index 3aa3b77b9..84ed20abe 100644 --- a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h +++ b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h @@ -27,8 +27,8 @@ #include "minstrel-wifi-manager.h" -#include "ns3/wifi-mpdu-type.h" #include "ns3/wifi-remote-station-manager.h" +#include "ns3/wifi-types.h" namespace ns3 { diff --git a/src/wifi/model/wifi-mpdu-type.h b/src/wifi/model/wifi-types.h similarity index 69% rename from src/wifi/model/wifi-mpdu-type.h rename to src/wifi/model/wifi-types.h index d237cce5b..aca0c45cd 100644 --- a/src/wifi/model/wifi-mpdu-type.h +++ b/src/wifi/model/wifi-types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 + * Copyright (c) 2023 DERONNE SOFTWARE ENGINEERING * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -17,8 +17,10 @@ * Author: Sébastien Deronne */ -#ifndef WIFI_MPDU_TYPE_H -#define WIFI_MPDU_TYPE_H +#ifndef WIFI_TYPES_H +#define WIFI_TYPES_H + +#include namespace ns3 { @@ -43,6 +45,27 @@ enum MpduType LAST_MPDU_IN_AGGREGATE }; +/// SignalNoiseDbm structure +struct SignalNoiseDbm +{ + double signal; ///< signal strength in dBm + double noise; ///< noise power in dBm +}; + +/// MpduInfo structure +struct MpduInfo +{ + MpduType type; ///< type of MPDU + uint32_t mpduRefNumber; ///< MPDU ref number +}; + +/// RxSignalInfo structure containing info on the received signal +struct RxSignalInfo +{ + double snr; ///< SNR in linear scale + double rssi; ///< RSSI in dBm +}; + } // namespace ns3 -#endif /* WIFI_MPDU_TYPE_H */ +#endif /* WIFI_TYPES_H */