RDK Documentation (Open Sourced RDK Components)
wifi_common_hal.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**********************************************************************
21 
22  module: wifi_common_hal.h
23 
24  For CCSP Component: Wifi_Provisioning_and_management
25 
26  ---------------------------------------------------------------
27 
28  description:
29 
30  This header file gives the function call prototypes and
31  structure definitions used for the RDK-Broadband
32  Wifi radio hardware abstraction layer
33 
34  NOTE:
35  THIS VERSION IS AN EARLY DRAFT INTENDED TO GET COMMENTS FROM COMCAST.
36  TESTING HAS NOT YET BEEN COMPLETED.
37 
38  ---------------------------------------------------------------
39 
40  environment:
41 
42  This HAL layer is intended to support Wifi drivers
43  through an open API.
44 
45  ---------------------------------------------------------------
46 
47  HAL version:
48 
49  The version of the Wifi HAL is specified in #defines below.
50 
51  ---------------------------------------------------------------
52 
53  author:
54 
55  zhicheng_qiu@cable.comcast.com
56  Charles Moreman, moremac@cisco.com
57 
58 
59 **********************************************************************/
60 
61 #ifndef __WIFI_COMMON_HAL_H__
62 #define __WIFI_COMMON_HAL_H__
63 
64 /**
65  * @defgroup WIFI Wi-Fi
66  *
67  * @section WIFI_GLOSSARY Glossary of terms
68  *
69  * Abbreviations | Description
70  * -----|------------
71  * Access Popint | A device that acts as the bridge between wireless clients and the wired network. Often abbreviated as AP.
72  * AES | The Advanced Encryption Standard is a symmetric block encryption protocol used in WPA2.
73  * BSSID | BSSID stands for Basic Service Set Identifier and is the MAC address of the AP.
74  * EAP | The Extensible Authentication Protocol (EAP) can be used to provide authentication to the wireless network when employing WPA-Enterprise and WPA2-Enterprise.
75  * SSID | The Service Set Identifier (SSID) is the name of the wireless network. It can be contained in the beacons sent out by APs.
76  * ESSID | The Extended Service Set Identifier is the name of the wireless network, and is used by all APs that provide access to the same infrastructure in an ESS.
77  * ESS | An extended service set (ESS) refers to a network with two or more APs working cooperatively.
78  * QoS | Quality of Service enables networks to prioritize certain traffic types.
79  * CCMP | Cipher Block Chaining Message Authentication Code Protocol (CCMP) is an encryption protocol that forms part of the wireless standard local area networks.
80  * STA | Wireless Station.
81  *
82  * @section WIFI_STANDARD Wi-Fi Standards
83  * IEEE Standards for Wireless, 802.11 is the set of standards maintained by the IEEE for wireless networking.
84  *
85  * Abbreviations | Description
86  * -----|------------
87  * 802.11a | In the 5 GHz range. 802.11a networks can support up to 54 Mbps throughput and operate in the UNII bands
88  * 802.11ac | In the 5 GHz range. 802.11ac networks can support up to 1 Gbps throughput using multiple channels.
89  * 802.11b | In the 2.4 GHz range. 802.11b networks support up to 11 Mbps throughput and operate in the ISM band.
90  * 802.11d | Addresses the Media Access Control (MAC) layer to comply with rules in each country.
91  * 802.11g | In the 2.4 GHz range. 802.11g networks support up to 54 Mbps throughput and operate in the ISM band.
92  * 802.11h | Sets the requirements for Dynamic Frequency Selection (DFS) and Transmit Power Control (TPC).
93  * 802.11n | Can use both the 2.4 GHz and 5 GHz ranges.
94  *
95  *
96  * @section WIFI_SECURITY Wireless Security
97  *
98  * Abbreviations | Description
99  * -----|------------
100  * Ad Hoc Mode | A peer to peer mode of networking using Wi-Fi networking but no access point. Ad Hoc networks can include more than two devices.
101  * WAP | WAP can refer to the Wireless Application Protocol, or can be used to mean Wireless Access Point.
102  * WEP | Wired Equivalent Privacy is the original encryption scheme implemented in wireless networks
103  * WPA | Wi-Fi Protected Access is a security protocol for wireless networks that was designed to replace WEP. It uses TKIP to encrypt data.
104  * WPA2 | Wi-Fi Protected Access v2 is currently the strongest encryption protocol available to wireless networks. It uses AES encryption algorithm.
105  * WPS | Wi-Fi Protected Setup makes it easier for users to add Wi-Fi clients to WPA and WPA2 protected wireless networks.
106  * TKIP | The Temporal Key Integrity Protocol was developed as a replacement for WEP but is no longer considered secure and has been removed from 802.11 standards.
107  * TLS | Transport Layer Security is a protocol designed to encrypt and authenticate all kinds of network traffic at the trans port layer, and is the successor to SSL.
108  *
109  * @defgroup WIFI_HAL Wi-Fi HAL Public APIs and Data Types
110  * @section WIFI_SEC_SO Wi-Fi Sub-System Overview
111  * - RDK support integrated Wi-Fi chips as well as USB based Wi-Fi adapters.
112  * - Implementation differences between on board Wi-Fi & USB Wi-Fi adapter are abstracted from Upper layers i.e.
113  * application doesn.t know what kind of Wi-Fi device or connection they are accessing.
114  * - RDK Wi-Fi uses wpa_supplicant wireless daemon for connection management with the Wi-Fi driver.
115  * - wpa_supplicant is designed to be a "daemon" that runs in the background and acts as the backend component controlling the wireless connection.
116  * - wpa_supplicant also offers a control and monitoring interface to handle different wireless commands.
117  * - RDK Wi-Fi stack extensively uses commonly available Linux wireless utilities which brings most of the USB based
118  * and on-chip wireless equipment under our coverage.
119  * - It provides support for diagnostics and connection management from remote and native applications.
120  * - It uses IARM, which is a Linux D-BUS based communication protocol for managing Wi-Fi event notification and communication across different applications.
121  *
122  * @section WIFI_SEC_AR RDK Wi-Fi Architecture
123  * @image html wifi_arc.png
124  *
125  * @par Application
126  * In top of the eco-system we have wide range of application which requires wireless network access.
127  * This may be a cloud based UI application, a diagnostics webpage or a console application such as test automation
128  * kit which will be required to verify readiness of a new RDK box with respect to different component features.
129  * @par Service Manager
130  * Service manager is the contact point between external applications and native RDK. It is present in RDK as a library
131  * which when plugged in to a browser such as WPE or Qt enhances its capability to make communication from web applications
132  * to native RDK components through Java script.
133  * @par IARM Message Bus
134  * RDK provides a common message and event notification mechanism known as IARM which passes the calls from upper layer
135  * i.e. service manager to actual network manager.
136  * @par Network Manager
137  * Wifi network manager is a daemon which handles network states and network interfaces. It handles Wireless initialization
138  * and management.
139  * @par Generic HAL
140  * It is an abstraction of Wireless driver calls and various linux wireless utilities to present a set of APIs for common wireless operation.
141  * @par Linux Wireless Utility
142  * Wpa_supplicant, wireless-tools, net-link library, etc.
143  * @par SoC/OEM Driver/ Firmware
144  * Kernel space driver and firmware binaries will be provided by Wi-FI SOC or OEM and it should be present in the defined path in the RDK box.
145  *
146  * @section WIFI_SEC_SQ Use Case - AP Discovery & Establishing Connection
147  * @image html wifi_seq.png
148  *
149  * @ingroup WIFI
150  *
151  * @defgroup WIFI_HAL_COMMON_API Wi-Fi Common HAL API List
152  * @ingroup WIFI_HAL
153  *
154  * @defgroup WIFI_HAL_TYPES Wi-Fi HAL Data Structure
155  * @ingroup WIFI_HAL
156  */
157 
158 
159 /**
160  * @addtogroup WIFI_HAL_TYPES
161  * @{
162  */
163 
164 /**
165  * @brief Defines for the basic data types.
166  */
167 #ifndef ULONG
168 #define ULONG unsigned long
169 #endif
170 
171 #ifndef BOOL
172 #define BOOL unsigned char
173 #endif
174 
175 #ifndef CHAR
176 #define CHAR char
177 #endif
178 
179 #ifndef UCHAR
180 #define UCHAR unsigned char
181 #endif
182 
183 #ifndef INT
184 #define INT int
185 #endif
186 
187 #ifndef UINT
188 #define UINT unsigned int
189 #endif
190 
191 #ifndef FLOAT
192 #define FLOAT float
193 #endif
194 
195 /**
196  * @brief Defines for TRUE/FALSE/ENABLE flags
197  */
198 #ifndef TRUE
199 #define TRUE 1
200 #endif
201 
202 #ifndef FALSE
203 #define FALSE 0
204 #endif
205 
206 #ifndef ENABLE
207 #define ENABLE 1
208 #endif
209 
210 /**
211  * @brief Defines for function returns
212  *
213  * RETURN_OK Return value for the success case
214  * RETURN_ERR Return value for the failure case
215  *
216  */
217 #ifndef RETURN_OK
218 #define RETURN_OK 0
219 #endif
220 
221 #ifndef RETURN_ERR
222 #define RETURN_ERR -1
223 #endif
224 
225 
226 #ifndef RADIO_INDEX_1
227 #define RADIO_INDEX_1 1
228 #define RADIO_INDEX_2 2
229 #define AP_INDEX_1 1
230 #define AP_INDEX_2 2
231 #define AP_INDEX_3 3
232 #define AP_INDEX_4 4
233 #define AP_INDEX_5 5
234 #define AP_INDEX_6 6
235 #define AP_INDEX_7 7
236 #define AP_INDEX_8 8
237 #define AP_INDEX_9 9
238 #define AP_INDEX_10 10
239 #define AP_INDEX_11 11
240 #define AP_INDEX_12 12
241 #define AP_INDEX_13 13
242 #define AP_INDEX_14 14
243 #define AP_INDEX_15 15
244 #define AP_INDEX_16 16
245 #endif
246 
247 /**
248  * @brief Defines for HAL version 2.0.0
249  */
250 #define WIFI_HAL_MAJOR_VERSION 2 //!< This is the major version of this HAL.
251 #define WIFI_HAL_MINOR_VERSION 0 //!< This is the minor version of the HAL.
252 #define WIFI_HAL_MAINTENANCE_VERSION 0 //!< This is the maintenance version of the HAL.
253 
254 /**
255  * @brief Enumerators for Wifi RSSI Levels
256  */
257 typedef enum {
258  WIFI_RSSI_NONE = 0, //!< No signal (0 bar)
259  WIFI_RSSI_POOR, //!< Poor (1 bar)
260  WIFI_RSSI_FAIR, //!< Fair (2 bars)
261  WIFI_RSSI_GOOD, //!< Good (3 bars)
262  WIFI_RSSI_EXCELLENT, //!< Excellent (4 bars)
263  WIFI_RSSI_MAX
265 
266 /*wifi wpa supplicant status codes*/
267 typedef enum _WiFiHalStatus_t {
268  WIFISTATUS_HAL_DISCONNECTED,
269  WIFISTATUS_HAL_INTERFACE_DISABLED,
270  WIFISTATUS_HAL_INACTIVE,
271  WIFISTATUS_HAL_SCANNING,
272  WIFISTATUS_HAL_AUTHENTICATING,
273  WIFISTATUS_HAL_ASSOCIATING,
274  WIFISTATUS_HAL_ASSOCIATED,
275  WIFISTATUS_HAL_4WAY_HANDSHAKE,
276  WIFISTATUS_HAL_GROUP_HANDSHAKE,
277  WIFISTATUS_HAL_COMPLETED
278 } WiFiHalStatus_t;
279 /* WiFi Bands */
280 typedef enum {
281  WIFI_HAL_FREQ_BAN_NONE,
282  WIFI_HAL_FREQ_BAND_24GHZ,
283  WIFI_HAL_FREQ_BAND_5GHZ,
284 } WIFI_HAL_FREQ_BAND;
285 
286 
287 /**
288  * @brief Enumerators for Wi-Fi connection status.
289  */
290 typedef enum {
291  WIFI_HAL_SUCCESS = 0, /**< Successful connect/disconnect */
292  WIFI_HAL_CONNECTING, /**< Attempting to connect to a Network/AP using wps or SSID selection*/
293  WIFI_HAL_DISCONNECTING = 10, /**< Attempting to disconnect to a Network/AP */
294 
295  /* Failure/Error Codes*/
296  WIFI_HAL_ERROR_NOT_FOUND = 20, /**< Device/AP not found*/
297  WIFI_HAL_ERROR_TIMEOUT_EXPIRED, /**< Timeout expired */
298  WIFI_HAL_ERROR_DEV_DISCONNECT, /**< Failed/Error in Device/AP Disconnect */
299  WIFI_HAL_ERROR_SSID_CHANGED, /**< the SSID of the network changed */
300  WIFI_HAL_ERROR_CONNECTION_LOST, /**< the connection to the network was lost */
301  WIFI_HAL_ERROR_CONNECTION_FAILED, /**< the connection failed for an unknown reason */
302  WIFI_HAL_ERROR_CONNECTION_INTERRUPTED, /**< the connection was interrupted */
303  WIFI_HAL_ERROR_INVALID_CREDENTIALS, /**< the connection failed due to invalid credentials */
304  WIFI_HAL_UNRECOVERABLE_ERROR, /**< The device has encountered an unrecoverable (driver or hardware failures) errors */
305  WIFI_HAL_ERROR_AUTH_FAILED, /**< the connection failed due to authentication failure */
306  WIFI_HAL_ERROR_UNKNOWN = 40, /**< Unknown/unspecified error */
308 
309 /**
310  * @brief Wifi Security modes
311  *
312  * Security modes are used to prevent the unauthorized access or damage to computers using wireless networks.
313  * Wired Equivalent Privacy (WEP), Wi-Fi Protected Access (WPA), and Wi-Fi Protected Access II (WPA2) are the
314  * primary security algorithms.
315  * WEP is the oldest and has proven to be vulnerable as more and more security flaws have been discovered.
316  * WPA improved security, but is now also considered vulnerable to intrusion.
317  * WPA2 is currently used and the most secure one.
318  *
319  */
320 typedef enum
321 {
322  WIFI_SECURITY_NONE = 0, //!< No Security
323  WIFI_SECURITY_WEP_64, //!< WEP with 64 bit encryption
324  WIFI_SECURITY_WEP_128, //!< WEP with 128 bit encryption
325  WIFI_SECURITY_WPA_PSK_TKIP, //!< WPA(Pre-Shared Key) with TKIP (Temporal Key Integrity Protocol) encryption
326  WIFI_SECURITY_WPA_PSK_AES, //!< WPA(Pre-Shared Key) with AES (Advanced Encryption Standard) encryption
327  WIFI_SECURITY_WPA2_PSK_TKIP, //!< WPA2(Pre-Shared Key) with TKIP (Temporal Key Integrity Protocol) encryption
328  WIFI_SECURITY_WPA2_PSK_AES, //!< WPA2(Pre-Shared Key) with AES (Advanced Encryption Standard) encryption
329  WIFI_SECURITY_WPA_ENTERPRISE_TKIP, //!< WPA Enterprise with TKIP (Temporal Key Integrity Protocol) encryption
330  WIFI_SECURITY_WPA_ENTERPRISE_AES, //!< WPA Enterprise with AES (Advanced Encryption Standard) encryption
331  WIFI_SECURITY_WPA2_ENTERPRISE_TKIP, //!< WPA2 Enterprise with TKIP (Temporal Key Integrity Protocol) encryption
332  WIFI_SECURITY_WPA2_ENTERPRISE_AES, //!< WPA2 Enterprise with AES (Advanced Encryption Standard) encryption
333  WIFI_SECURITY_WPA_WPA2_PSK, //!< WPA2(Pre-Shared Key) with TKIP AES encryption
334  WIFI_SECURITY_WPA_WPA2_ENTERPRISE, //!< WPA,WPA2 Enterprise with TKIP AES encryption
335  WIFI_SECURITY_WPA3_PSK_AES, //!< WPA3(Pre-Shared Key) with AES encryption
336  WIFI_SECURITY_WPA3_SAE, //!< WPA3 with SAE encryption
337 
338  WIFI_SECURITY_NOT_SUPPORTED = 99, //!< Security mode not supported
340 
341 /**********************************************************************
342  STRUCTURE DEFINITIONS
343 **********************************************************************/
344 
346 {
347  ULONG radio_BytesSent; //!< The total number of bytes transmitted out of the interface, including framing characters.
348  ULONG radio_BytesReceived; //!< The total number of bytes received on the interface, including framing characters.
349  ULONG radio_PacketsSent; //!< The total number of packets transmitted out of the interface.
350  ULONG radio_PacketsReceived; //!< The total number of packets received on the interface.
351 
352  ULONG radio_ErrorsSent; //!< The total number of outbound packets that could not be transmitted because of errors.
353  ULONG radio_ErrorsReceived; //!< The total number of inbound packets that contained errors preventing them from being delivered to a higher-layer protocol.
354  ULONG radio_DiscardPacketsSent; //!< The total number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space.
355  ULONG radio_DiscardPacketsReceived; //!< The total number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being delivered. One possible reason for discarding such a packet could be to free up buffer space.
356  ULONG radio_PLCPErrorCount; //!< The number of packets that were received with a detected Physical Layer Convergence Protocol (PLCP) header error.
357  ULONG radio_FCSErrorCount; //!< The number of packets that were received with a detected FCS error. This parameter is based on dot11FCSErrorCount from [Annex C/802.11-2012].
358  ULONG radio_InvalidMACCount; //!< The number of packets that were received with a detected invalid MAC header error.
359  ULONG radio_PacketsOtherReceived; //!< The number of packets that were received, but which were destined for a MAC address that is not associated with this interface.
360  INT radio_NoiseFloor; //!< The noise floor for this radio channel where a recoverable signal can be obtained. Expressed as a signed integer in the range (-110:0). Measurement should capture all energy (in dBm) from sources other than Wi-Fi devices as well as interference from Wi-Fi devices too weak to be decoded. Measured in dBm
361  ULONG radio_ChannelUtilization; //!< Percentage of time the channel was occupied by the radio’s own activity (Activity Factor) or the activity of other radios. Channel utilization MUST cover all user traffic, management traffic, and time the radio was unavailable for CSMA activities, including DIFS intervals, etc. The metric is calculated and updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected from the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in Percentage
362  INT radio_ActivityFactor; //!< Percentage of time that the radio was transmitting or receiving Wi-Fi packets to/from associated clients. Activity factor MUST include all traffic that deals with communication between the radio and clients associated to the radio as well as management overhead for the radio, including NAV timers, beacons, probe responses,time for receiving devices to send an ACK, SIFC intervals, etc. The metric is calculated and updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected from the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in Percentage
363  INT radio_CarrierSenseThreshold_Exceeded; //!< Percentage of time that the radio was unable to transmit or receive Wi-Fi packets to/from associated clients due to energy detection (ED) on the channel or clear channel assessment (CCA). The metric is calculated and updated in this Parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected from the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in Percentage
364  INT radio_RetransmissionMetirc; //!< Percentage of packets that had to be re-transmitted. Multiple re-transmissions of the same packet count as one. The metric is calculated and updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected from the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in percentage
365  INT radio_MaximumNoiseFloorOnChannel; //!< Maximum Noise on the channel during the measuring interval. The metric is updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected in the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in dBm
366  INT radio_MinimumNoiseFloorOnChannel; //!< Minimum Noise on the channel. The metric is updated in this Parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected in the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in dBm
367  INT radio_MedianNoiseFloorOnChannel; //!< Median Noise on the channel during the measuring interval. The metric is updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected in the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in dBm
368  ULONG radio_StatisticsStartTime; //!< The date and time at which the collection of the current set of statistics started. This time must be updated whenever the radio statistics are reset.
369 
370 } wifi_radioTrafficStats_t; //for radio only
371 
373 {
374  INT radio_RadioStatisticsMeasuringRate; //!< Input //"The rate at which radio related statistics are periodically collected. Only statistics that explicitly indicate the use of this parameter MUST use the rate set in this parameter Other parameter's are assumed to collect data in real-time or nearly real-time. Default value is 30 seconds. This parameter MUST be persistent across reboots. If this parameter is changed, then use of the new rate MUST be deferred until the start of the next interval and all metrics using this rate MUST return -1 until the completion of the next full interval Units in Seconds"
375  INT radio_RadioStatisticsMeasuringInterval; //!< Input //The interval for which radio data MUST be retained in order and at the end of which appropriate calculations are executed and reflected in the associated radio object's. Only statistics that explicitly indicate the use of this parameter MUST use the interval set in this parameter Default value is 30 minutes. This parameter MUST be persistent across reboots. If this item is modified, then all metrics leveraging this interval as well as the metrics “Total number 802.11 packet of TX” and “Total number 802.11 packet of RX“ MUST be re-initialized immediately. Additionally, the “Statistics Start Time” must be reset to the current time. Units in Seconds
376 } wifi_radioTrafficStatsMeasure_t; //for radio only
377 
378 
380 {
381  ULONG ssid_BytesSent; //!< The total number of bytes transmitted out of the interface, including framing characters.
382  ULONG ssid_BytesReceived; //!< The total number of bytes received on the interface, including framing characters.
383  ULONG ssid_PacketsSent; //!< The total number of packets transmitted out of the interface.
384  ULONG ssid_PacketsReceived; //!< The total number of packets received on the interface.
385 
386  ULONG ssid_RetransCount; //!< The total number of transmitted packets which were retransmissions. Two retransmissions of the same packet results in this counter incrementing by two.
387  ULONG ssid_FailedRetransCount; //!< The number of packets that were not transmitted successfully due to the number of retransmission attempts exceeding an 802.11 retry limit. This parameter is based on dot11FailedCount from [802.11-2012].
388  ULONG ssid_RetryCount; //The number of packets that were successfully transmitted after one or more retransmissions. This parameter is based on dot11RetryCount from [802.11-2012].
389  ULONG ssid_MultipleRetryCount; //!< The number of packets that were successfully transmitted after more than one retransmission. This parameter is based on dot11MultipleRetryCount from [802.11-2012].
390  ULONG ssid_ACKFailureCount; //The number of expected ACKs that were never received. This parameter is based on dot11ACKFailureCount from [802.11-2012].
391  ULONG ssid_AggregatedPacketCount; //!< The number of aggregated packets that were transmitted. This applies only to 802.11n and 802.11ac.
392 
393  ULONG ssid_ErrorsSent; //!< The total number of outbound packets that could not be transmitted because of errors.
394  ULONG ssid_ErrorsReceived; //!< The total number of inbound packets that contained errors preventing them from being delivered to a higher-layer protocol.
395  ULONG ssid_UnicastPacketsSent; //!< The total number of inbound packets that contained errors preventing them from being delivered to a higher-layer protocol.
396  ULONG ssid_UnicastPacketsReceived; //!< The total number of received packets, delivered by this layer to a higher layer, which were not addressed to a multicast or broadcast address at this layer.
397  ULONG ssid_DiscardedPacketsSent; //The total number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space.
398  ULONG ssid_DiscardedPacketsReceived; //!< The total number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being delivered. One possible reason for discarding such a packet could be to free up buffer space.
399  ULONG ssid_MulticastPacketsSent; //!< The total number of packets that higher-level protocols requested for transmission and which were addressed to a multicast address at this layer, including those that were discarded or not sent.
400  ULONG ssid_MulticastPacketsReceived; //!< The total number of received packets, delivered by this layer to a higher layer, which were addressed to a multicast address at this layer.
401  ULONG ssid_BroadcastPacketsSent; //!< The total number of packets that higher-level protocols requested for transmission and which were addressed to a broadcast address at this layer, including those that were discarded or not sent.
402  ULONG ssid_BroadcastPacketsRecevied; //!< The total number of packets that higher-level protocols requested for transmission and which were addressed to a broadcast address at this layer, including those that were discarded or not sent.
403  ULONG ssid_UnknownPacketsReceived; //!< The total number of packets received via the interface which were discarded because of an unknown or unsupported protocol.
404 
405 } wifi_ssidTrafficStats_t; //for ssid only
406 
407 
408 //Please do not edit the elements for this data structure
409 typedef struct _wifi_neighbor_ap
410 {
411  //CHAR ap_Radio[64]; //!< The value MUST be the path name of a row in the Device.WiFi.Radio table. The Radio that detected the neighboring WiFi SSID.
412  CHAR ap_SSID[64]; //!< The current service set identifier in use by the neighboring WiFi SSID. The value MAY be empty for hidden SSIDs.
413  CHAR ap_BSSID[64]; //!< [MACAddress] The BSSID used for the neighboring WiFi SSID.
414  CHAR ap_Mode[64]; //!< The mode the neighboring WiFi radio is operating in. Enumeration of: AdHoc, Infrastructure
415  UINT ap_Channel; //!< The current radio channel used by the neighboring WiFi radio.
416  INT ap_SignalStrength; //!< An indicator of radio signal strength (RSSI) of the neighboring WiFi radio measured in dBm, as an average of the last 100 packets received.
417  CHAR ap_SecurityModeEnabled[64]; //!< The type of encryption the neighboring WiFi SSID advertises. Enumeration of:None, WPA-WPA2 etc.
418  CHAR ap_EncryptionMode[64]; //!< Comma-separated list of strings. The type of encryption the neighboring WiFi SSID advertises. Each list item is an enumeration of: TKIP, AES
419  CHAR ap_OperatingFrequencyBand[16]; //!< Indicates the frequency band at which the radio this SSID instance is operating. Enumeration of:2.4GHz, 5GHz
420  CHAR ap_SupportedStandards[64]; //!< Comma-separated list of strings. List items indicate which IEEE 802.11 standards this Result instance can support simultaneously, in the frequency band specified by OperatingFrequencyBand. Each list item is an enumeration of:
421  CHAR ap_OperatingStandards[16]; //!< Comma-separated list of strings. Each list item MUST be a member of the list reported by theSupportedStandards parameter. List items indicate which IEEE 802.11 standard that is detected for thisResult.
422  CHAR ap_OperatingChannelBandwidth[16]; //!< Indicates the bandwidth at which the channel is operating. Enumeration of:
423  UINT ap_BeaconPeriod; //!< Time interval (in ms) between transmitting beacons.
424  INT ap_Noise; //!< Indicator of average noise strength (in dBm) received from the neighboring WiFi radio.
425  CHAR ap_BasicDataTransferRates[256]; //!< Comma-separated list (maximum list length 256) of strings. Basic data transmit rates (in Mbps) for the SSID. For example, if BasicDataTransferRates is "1,2", this indicates that the SSID is operating with basic rates of 1 Mbps and 2 Mbps.
426  CHAR ap_SupportedDataTransferRates[256]; //!< Comma-separated list (maximum list length 256) of strings. Data transmit rates (in Mbps) for unicast frames at which the SSID will permit a station to connect. For example, if SupportedDataTransferRates is "1,2,5.5", this indicates that the SSID will only permit connections at 1 Mbps, 2 Mbps and 5.5 Mbps.
427  UINT ap_DTIMPeriod; //!< The number of beacon intervals that elapse between transmission of Beacon frames containing a TIM element whose DTIM count field is 0. This value is transmitted in the DTIM Period field of beacon frames. [802.11-2012]
428  UINT ap_ChannelUtilization[64]; //!< Indicates the fraction of the time AP senses that the channel is in use by the neighboring AP for transmissions.
429 
430 } wifi_neighbor_ap_t; //COSA_DML_NEIGHTBOURING_WIFI_RESULT
431 
433 {
434  CHAR ipping_Interface[256]; //!< The value MUST be the path name of a row in the IP.Interface table. The IP-layer interface over which the test is to be performed. This identifies the source IP address to use when performing the test. Example: Device.IP.Interface.1. If an empty string is specified, the CPE MUST use the interface as directed by its routing policy (Forwarding table entries) to determine the appropriate interface.
435  CHAR ipping_Host[256]; //!< Host name or address of the host to ping. In the case where Host is specified by name, and the name resolves to more than one address, it is up to the device implementation to choose which address to use.
436  UINT ipping_NumberOfRepetitions; //!< Number of repetitions of the ping test to perform before reporting the results.
437  UINT ipping_Timeout; //!< Timeout in milliseconds for the ping test.
438  UINT ipping_DataBlockSize; //!< Size of the data block in bytes to be sent for each ping.
439  UINT ipping_DSCP; //!< DiffServ codepoint to be used for the test packets. By default the CPE SHOULD set this value to zero.
440 
442 
444 {
445  CHAR ipping_DiagnosticsState[64]; //!<Indicates availability of diagnostic data. Enumeration of: Complete, Error_CannotResolveHostName, Error_Internal, Error_Other
446  UINT ipping_SuccessCount; //!<Result parameter indicating the number of successful pings (those in which a successful response was received prior to the timeout) in the most recent ping test.
447  UINT ipping_FailureCount; //!<Result parameter indicating the number of failed pings in the most recent ping test.
448  UINT ipping_AverageResponseTime; //!<Result parameter indicating the average response time in milliseconds over all repetitions with successful responses of the most recent ping test. If there were no successful responses, this value MUST be zero.
449  UINT ipping_MinimumResponseTime; //!<Result parameter indicating the minimum response time in milliseconds over all repetitions with successful responses of the most recent ping test. If there were no successful responses, this value MUST be zero.
450  UINT ipping_MaximumResponseTime; //!<Result parameter indicating the maximum response time in milliseconds over all repetitions with successful responses of the most recent ping test. If there were no successful responses, this value MUST be zero.
451 
453 
454 
455 typedef struct _wifi_sta_stats
456 {
457  CHAR sta_SSID[64]; //!< The current connected SSID name.
458  CHAR sta_BSSID[64]; //!< The BSSID used for connected SSID.
459  CHAR sta_BAND[16]; //!< The BAND used for connected SSID.
460  CHAR sta_SecMode[64]; //!< WiFi Security Mode WPA2-PSK , WPA2-EAP etc..
461  CHAR sta_Encryption[64]; //!< WiFi Encryption Type AES, TKIP, etc.
462  FLOAT sta_PhyRate; //!< Indicates the Physical rate (Mbps)
463  FLOAT sta_Noise; //!< Indicator of average noise strength (in dBm) received from the connected WiFi radio.
464  FLOAT sta_RSSI; //!< RSSI value in dBm
465  UINT sta_Frequency; //!< Current Operating Frequency.
466  UINT sta_LastDataDownlinkRate; /**< The data transmit rate in kbps that was most recently used for transmission from the access point to the end point device. */
467  UINT sta_LastDataUplinkRate; /**< The data transmit rate in kbps that was most recently used for transmission from the end point to the access point device.*/
468  UINT sta_Retransmissions; /**< The number of packets that had to be re-transmitted, from the last 100 packets sent to the access point. \
469  Multiple re-transmissions of the same packet count as one.*/
471 /** @} */
472 
473 //---------------------------------------------------------------------------------------------------
474 //Wifi system api
475 //Get the wifi hal version in string, eg "2.0.0". WIFI_HAL_MAJOR_VERSION.WIFI_HAL_MINOR_VERSION.WIFI_HAL_MAINTENANCE_VERSION
476 INT wifi_getHalVersion(CHAR *output_string); //RDKB
477 
478 //---------------------------------------------------------------------------------------------------
479 //
480 // Wifi subsystem level APIs that are common to Client and Access Point devices.
481 //
482 //---------------------------------------------------------------------------------------------------
483 /**
484  * @addtogroup WIFI_HAL_COMMON_API
485  * @{
486  */
487 
488 /**
489  * @brief Implements factory reset of the Wi-Fi subsystem.
490  *
491  * Factory reset of the Wi-Fi subsystem is done by unloading the WLAN driver
492  * and wpa_supplicant and restores factory wpa_supplicant configuration file.
493  *
494  * @return The status of the operation.
495  * @retval RETURN_OK if successful.
496  * @retval RETURN_ERR if any error is detected.
497  *
498  * @note This function must not suspend and must not invoke any blocking system 
499  * calls. It should probably just send a message to a driver event handler task. 
500  */
501 INT wifi_factoryReset(); //RDKB
502 
503 /**
504  * @brief Reset all radio parameters.
505  *
506  * Restore all radio parameters without touching access point parameters.
507  *
508  * @return The status of the operation.
509  * @retval RETURN_OK if successful.
510  * @retval RETURN_ERR if any error is detected.
511  *
512  * @note This function must not suspend and must not invoke any blocking system
513  * calls. It should probably just send a message to a driver event handler task.
514  */
515 INT wifi_factoryResetRadios(); //RDKB
516 
517 /**
518  * @brief Reset specified radio parameter.
519  *
520  * Restore selected radio parameters without touch access point parameters.
521  *
522  * @param[in] radioIndex The index of the radio.
523  * First radio is index 0. 2nd radio is index 1.
524  *
525  * @return The status of the operation.
526  * @retval RETURN_OK if successful.
527  * @retval RETURN_ERR if any error is detected.
528  *
529  * @note This function must not suspend and must not invoke any blocking system
530  * calls. It should probably just send a message to a driver event handler task.
531  *
532  */
533 INT wifi_factoryResetRadio(int radioIndex); //RDKB
534 
535 //Set the system LED status
536 //INT wifi_setLED(INT apIndex, BOOL enable); //RDKB
537 
538 /**
539  * @brief Initializes the wifi subsystem.
540  *
541  * Steps involved in a wifi_init operation
542  * - Creating default configuration file in a firsttime boot.
543  * - Reset the state machine.
544  * - Starting of wpa_supplicant daemon.
545  * - Opening up communication channels for monitoring and control interfaces
546  * - Invoking the event monitoring thread.
547  *
548  * @return The status of the operation.
549  * @retval RETURN_OK if successful.
550  * @retval RETURN_ERR if any error is detected.
551  *
552  * @note This function must not suspend and must not invoke any blocking system
553  * calls. It should probably just send a message to a driver event handler task.
554  */
555 INT wifi_init(); //RDKB
556 
557 #define WLAN_IFNAMSIZ 32
558 
559 typedef struct _wifi_halSettings
560 {
561  char wlan_Interface[WLAN_IFNAMSIZ];
563 
564 INT wifi_initWithConfig(wifi_halConfig_t * conf);
565 
566 /**
567  * @brief Deletes all the saved access point configuration details.
568  *
569  * @return The status of the operation.
570  * @retval RETURN_OK if successful.
571  * @retval RETURN_ERR if any error is detected.
572  *
573  * @note This function must not suspend and must not invoke any blocking system
574  * calls. It should probably just send a message to a driver event handler task.
575  */
576 INT wifi_reset(); //RDKB
577 
578 /**
579  * @brief Turns off transmit power for the entire Wifi subsystem, for all radios.
580  *
581  * @return The status of the operation.
582  * @retval RETURN_OK if successful.
583  * @retval RETURN_ERR if any error is detected.
584  *
585  * @note This function must not suspend and must not invoke any blocking system
586  * calls. It should probably just send a message to a driver event handler task.
587  */
588 INT wifi_down(); //RDKB
589 
590 /**
591  * @brief Uninitilizes wifi module.
592  *
593  * @return The status of the operation.
594  * @retval RETURN_OK if successful.
595  * @retval RETURN_ERR if any error is detected.
596  */
597 INT wifi_uninit();
598  //RDKB
599 /**
600  * @brief Creates wifi configuration files.
601  *
602  * The format and content of these files are implementation dependent. This function call is
603  * used to trigger this task if necessary. Some implementations may not need this
604  * function. If an implementation does not need to create config files the function call can
605  * do nothing and return RETURN_OK.
606  *
607  * @return The status of the operation.
608  * @retval RETURN_OK if successful.
609  * @retval RETURN_ERR if any error is detected. 
610  *
611  * @note This function must not suspend and must not invoke any blocking system 
612  * calls. It should probably just send a message to a driver event handler task. 
613  */
615 
616 // log wifi parameters format SSID: BSSID: ulChan: Noise: RSSI:
617 
618 /**
619  * @brief Returns current station connection status.
620  *
621  * @param[in] radioIndex The index of the radio.
622  * @param[out] wifi_sta_stats Station status data.
623  */
624 void wifi_getStats(INT radioIndex, wifi_sta_stats_t *wifi_sta_stats);
625 
626 
627 //---------------------------------------------------------------------------------------------------
628 //Wifi Tr181 API
629 
630 //Device.WiFi.
631 
632 //Device.WiFi.RadioNumberOfEntries
633 
634 /**
635  * @brief Get total number of radios in the wifi subsystem.
636  *
637  * @param[out] output Outputs the number of radios in string.
638  *
639  * @return The status of the operation.
640  * @retval RETURN_OK if successful.
641  * @retval RETURN_ERR if any error is detected. 
642  */
643 INT wifi_getRadioNumberOfEntries(ULONG *output); //Tr181
644 
645 
646 //Device.WiFi.SSIDNumberOfEntries
647 /**
648  * @brief Get the total number of SSID entries in the wifi subsystem.
649  *
650  * @param[out] output Outputs the number of SSID entries in string.
651  *
652  * @return The status of the operation.
653  * @retval RETURN_OK if successful.
654  * @retval RETURN_ERR if any error is detected. 
655  */
656 INT wifi_getSSIDNumberOfEntries(ULONG *output); //Tr181
657 
658 
659 //Device.WiFi.AccessPointNumberOfEntries
660 
661 //Device.WiFi.EndPointNumberOfEntries
662 //End points are managed by RDKB
663 //INT wifi_getEndPointNumberOfEntries(INT radioIndex, ULONG *output); //Tr181
664 
665 //---------------------------------------------------------------------------------------------------
666 //
667 // Wifi radio level APIs that are common to Client and Access Point devices
668 //
669 //---------------------------------------------------------------------------------------------------
670 
671 
672 //Device.WiFi.Radio.
673 
674 //Device.WiFi.Radio.{i}.Enable
675 
676 /**
677  * @brief Get the Radio enable config parameter.
678  *
679  * If the radio is enable, return TRUE, otherwise FALSE.
680  *
681  * @param[in] radioIndex The index of radio.
682  * @param[out] output_bool output of the radio state.
683  *
684  * @return The status of the operation.
685  * @retval RETURN_OK if successful.
686  * @retval RETURN_ERR if any error is detected.
687  */
688 INT wifi_getRadioEnable(INT radioIndex, BOOL *output_bool); //RDKB
689 
690 /**
691  * @brief Set the Radio enable config parameter.
692  *
693  * If the radio is enable, return TRUE, otherwise FALSE.
694  *
695  * @param[in] radioIndex The index of radio.
696  * @param[out] enable output of the radio state.
697  *
698  * @return The status of the operation.
699  * @retval RETURN_OK if successful.
700  * @retval RETURN_ERR if any error is detected.
701  */
702 INT wifi_setRadioEnable(INT radioIndex, BOOL enable); //RDKB
703 
704 //Device.WiFi.Radio.{i}.Status
705 
706 /**
707  * @brief Get the Radio enable status.
708  *
709  * Wi-Fi is up when the driver is loaded, and control/monitoring socket is open between HAL and wpa_supplicant.
710  *
711  * @param[in] radioIndex The index of radio.
712  * @param[out] output_string output of the radio status.
713  *
714  * @return The status of the operation.
715  * @retval RETURN_OK if successful.
716  * @retval RETURN_ERR if any error is detected.
717  */
718 INT wifi_getRadioStatus(INT radioIndex, CHAR *output_string); //RDKB
719 
720 //Device.WiFi.Radio.{i}.Alias
721 
722 //Device.WiFi.Radio.{i}.Name
723 
724 /**
725  * @brief Get the Radio Interface name from platform.
726  *
727  * @param[in] radioIndex The index of radio.
728  * @param[out] output_string Output string which stores the radio interface name.
729  *
730  * @return The status of the operation.
731  * @retval RETURN_OK if successful.
732  * @retval RETURN_ERR if any error is detected.
733  */
734 INT wifi_getRadioIfName(INT radioIndex, CHAR *output_string); //Tr181
735 
736 //Device.WiFi.Radio.{i}.LastChange
737 
738 //Device.WiFi.Radio.{i}.LowerLayers
739 
740 //Device.WiFi.Radio.{i}.Upstream
741 
742 //Device.WiFi.Radio.{i}.MaxBitRate
743 
744 /**
745  * @brief Get the maximum PHY bit rate supported by the interface.
746  *
747  * Can use netlink APIs to retrieve the maximum bit rate value
748  * Output is of the format "X.X Mb/s", "X.X Gb/s"
749  * Eg. "216.7 Mb/s", "1.3 Gb/s"
750  *
751  * @param[in] radioIndex The index of radio.
752  * @param[out] output_string Output string which stores the maximum bit rate value.
753  *
754  * @return The status of the operation.
755  * @retval RETURN_OK if successful.
756  * @retval RETURN_ERR if any error is detected.
757  */
758 INT wifi_getRadioMaxBitRate(INT radioIndex, CHAR *output_string); //RDKB
759 
760 //Device.WiFi.Radio.{i}.SupportedFrequencyBands
761 
762 /**
763  * @brief Get Supported frequency bands at which the radio can operate.
764  *
765  * Output is comma seperated Values. Eg: 2.4Ghz,5Ghz.
766  *
767  * @param[in] radioIndex The index of the radio.
768  * @param[out] output_string Output string which stores the supported freq band.
769  *
770  * @return The status of the operation.
771  * @retval RETURN_OK if successful.
772  * @retval RETURN_ERR if any error is detected.
773  */
774 INT wifi_getRadioSupportedFrequencyBands(INT radioIndex, CHAR *output_string); //RDKB
775 
776 //Device.WiFi.Radio.{i}.OperatingFrequencyBand
777 
778 /**
779  * @brief Get the frequency band at which the radio is operating.
780  *
781  * RKD-V support STATION interface only.
782  * Output format: Example: "2.4GHz", NULL if not connected.
783  *
784  * @param[in] radioIndex The index of the radio.
785  * @param[out] output_string Output string which stores current operating band.
786  *
787  * @return The status of the operation.
788  * @retval RETURN_OK if successful.
789  * @retval RETURN_ERR if any error is detected.
790  */
791 INT wifi_getRadioOperatingFrequencyBand(INT radioIndex, CHAR *output_string); //Tr181
792 
793 //Device.WiFi.Radio.{i}.SupportedStandards
794 
795 /**
796  * @brief Get Supported frequency bands at which the radio can operate.
797  *
798  * Output is comma seperated Values. Eg: 2.4Ghz,5Ghz.
799  *
800  * @param[in] radioIndex The index of the radio.
801  * @param[out] output_string Output string which stores the supported freq band.
802  *
803  * @return The status of the operation.
804  * @retval RETURN_OK if successful.
805  * @retval RETURN_ERR if any error is detected.
806  */
807 INT wifi_getRadioSupportedStandards(INT radioIndex, CHAR *output_string); //Tr181
808 
809 //Device.WiFi.Radio.{i}.OperatingStandards
810 
811 /**
812  * @brief Get the radio operating mode and pure mode flag.
813  * Mode flags are the IEEE 802.11 standards to indicate the maximum network bandwidth supported.
814  *
815  * @param[in] radioIndex The index of the radio.
816  * @param[in] channelMode the channel mode.
817  * @param[in] gOnlyFlag the g-only mode.
818  * @param[in] nOnlyFlag the n-only mode.
819  * @param[in] acOnlyFlag the ac-only mode.
820  *
821  * @return The status of the operation.
822  * @retval RETURN_OK if successful.
823  * @retval RETURN_ERR if any error is detected.
824  */
825 INT wifi_getRadioStandard(INT radioIndex, CHAR *output_string, BOOL *gOnly, BOOL *nOnly, BOOL *acOnly); //RDKB
826 
827 /**
828  * @brief Set the radio operating mode and pure mode flag.
829  *
830  * @param[in] radioIndex The index of the radio.
831  * @param[in] channelMode the channel mode.
832  * @param[in] gOnlyFlag the g-only mode.
833  * @param[in] nOnlyFlag the n-only mode.
834  * @param[in] acOnlyFlag the ac-only mode.
835  *
836  * @return The status of the operation.
837  * @retval RETURN_OK if successful.
838  * @retval RETURN_ERR if any error is detected.
839  */
840 INT wifi_setRadioChannelMode(INT radioIndex, CHAR *channelMode, BOOL gOnlyFlag, BOOL nOnlyFlag, BOOL acOnlyFlag); //RDKB
841 
842 //Device.WiFi.Radio.{i}.PossibleChannels
843 
844 /**
845  * @brief Gets the supported channel list.
846  *
847  * Can use netlink APIs to retrieve the supported channel list.
848  * Output Format: Comma seperated range / values
849  *
850  * Example: 1-11,36-48,149-161
851 
852  * @param[in] radioIndex The index of the radio
853  * @param[out] output_string Output string which stores the supported channels.
854  *
855  * @return The status of the operation.
856  * @retval RETURN_OK if successful.
857  * @retval RETURN_ERR if any error is detected.
858  */
859 INT wifi_getRadioPossibleChannels(INT radioIndex, CHAR *output_string); //RDKB
860 
861 //Device.WiFi.Radio.{i}.ChannelsInUse
862 
863 /**
864  * @brief Gets the list of channels currently in use.
865  *
866  * @param[in] radioIndex The index of the radio.
867  * @param[out] output_string Output string which stores the list of used channels.
868  *
869  * @return The status of the operation.
870  * @retval RETURN_OK if successful.
871  * @retval RETURN_ERR if any error is detected.
872  */
873 INT wifi_getRadioChannelsInUse(INT radioIndex, CHAR *output_string); //RDKB
874 
875 //Device.WiFi.Radio.{i}.Channel
876 
877 /**
878  * @brief Get the running channel number.
879  *
880  * @param[in] radioIndex The index of the radio.
881  * @param[out] output_ulong Variable which stores the currently used channel number.
882  *
883  * @return The status of the operation.
884  * @retval RETURN_OK if successful.
885  * @retval RETURN_ERR if any error is detected.
886  */
887 INT wifi_getRadioChannel(INT radioIndex,ULONG *output_ulong); //RDKB
888 
889 /**
890  * @brief Set the running channel number.
891  *
892  * @param[in] radioIndex The index of the radio.
893  * @param[in] channel Channel number to be set.
894  *
895  * @return The status of the operation.
896  * @retval RETURN_OK if successful.
897  * @retval RETURN_ERR if any error is detected.
898  */
899 INT wifi_setRadioChannel(INT radioIndex, ULONG channel); //RDKB //AP only
900 
901 //Device.WiFi.Radio.{i}.AutoChannelSupported
902 
903 /**
904  * @brief Check if the driver support the Auto Channel Selection / Dynamic channel selection.
905  *
906  * @param[in] radioIndex The index of the radio.
907  * @param[out] output_bool Stores the Auto Channel Selection / Dynamic channel selection support status.
908  *
909  * @return The status of the operation.
910  * @retval RETURN_OK if successful.
911  * @retval RETURN_ERR if any error is detected.
912  */
913 INT wifi_getRadioAutoChannelSupported(INT radioIndex, BOOL *output_bool); //Tr181
914 
915 /**
916  * @brief Get the Auto Channel Selection / Dynamic channel selection enable status.
917  *
918  * @param[in] radioIndex The index of the radio.
919  * @param[out] output_bool Stores the Auto Channel Selection / Dynamic channel selection status.
920  *
921  * @return The status of the operation.
922  * @retval RETURN_OK if successful.
923  * @retval RETURN_ERR if any error is detected.
924  */
925 INT wifi_getRadioAutoChannelEnable(INT radioIndex, BOOL *output_bool); //RDKB
926 
927 /**
928  * @brief Set the Auto Channel Selection / Dynamic channel selection enable status.
929  *
930  * @param[in] radioIndex The index of the radio.
931  * @param[out] enable Boolean value to enable or disable the Auto Channel Selection / Dynamic channel selection.
932  *
933  * @return The status of the operation.
934  * @retval RETURN_OK if successful.
935  * @retval RETURN_ERR if any error is detected.
936  */
937 INT wifi_setRadioAutoChannelEnable(INT radioIndex, BOOL enable); //RDKB
938 
939 //Device.WiFi.Radio.{i}.AutoChannelRefreshPeriod
940 
941 /**
942  * @brief Get the Auto Channel Selection / Dynamic channel selection refresh period in seconds.
943  *
944  * @param[in] radioIndex The index of the radio.
945  * @param[out] output_ulong Output variable that stores the Auto Channel Selection / Dynamic channel selection refresh period.
946  *
947  * @return The status of the operation.
948  * @retval RETURN_OK if successful.
949  * @retval RETURN_ERR if any error is detected.
950  */
951 
952 INT wifi_getRadioAutoChannelRefreshPeriod(INT radioIndex, ULONG *output_ulong); //Tr181
953 
954 /**
955  * @brief Set the Auto Channel Selection / Dynamic channel selection refresh period in seconds.
956  *
957  * @param[in] radioIndex The index of the radio
958  * @param[in] seconds The number of seconds of Auto Channel Selection / Dynamic channel selection refresh period.
959  *
960  * @return The status of the operation.
961  * @retval RETURN_OK if successful.
962  * @retval RETURN_ERR if any error is detected.
963  */
964 INT wifi_setRadioAutoChannelRefreshPeriod(INT radioIndex, ULONG seconds); //Tr181
965 
966 //Device.WiFi.Radio.{i}.OperatingChannelBandwidth
967 /**
968  * @brief Get the Operating Channel Bandwidth.
969  *
970  * Can use Netlink APIs to retrieve the operating channel bandwidth.
971  * Output format Example: "20MHz", "40MHz", "80MHz", "80+80", "160" / NULL if not connected.
972  *
973  * @param[in] radioIndex The index of the radio.
974  * @param[out] output_string Output variable stores the bandwidth of the operating channel.
975  *
976  * @return The status of the operation.
977  * @retval RETURN_OK if successful.
978  * @retval RETURN_ERR if any error is detected.
979  */
980 INT wifi_getRadioOperatingChannelBandwidth(INT radioIndex, CHAR *output_string); //Tr181
981 
982 /**
983  * @brief Set the Operating Channel Bandwidth.
984  *
985  * @param[in] radioIndex The index of the radio.
986  * @param[in] bandwidth The bandwidth to be set.
987  *
988  * @return The status of the operation.
989  * @retval RETURN_OK if successful.
990  * @retval RETURN_ERR if any error is detected.
991  */
992 INT wifi_setRadioOperatingChannelBandwidth(INT radioIndex, CHAR *bandwidth); //Tr181 //AP only
993 
994 //Device.WiFi.Radio.{i}.ExtensionChannel
995 
996 /**
997  * @brief Get the secondary extension channel position.
998  *
999  * A secondary channel helps in channel bonding where primary and secondary channels can be
1000  * combined to create a wide channel which can provide more data rate.
1001  * Position of secondary channel may be either above or below the primary.
1002  *
1003  * @param[in] radioIndex The index of the radio.
1004  * @param[out] output_string Output of the secondary extension channel.
1005  *
1006  * @return The status of the operation.
1007  * @retval RETURN_OK if successful.
1008  * @retval RETURN_ERR if any error is detected.
1009  */
1010 INT wifi_getRadioExtChannel(INT radioIndex, CHAR *output_string); //Tr181
1011 
1012 /**
1013  * @brief Set the extension channel.
1014  *
1015  * @param[in] radioIndex The index of the radio.
1016  * @param[in] string The extension channel to set.
1017  *
1018  * @return The status of the operation.
1019  * @retval RETURN_OK if successful.
1020  * @retval RETURN_ERR if any error is detected.
1021  */
1022 INT wifi_setRadioExtChannel(INT radioIndex, CHAR *string); //Tr181 //AP only
1023 
1024 //Device.WiFi.Radio.{i}.GuardInterval
1025 
1026 /**
1027  * @brief Get the guard interval value. eg "400nsec" or "800nsec".
1028  *
1029  * @param[in] radioIndex The index of the radio.
1030  * @param[out] output_string Returns the guard interval value.
1031  *
1032  * @return The status of the operation.
1033  * @retval RETURN_OK if successful.
1034  * @retval RETURN_ERR if any error is detected.
1035  */
1036 INT wifi_getRadioGuardInterval(INT radioIndex, CHAR *output_string); //Tr181
1037 
1038 /**
1039  * @brief Set the guard interval value.
1040  *
1041  * @param[in] radioIndex The index of the radio.
1042  * @param[out] string The guard interval value to set.
1043  *
1044  * @return The status of the operation.
1045  * @retval RETURN_OK if successful.
1046  * @retval RETURN_ERR if any error is detected.
1047  */
1048 INT wifi_setRadioGuardInterval(INT radioIndex, CHAR *string); //Tr181
1049 
1050 //Device.WiFi.Radio.{i}.MCS
1051 
1052 /**
1053  * @brief Get the Modulation Coding Scheme index.
1054  *
1055  * @param[in] radioIndex The index of the radio.
1056  * @param[out] output_INT The mcs index value.
1057  *
1058  * @return The status of the operation.
1059  * @retval RETURN_OK if successful.
1060  * @retval RETURN_ERR if any error is detected.
1061  */
1062 INT wifi_getRadioMCS(INT radioIndex, INT *output_INT); //Tr181
1063 
1064 /**
1065  * @brief Set the Modulation Coding Scheme index.
1066  *
1067  * @param[in] radioIndex The index of the radio.
1068  * @param[in] MCS The mcs index to set.
1069  *
1070  * @return The status of the operation.
1071  * @retval RETURN_OK if successful.
1072  * @retval RETURN_ERR if any error is detected.
1073  */
1074 INT wifi_setRadioMCS(INT radioIndex, INT MCS); //Tr181
1075 
1076 //Device.WiFi.Radio.{i}.TransmitPowerSupported
1077 
1078 /**
1079  * @brief Get supported Transmit Power list.
1080  *
1081  * @param[in] radioIndex The index of the radio.
1082  * @param[out] output_list Output string stores the transmit power list.
1083  *
1084  * @return The status of the operation.
1085  * @retval RETURN_OK if successful.
1086  * @retval RETURN_ERR if any error is detected.
1087  */
1088 INT wifi_getRadioTransmitPowerSupported(INT radioIndex, CHAR *output_list); //Tr181
1089 
1090 //Device.WiFi.Radio.{i}.TransmitPower
1091 
1092 /**
1093  * @brief Get the current transmit Power.
1094  *
1095  * The transmit power level is in units of full power for this radio.
1096  *
1097  * @param[in] radioIndex The index of the radio.
1098  * @param[out] output_INT Output string stores the current transmit power.
1099  *
1100  * @return The status of the operation.
1101  * @retval RETURN_OK if successful.
1102  * @retval RETURN_ERR if any error is detected.
1103  */
1104 INT wifi_getRadioTransmitPower(INT radioIndex, INT *output_INT); //RDKB
1105 
1106 /**
1107  * @brief Set the transmit power.
1108  *
1109  * @param[in] radioIndex The index of the radio.
1110  * @param[in] TransmitPower The transmit power to set.
1111  *
1112  * @return The status of the operation.
1113  * @retval RETURN_OK if successful.
1114  * @retval RETURN_ERR if any error is detected.
1115  */
1116 
1117 INT wifi_setRadioTransmitPower(INT radioIndex, ULONG TransmitPower); //RDKB
1118 
1119 //Device.WiFi.Radio.{i}.IEEE80211hSupported
1120 
1121 /**
1122  * @brief Function to check 80211h is supported or not.
1123  *
1124  * 80211h solves interference with satellites and radar using the same 5 GHz frequency band.
1125  *
1126  * @param[in] radioIndex The index of the radio.
1127  * @param[out] Supported The Boolean value, indicates the 80211h support.
1128  *
1129  * @return The status of the operation.
1130  * @retval RETURN_OK if successful.
1131  * @retval RETURN_ERR if any error is detected.
1132  */
1133 int wifi_getRadioIEEE80211hSupported(INT radioIndex, BOOL *Supported); //Tr181
1134 
1135 //Device.WiFi.Radio.{i}.IEEE80211hEnabled
1136 
1137 /**
1138  * @brief Get the 80211h feature enable.
1139  *
1140  * @param[in] radioIndex The index of the radio.
1141  * @param[out] enable The 80211h enable status.
1142  *
1143  * @return The status of the operation.
1144  * @retval RETURN_OK if successful.
1145  * @retval RETURN_ERR if any error is detected.
1146  */
1147 int wifi_getRadioIEEE80211hEnabled(INT radioIndex, BOOL *enable); //Tr181
1148 
1149 /**
1150  * @brief Set 80211h feature enable.
1151  *
1152  * @param[in] radioIndex The index of the radio.
1153  * @param[in] enable Boolean value to enable/disable the feature.
1154  *
1155  * @return The status of the operation.
1156  * @retval RETURN_OK if successful.
1157  * @retval RETURN_ERR if any error is detected.
1158  */
1159 int wifi_setRadioIEEE80211hEnabled(INT radioIndex, BOOL enable); //Tr181
1160 
1161 //Device.WiFi.Radio.{i}.RegulatoryDomain
1162 
1163 /**
1164  * @brief Gets the Access Point regulatory domain.
1165  *
1166  * Default regulatory domain is set as "Global" by wpa_supplicant.
1167  * This can be changed to a country specific regulatory.
1168  *
1169  * @param[in] radioIndex The index of the radio.
1170  * @param[in] output_string Stores the regulatory domain string.
1171  *
1172  * @return The status of the operation.
1173  * @retval RETURN_OK if successful.
1174  * @retval RETURN_ERR if any error is detected.
1175  */
1176 INT wifi_getRegulatoryDomain(INT radioIndex, CHAR* output_string);
1177 
1178 //Device.WiFi.Radio.{i}.X_COMCAST-COM_CarrierSenseThresholdRange
1179 
1180 /**
1181  * @brief Gets the carrier sense ranges supported by the radio, measured in dBm.
1182  *
1183  * @param[in] radioIndex The index of the radio.
1184  * @param[in] output The carrier sense ranges in dBm.
1185  *
1186  * @return The status of the operation.
1187  * @retval RETURN_OK if successful.
1188  * @retval RETURN_ERR if any error is detected.
1189  */
1190 INT wifi_getRadioCarrierSenseThresholdRange(INT radioIndex, INT *output); //P3
1191 
1192 //Device.WiFi.Radio.{i}.X_COMCAST-COM_CarrierSenseThresholdInUse
1193 
1194 /**
1195  * @brief Get carrier sense threshold.
1196  *
1197  * The RSSI signal level at which CS/CCA detects a busy condition.
1198  * This attribute enables APs to increase minimum sensitivity to avoid detecting busy condition from
1199  * multiple/weak Wi-Fi sources in dense Wi-Fi environments. It is measured in dBm.
1200  *
1201  * @param[in] radioIndex The index of the radio
1202  * @param[out] output The carrier sense ranges in dBm.
1203  *
1204  * @return The status of the operation.
1205  * @retval RETURN_OK if successful.
1206  * @retval RETURN_ERR if any error is detected.
1207  */
1208 INT wifi_getRadioCarrierSenseThresholdInUse(INT radioIndex, INT *output); //P3
1209 
1210 /**
1211  * @brief Set carrier sense threshold.
1212  *
1213  * @param[in] radioIndex The index of the radio.
1214  * @param[in] threshold The carrier sense threshold to set.
1215  *
1216  * @return The status of the operation.
1217  * @retval RETURN_OK if successful.
1218  * @retval RETURN_ERR if any error is detected.
1219  */
1220 INT wifi_setRadioCarrierSenseThresholdInUse(INT radioIndex, INT threshold); //P3
1221 
1222 //Device.WiFi.Radio.{i}.X_COMCAST-COM_ChannelSwitchingCount
1223 
1224 /**
1225  * @brief Function returns the total number of channel changes.
1226  *
1227  * Reset the parameter every 24 hrs or reboot.
1228  *
1229  * @param[in] radioIndex The index of the radio.
1230  * @param[out] output The channel switch count.
1231  *
1232  * @return The status of the operation.
1233  * @retval RETURN_OK if successful.
1234  * @retval RETURN_ERR if any error is detected.
1235  */
1236 INT wifi_getRadioChannelSwitchingCount(INT radioIndex, INT *output); //P3
1237 
1238 //Device.WiFi.Radio.{i}.BeaconPeriod
1239 
1240 /**
1241  * @brief Gets the time interval between transmitting beacons (expressed in milliseconds).
1242  *
1243  * This parameter is based ondot11BeaconPeriod from [802.11-2012].
1244  *
1245  * @param[in] radioIndex The index of the radio
1246  * @param[out] output Outputs the beacon period
1247  *
1248  * @return The status of the operation.
1249  * @retval RETURN_OK if successful.
1250  * @retval RETURN_ERR if any error is detected.
1251  */
1252 INT wifi_getRadioBeaconPeriod(INT radioIndex, UINT *output);
1253 
1254 /**
1255  * @brief Sets the BeaconPeriod.
1256  *
1257  * @param[in] radioIndex The index of the radio.
1258  * @param[out] output The beacon period to set.
1259  *
1260  * @return The status of the operation.
1261  * @retval RETURN_OK if successful.
1262  * @retval RETURN_ERR if any error is detected.
1263  */
1264 INT wifi_setRadioBeaconPeriod(INT radioIndex, UINT BeaconPeriod);
1265 
1266 //Device.WiFi.Radio.{i}.BasicDataTransmitRates
1267 //Comma-separated list of strings. The set of data rates, in Mbps, that have to be supported by all stations that desire to join this BSS. The stations have to be able to receive and transmit at each of the data rates listed inBasicDataTransmitRates. For example, a value of "1,2", indicates that stations support 1 Mbps and 2 Mbps. Most control packets use a data rate in BasicDataTransmitRates.
1268 
1269 /**
1270  * @brief Gets the basic data transmit rate
1271  *
1272  * Comma-separated list of strings.
1273  * The set of data rates, in Mbps, that have to be supported by all stations that desire to join this BSS.
1274  * The stations have to be able to receive and transmit at each of the data rates listed inBasicDataTransmitRates.
1275  * For example, a value of "1,2", indicates that stations support 1 Mbps and 2 Mbps.
1276  * Most control packets use a data rate in BasicDataTransmitRates.
1277  *
1278  * @param[in] radioIndex The index of the radio.
1279  * @param[out] output The output string of basic data transmit rate.
1280  *
1281  * @return The status of the operation.
1282  * @retval RETURN_OK if successful.
1283  * @retval RETURN_ERR if any error is detected.
1284  */
1285 INT wifi_getRadioBasicDataTransmitRates(INT radioIndex, CHAR *output);
1286 
1287 /**
1288  * @brief The basic data transmit rate.
1289  *
1290  * @param[in] radioIndex The index of the radio.
1291  * @param[out] TransmitRates The transmit rate to set.
1292  *
1293  * @return The status of the operation.
1294  * @retval RETURN_OK if successful.
1295  * @retval RETURN_ERR if any error is detected.
1296  */
1297 
1298 INT wifi_setRadioBasicDataTransmitRates(INT radioIndex, CHAR *TransmitRates);
1299 
1300 //---------------------------------------------------------------------------------------------------
1301 //Device.WiFi.Radio.{i}.Stats.
1302 
1303 //Device.WiFi.Radio.{i}.Stats.BytesSent
1304 //Device.WiFi.Radio.{i}.Stats.BytesReceived
1305 //Device.WiFi.Radio.{i}.Stats.PacketsSent
1306 //Device.WiFi.Radio.{i}.Stats.PacketsReceived
1307 //Device.WiFi.Radio.{i}.Stats.ErrorsSent
1308 //Device.WiFi.Radio.{i}.Stats.ErrorsReceived
1309 //Device.WiFi.Radio.{i}.Stats.DiscardPacketsSent
1310 //Device.WiFi.Radio.{i}.Stats.DiscardPacketsReceived
1311 //Device.WiFi.Radio.{i}.Stats.PLCPErrorCount
1312 //Device.WiFi.Radio.{i}.Stats.FCSErrorCount
1313 //Device.WiFi.Radio.{i}.Stats.InvalidMACCount
1314 //Device.WiFi.Radio.{i}.Stats.PacketsOtherReceived
1315 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_NoiseFloor
1316 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_ChannelUtilization
1317 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_ActivityFactor
1318 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_CarrierSenseThreshold_Exceeded
1319 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_RetransmissionMetirc
1320 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_MaximumNoiseFloorOnChannel
1321 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_MinimumNoiseFloorOnChannel
1322 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_MedianNoiseFloorOnChannel
1323 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_StatisticsStartTime
1324 
1325 /**
1326  * @brief Get detail radio traffic statistics information.
1327  *
1328  * @param[in] radioIndex The index of the radio.
1329  * @param[out] output_struct Structure that saves the traffic statistics.
1330  *
1331  * @return The status of the operation.
1332  * @retval RETURN_OK if successful.
1333  * @retval RETURN_ERR if any error is detected.
1334  */
1335 INT wifi_getRadioTrafficStats(INT radioIndex, wifi_radioTrafficStats_t *output_struct); //Tr181
1336 
1337 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_RadioStatisticsMeasuringRate
1338 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_RadioStatisticsMeasuringInterval
1339 
1340 /**
1341  * @brief Set radio traffic static Measuring rules.
1342  *
1343  * @param[in] radioIndex The index of the radio.
1344  * @param[in] input_struct Structure that contains the measuring rules to set.
1345  *
1346  * @return The status of the operation.
1347  * @retval RETURN_OK if successful.
1348  * @retval RETURN_ERR if any error is detected.
1349  */
1350 INT wifi_setRadioTrafficStatsMeasure(INT radioIndex, wifi_radioTrafficStatsMeasure_t *input_struct); //Tr181
1351 
1352 
1353 //-----------------------------------------------------------------------------------------------
1354 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_ReceivedSignalLevel.{i}.
1355 
1356 //Device.WiFi.Radio.{i}.Stats.X_COMCAST-COM_ReceivedSignalLevel.{i}.ReceivedSignalLevel
1357 
1358 /**
1359  * @brief Set radio traffic static Measuring rules.
1360  *
1361  * Clients associated with the AP over a specific interval.
1362  * The histogram MUST have a range from -110to 0 dBm and MUST be divided in bins of 3 dBM, with bins aligning on the -110 dBm
1363  * end of the range. Received signal levels equal to or greater than the smaller boundary of a bin and less than the larger
1364  * boundary are included in the respective bin.
1365  *
1366  * The bin associated with the clients current received signal level MUST be incremented when a client associates with the AP.
1367  * Additionally, the respective bins associated with each connected clients current received signal level MUST be
1368  * incremented at the interval defined by "Radio Statistics Measuring Rate".
1369  *
1370  * The histogram bins MUST NOT be incremented at any other time.
1371  *
1372  * The histogram data collected during the interval MUST be published to the parameter only at the end of the interval defined
1373  * by "Radio Statistics Measuring Interval".
1374  *
1375  * The underlying histogram data MUST be cleared at the start of each interval defined by Radio Statistics Measuring
1376  * Interval.
1377  *
1378  * If any of the parameter's representing this histogram is queried before the histogram has been updated with an initial set
1379  * of data, it MUST return -1.
1380  *
1381  * @param[in] radioIndex The index of the radio.
1382  * @param[in] signalIndex The index of the signal.
1383  * @param[in] SignalLevel The strength of Wi-Fi signal.
1384  *
1385  * @return The status of the operation.
1386  * @retval RETURN_OK if successful.
1387  * @retval RETURN_ERR if any error is detected.
1388  */
1389 INT wifi_getRadioStatsReceivedSignalLevel(INT radioIndex, INT signalIndex, INT *SignalLevel); //Tr181
1390 
1391 //-----------------------------------------------------------------------------------------------------
1392 
1393 /**
1394  * @brief This API is used to apply (push) all previously set radio level variables and make
1395  * these settings active in the hardware.
1396  *
1397  * @param[in] radioIndex The index of the radio.
1398  *
1399  * @return The status of the operation.
1400  * @retval RETURN_OK if successful.
1401  * @retval RETURN_ERR if any error is detected.
1402  */
1403 INT wifi_applyRadioSettings(INT radioIndex);
1404 
1405 //---------------------------------------------------------------------------------------------------
1406 //
1407 // Wifi SSID level APIs common to Client and Access Point devices.
1408 //
1409 //---------------------------------------------------------------------------------------------------
1410 
1411 //Device.WiFi.SSID.{i}.
1412 
1413 /**
1414  * @brief Get the radio index assocated with the SSID entry
1415  *
1416  * @param[in] radioIndex The index of the SSID
1417  *
1418  * @return The status of the operation.
1419  * @retval RETURN_OK if successful.
1420  * @retval RETURN_ERR if any error is detected.
1421  */
1422 INT wifi_getSSIDRadioIndex(INT ssidIndex, INT *radioIndex);
1423 
1424 //Device.WiFi.SSID.{i}.Enable
1425 
1426 /**
1427  * @brief Get SSID enable configuration parameters.
1428  *
1429  * @param[in] radioIndex The index of the radio.
1430  * @param[out] output_bool The SSID enable status.
1431  *
1432  * @return The status of the operation.
1433  * @retval RETURN_OK if successful.
1434  * @retval RETURN_ERR if any error is detected.
1435  *
1436  */
1437 INT wifi_getSSIDEnable(INT ssidIndex, BOOL *output_bool); //Tr181
1438 
1439 /**
1440  * @brief Set SSID enable configuration parameters.
1441  *
1442  * @param[in] radioIndex The index of the radio.
1443  * @param[in] enable Boolean value to enable/disable the SSID.
1444  *
1445  * @return The status of the operation.
1446  * @retval RETURN_OK if successful.
1447  * @retval RETURN_ERR if any error is detected.
1448  *
1449  */
1450 INT wifi_setSSIDEnable(INT ssidIndex, BOOL enable); //Tr181
1451 
1452 //Device.WiFi.SSID.{i}.Status
1453 
1454 /**
1455  * @brief Get the SSID enable status.
1456  *
1457  * @param[in] ssidIndex The index of the radio.
1458  * @param[out] output_string The ssid enable/disable status.
1459  *
1460  * @return The status of the operation.
1461  * @retval RETURN_OK if successful.
1462  * @retval RETURN_ERR if any error is detected.
1463  *
1464  */
1465 INT wifi_getSSIDStatus(INT ssidIndex, CHAR *output_string); //Tr181
1466 
1467 //Device.WiFi.SSID.{i}.Alias
1468 
1469 //Device.WiFi.SSID.{i}.Name
1470 
1471 /**
1472  * @brief Get SSID name.
1473  *
1474  * Outputs a 32 byte or less string indicating the SSID name.
1475  * Sring buffer must be preallocated by the caller.
1476  *
1477  * @param[in] apIndex The index of the access point.
1478  * @param[out] output_string String which holds the SSID name.
1479  *
1480  * @return The status of the operation.
1481  * @retval RETURN_OK if successful.
1482  * @retval RETURN_ERR if any error is detected.
1483  *
1484  */
1485 INT wifi_getSSIDName(INT apIndex, CHAR *output_string);
1486 
1487 /**
1488  * @brief Set SSID name.
1489  *
1490  * Accepts a max 32 byte string and sets an internal variable to the SSID name.
1491  *
1492  * @param[in] apIndex The index of the access point.
1493  * @param[in] ssid_string The SSID name to set.
1494  *
1495  * @return The status of the operation.
1496  * @retval RETURN_OK if successful.
1497  * @retval RETURN_ERR if any error is detected.
1498  *
1499  */
1500 INT wifi_setSSIDName(INT apIndex, CHAR *ssid_string);
1501 
1502 //INT wifi_pushSSIDName(INT apIndex, CHAR *ssid); // push the ssid name to the hardware //repleaced by wifi_applySSIDSettings
1503 
1504 //Device.WiFi.SSID.{i}.LastChange
1505 
1506 //Device.WiFi.SSID.{i}.LowerLayers
1507 
1508 //Device.WiFi.SSID.{i}.BSSID
1509 
1510 /**
1511  * @brief Get the BSSID.
1512  * Basic Service Set Identifier (BSSID) is the mac addresss of the wireless access point.
1513  *
1514  * @param[in] ssidIndex The index of the SSID
1515  * @param[out] output_string Output variable that contains the BSSID
1516  *
1517  * @return The status of the operation.
1518  * @retval RETURN_OK if successful.
1519  * @retval RETURN_ERR if any error is detected.
1520  *
1521  */
1522 INT wifi_getBaseBSSID(INT ssidIndex, CHAR *output_string); //RDKB
1523 
1524 //Device.WiFi.SSID.{i}.MACAddress
1525 
1526 /**
1527  * @brief Get the MAC address associated with the Wifi SSID.
1528  *
1529  * @param[in] ssidIndex The index of the SSID.
1530  * @param[out] output_string Output variable that holds the mac address.
1531  *
1532  * @return The status of the operation.
1533  * @retval RETURN_OK if successful.
1534  * @retval RETURN_ERR if any error is detected.
1535  *
1536  */
1537 INT wifi_getSSIDMACAddress(INT ssidIndex, CHAR *output_string); //Tr181
1538 
1539 //Device.WiFi.SSID.{i}.SSID
1540 
1541 //-----------------------------------------------------------------------------------------------
1542 //Device.WiFi.SSID.{i}.Stats.
1543 //Device.WiFi.SSID.{i}.Stats.BytesSent
1544 //Device.WiFi.SSID.{i}.Stats.BytesReceived
1545 //Device.WiFi.SSID.{i}.Stats.PacketsSent
1546 //Device.WiFi.SSID.{i}.Stats.PacketsReceived
1547 
1548 //Device.WiFi.SSID.{i}.Stats.RetransCount
1549 //Device.WiFi.SSID.{i}.Stats.FailedRetransCount
1550 //Device.WiFi.SSID.{i}.Stats.RetryCount
1551 //Device.WiFi.SSID.{i}.Stats.MultipleRetryCount
1552 //Device.WiFi.SSID.{i}.Stats.ACKFailureCount
1553 //Device.WiFi.SSID.{i}.Stats.AggregatedPacketCount
1554 
1555 //Device.WiFi.SSID.{i}.Stats.ErrorsSent
1556 //Device.WiFi.SSID.{i}.Stats.ErrorsReceived
1557 //Device.WiFi.SSID.{i}.Stats.UnicastPacketsSent
1558 //Device.WiFi.SSID.{i}.Stats.UnicastPacketsReceived
1559 //Device.WiFi.SSID.{i}.Stats.DiscardPacketsSent
1560 //Device.WiFi.SSID.{i}.Stats.DiscardPacketsReceived
1561 //Device.WiFi.SSID.{i}.Stats.MulticastPacketsSent
1562 //Device.WiFi.SSID.{i}.Stats.MulticastPacketsReceived
1563 //Device.WiFi.SSID.{i}.Stats.BroadcastPacketsSent
1564 //Device.WiFi.SSID.{i}.Stats.BroadcastPacketsReceived
1565 //Device.WiFi.SSID.{i}.Stats.UnknownProtoPacketsReceived
1566 
1567 /**
1568  * @brief Get the basic SSID traffic statistics info.
1569  *
1570  * @param[in] ssidIndex The index of the SSID.
1571  * @param[out] output_string Output variable that holds the mac address.
1572  *
1573  * @return The status of the operation.
1574  * @retval RETURN_OK if successful.
1575  * @retval RETURN_ERR if any error is detected.
1576  *
1577  */
1578 INT wifi_getSSIDTrafficStats(INT ssidIndex, wifi_ssidTrafficStats_t *output_struct); //Tr181
1579 
1580 /**
1581  * @brief This API is used to apply SSID settings to the hardware.
1582  *
1583  * Apply SSID and AP (in the case of Acess Point devices) to the hardware.
1584  *
1585  * @param[in] ssidIndex The index of the SSID
1586  *
1587  * @return The status of the operation.
1588  * @retval RETURN_OK if successful.
1589  * @retval RETURN_ERR if any error is detected.
1590  *
1591  */
1592 INT wifi_applySSIDSettings(INT ssidIndex);
1593 
1594 
1595 
1596 
1597 //-----------------------------------------------------------------------------------------------
1598 //Device.WiFi.NeighboringWiFiDiagnostic.
1599 //Device.WiFi.NeighboringWiFiDiagnostic.DiagnosticsState
1600 //Device.WiFi.NeighboringWiFiDiagnostic.ResultNumberOfEntries
1601 
1602 //-----------------------------------------------------------------------------------------------
1603 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.
1604 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.Radio
1605 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.SSID
1606 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.BSSID
1607 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.Mode
1608 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.Channel
1609 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.SignalStrength
1610 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.SecurityModeEnabled
1611 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.EncryptionMode
1612 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.OperatingFrequencyBand
1613 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.SupportedStandards
1614 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.OperatingStandards
1615 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.OperatingChannelBandwidth
1616 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.BeaconPeriod
1617 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.Noise
1618 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.BasicDataTransferRates
1619 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.SupportedDataTransferRates
1620 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.DTIMPeriod
1621 //Device.WiFi.NeighboringWiFiDiagnostic.Result.{i}.X_COMCAST-COM_ChannelUtilization
1622 
1623 /**
1624  * @brief Get neighbor wifi diagnostics.
1625  *
1626  * Start the wifi scan and get the result into output buffer for RDKB to parser.
1627  * The result will be used to manage endpoint list.
1628  *
1629  * @param[in] radioIndex The index of the radio
1630  * @param[in] neighbor_ap_array The neighbor access point matrix
1631  * @param[out] output_array_size The size of the access point list
1632  *
1633  * @return The status of the operation.
1634  * @retval RETURN_OK if successful.
1635  * @retval RETURN_ERR if any error is detected.
1636  *
1637  * @note HAL function should allocate an data structure array, and return to caller with "neighbor_ap_array".
1638  */
1639 INT wifi_getNeighboringWiFiDiagnosticResult(INT radioIndex, wifi_neighbor_ap_t **neighbor_ap_array, UINT *output_array_size); //Tr181
1640 INT wifi_getSpecificSSIDInfo(const char* SSID, WIFI_HAL_FREQ_BAND band, wifi_neighbor_ap_t **filtered_ap_array, UINT *output_array_size);
1641 INT wifi_setRadioScanningFreqList(INT radioIndex, const CHAR *freqList);
1642 INT wifi_getDualBandSupport();
1643 /** @} */
1644 #endif
_wifi_sta_stats::sta_Encryption
char sta_Encryption[64]
WiFi Encryption Type AES, TKIP, etc.
Definition: wifi_common_hal.h:461
WIFI_SECURITY_WPA_ENTERPRISE_TKIP
@ WIFI_SECURITY_WPA_ENTERPRISE_TKIP
WPA Enterprise with TKIP (Temporal Key Integrity Protocol) encryption.
Definition: wifi_common_hal.h:329
wifi_setRadioExtChannel
int wifi_setRadioExtChannel(int radioIndex, char *string)
Set the extension channel.
_wifi_neighbor_ap::ap_BeaconPeriod
unsigned int ap_BeaconPeriod
Time interval (in&#160;ms) between transmitting beacons.
Definition: wifi_common_hal.h:423
_wifi_ssidTrafficStats::ssid_UnicastPacketsSent
unsigned long ssid_UnicastPacketsSent
The total number of inbound packets that contained errors preventing them from being delivered to a h...
Definition: wifi_common_hal.h:395
_wifi_ssidTrafficStats::ssid_ErrorsSent
unsigned long ssid_ErrorsSent
The total number of outbound packets that could not be transmitted because of errors.
Definition: wifi_common_hal.h:393
_wifi_radioTrafficStats::radio_DiscardPacketsReceived
unsigned long radio_DiscardPacketsReceived
The total number of inbound packets which were chosen to be discarded even though no errors had been ...
Definition: wifi_common_hal.h:357
wifi_setRadioBasicDataTransmitRates
int wifi_setRadioBasicDataTransmitRates(int radioIndex, char *TransmitRates)
The basic data transmit rate.
WIFI_HAL_ERROR_SSID_CHANGED
@ WIFI_HAL_ERROR_SSID_CHANGED
Definition: wifi_common_hal.h:299
wifi_getRadioIfName
int wifi_getRadioIfName(int radioIndex, char *output_string)
Get the Radio Interface name from platform.
wifi_setRadioIEEE80211hEnabled
int wifi_setRadioIEEE80211hEnabled(int radioIndex, unsigned char enable)
Set 80211h feature enable.
_wifi_ssidTrafficStats::ssid_MulticastPacketsReceived
unsigned long ssid_MulticastPacketsReceived
The total number of received packets, delivered by this layer to a higher layer, which were addressed...
Definition: wifi_common_hal.h:400
WIFI_HAL_DISCONNECTING
@ WIFI_HAL_DISCONNECTING
Definition: wifi_common_hal.h:293
wifi_getRadioCarrierSenseThresholdRange
int wifi_getRadioCarrierSenseThresholdRange(int radioIndex, int *output)
Gets the carrier sense ranges supported by the radio, measured in dBm.
wifi_getRadioGuardInterval
int wifi_getRadioGuardInterval(int radioIndex, char *output_string)
Get the guard interval value. eg "400nsec" or "800nsec".
_wifi_ssidTrafficStats::ssid_BytesSent
unsigned long ssid_BytesSent
The total number of bytes transmitted out of the interface, including framing characters.
Definition: wifi_common_hal.h:381
WIFI_SECURITY_NOT_SUPPORTED
@ WIFI_SECURITY_NOT_SUPPORTED
Security mode not supported.
Definition: wifi_common_hal.h:338
_wifi_sta_stats::sta_PhyRate
float sta_PhyRate
Indicates the Physical rate (Mbps)
Definition: wifi_common_hal.h:462
_wifi_radioTrafficStatsMeasure::radio_RadioStatisticsMeasuringInterval
int radio_RadioStatisticsMeasuringInterval
Input //The interval for which radio data MUST be retained in order and at the end of which appropria...
Definition: wifi_common_hal.h:375
_wifi_ssidTrafficStats::ssid_PacketsReceived
unsigned long ssid_PacketsReceived
The total number of packets received on the interface.
Definition: wifi_common_hal.h:384
_wifi_radioTrafficStats::radio_PacketsOtherReceived
unsigned long radio_PacketsOtherReceived
The number of packets that were received, but which were destined for a MAC address that is not assoc...
Definition: wifi_common_hal.h:361
_wifi_ssidTrafficStats::ssid_UnicastPacketsReceived
unsigned long ssid_UnicastPacketsReceived
The total number of received packets, delivered by this layer to a higher layer, which were not addre...
Definition: wifi_common_hal.h:396
wifi_getRadioStatsReceivedSignalLevel
int wifi_getRadioStatsReceivedSignalLevel(int radioIndex, int signalIndex, int *SignalLevel)
Set radio traffic static Measuring rules.
wifi_setSSIDEnable
int wifi_setSSIDEnable(int ssidIndex, unsigned char enable)
Set SSID enable configuration parameters.
wifi_getRadioIEEE80211hEnabled
int wifi_getRadioIEEE80211hEnabled(int radioIndex, unsigned char *enable)
Get the 80211h feature enable.
wifi_setRadioAutoChannelEnable
int wifi_setRadioAutoChannelEnable(int radioIndex, unsigned char enable)
Set the Auto Channel Selection / Dynamic channel selection enable status.
wifi_getRadioChannelsInUse
int wifi_getRadioChannelsInUse(int radioIndex, char *output_string)
Gets the list of channels currently in use.
wifi_getSSIDEnable
int wifi_getSSIDEnable(int ssidIndex, unsigned char *output_bool)
Get SSID enable configuration parameters.
_wifi_diag_ipping_result::ipping_DiagnosticsState
char ipping_DiagnosticsState[64]
Indicates availability of diagnostic data. Enumeration of: Complete, Error_CannotResolveHostName,...
Definition: wifi_common_hal.h:445
wifi_setRadioTrafficStatsMeasure
int wifi_setRadioTrafficStatsMeasure(int radioIndex, wifi_radioTrafficStatsMeasure_t *input_struct)
Set radio traffic static Measuring rules.
_wifi_sta_stats::sta_SSID
char sta_SSID[64]
The current connected SSID name.
Definition: wifi_common_hal.h:457
wifi_getSSIDRadioIndex
int wifi_getSSIDRadioIndex(int ssidIndex, int *radioIndex)
Get the radio index assocated with the SSID entry.
_wifi_radioTrafficStats::radio_InvalidMACCount
unsigned long radio_InvalidMACCount
The number of packets that were received with a detected invalid MAC header error.
Definition: wifi_common_hal.h:360
_wifi_ssidTrafficStats::ssid_FailedRetransCount
unsigned long ssid_FailedRetransCount
The number of packets that were not transmitted successfully due to the number of retransmission atte...
Definition: wifi_common_hal.h:387
_wifi_neighbor_ap::ap_OperatingChannelBandwidth
char ap_OperatingChannelBandwidth[16]
Indicates the bandwidth at which the channel is operating. Enumeration of:
Definition: wifi_common_hal.h:422
WIFI_RSSI_EXCELLENT
@ WIFI_RSSI_EXCELLENT
Excellent (4 bars)
Definition: wifi_common_hal.h:262
_wifi_radioTrafficStats::radio_StatisticsStartTime
unsigned long radio_StatisticsStartTime
The date and time at which the collection of the current set of statistics started....
Definition: wifi_common_hal.h:370
WIFI_HAL_ERROR_CONNECTION_LOST
@ WIFI_HAL_ERROR_CONNECTION_LOST
Definition: wifi_common_hal.h:300
_wifi_radioTrafficStats::radio_ErrorsReceived
unsigned long radio_ErrorsReceived
The total number of inbound packets that contained errors preventing them from being delivered to a h...
Definition: wifi_common_hal.h:355
_wifi_radioTrafficStats::radio_CarrierSenseThreshold_Exceeded
int radio_CarrierSenseThreshold_Exceeded
Percentage of time that the radio was unable to transmit or receive Wi-Fi packets to/from associated ...
Definition: wifi_common_hal.h:365
_wifi_sta_stats::sta_LastDataUplinkRate
unsigned int sta_LastDataUplinkRate
Definition: wifi_common_hal.h:467
wifi_getRadioExtChannel
int wifi_getRadioExtChannel(int radioIndex, char *output_string)
Get the secondary extension channel position.
_wifi_sta_stats::sta_LastDataDownlinkRate
unsigned int sta_LastDataDownlinkRate
Definition: wifi_common_hal.h:466
_wifi_diag_ipping_setting::ipping_DSCP
unsigned int ipping_DSCP
DiffServ codepoint to be used for the test packets. By default the CPE SHOULD set this value to zero.
Definition: wifi_common_hal.h:439
_wifi_neighbor_ap::ap_OperatingFrequencyBand
char ap_OperatingFrequencyBand[16]
Indicates the frequency band at which the radio this SSID instance is operating. Enumeration of:2....
Definition: wifi_common_hal.h:419
wifi_getRadioIEEE80211hSupported
int wifi_getRadioIEEE80211hSupported(int radioIndex, unsigned char *Supported)
Function to check 80211h is supported or not.
_wifi_halSettings
Definition: wifi_common_hal.h:559
wifi_getRadioOperatingFrequencyBand
int wifi_getRadioOperatingFrequencyBand(int radioIndex, char *output_string)
Get the frequency band at which the radio is operating.
WIFI_HAL_ERROR_CONNECTION_FAILED
@ WIFI_HAL_ERROR_CONNECTION_FAILED
Definition: wifi_common_hal.h:301
_wifi_radioTrafficStats
Definition: wifi_common_hal.h:345
WIFI_HAL_CONNECTING
@ WIFI_HAL_CONNECTING
Definition: wifi_common_hal.h:292
_wifi_ssidTrafficStats::ssid_PacketsSent
unsigned long ssid_PacketsSent
The total number of packets transmitted out of the interface.
Definition: wifi_common_hal.h:383
_wifi_sta_stats::sta_BSSID
char sta_BSSID[64]
The BSSID used for connected SSID.
Definition: wifi_common_hal.h:458
wifi_setRadioChannel
int wifi_setRadioChannel(int radioIndex, unsigned long channel)
Set the running channel number.
wifiSecurityMode_t
wifiSecurityMode_t
Wifi Security modes.
Definition: wifi_common_hal.h:320
_wifi_radioTrafficStats::radio_PacketsReceived
unsigned long radio_PacketsReceived
The total number of packets received on the interface.
Definition: wifi_common_hal.h:352
wifi_getRadioSupportedFrequencyBands
int wifi_getRadioSupportedFrequencyBands(int radioIndex, char *output_string)
Get Supported frequency bands at which the radio can operate.
_wifi_radioTrafficStats::radio_ErrorsSent
unsigned long radio_ErrorsSent
The total number of outbound packets that could not be transmitted because of errors.
Definition: wifi_common_hal.h:354
_wifi_sta_stats::sta_Frequency
unsigned int sta_Frequency
Current Operating Frequency.
Definition: wifi_common_hal.h:465
_wifi_radioTrafficStats::radio_RetransmissionMetirc
int radio_RetransmissionMetirc
Percentage of packets that had to be re-transmitted. Multiple re-transmissions of the same packet cou...
Definition: wifi_common_hal.h:366
_wifi_ssidTrafficStats::ssid_RetransCount
unsigned long ssid_RetransCount
The total number of transmitted packets which were retransmissions. Two retransmissions of the same p...
Definition: wifi_common_hal.h:386
wifi_setRadioChannelMode
int wifi_setRadioChannelMode(int radioIndex, char *channelMode, unsigned char gOnlyFlag, unsigned char nOnlyFlag, unsigned char acOnlyFlag)
Set the radio operating mode and pure mode flag.
wifi_getRadioAutoChannelRefreshPeriod
int wifi_getRadioAutoChannelRefreshPeriod(int radioIndex, unsigned long *output_ulong)
Get the Auto Channel Selection / Dynamic channel selection refresh period in seconds.
_wifi_radioTrafficStats::radio_PLCPErrorCount
unsigned long radio_PLCPErrorCount
The number of packets that were received with a detected Physical Layer Convergence Protocol (PLCP) h...
Definition: wifi_common_hal.h:358
_wifi_ssidTrafficStats::ssid_MulticastPacketsSent
unsigned long ssid_MulticastPacketsSent
The total number of packets that higher-level protocols requested for transmission and which were add...
Definition: wifi_common_hal.h:399
_wifi_neighbor_ap::ap_Mode
char ap_Mode[64]
The mode the neighboring WiFi radio is operating in. Enumeration of: AdHoc, Infrastructure.
Definition: wifi_common_hal.h:414
WIFI_SECURITY_WPA3_SAE
@ WIFI_SECURITY_WPA3_SAE
WPA3 with SAE encryption.
Definition: wifi_common_hal.h:336
_wifi_neighbor_ap::ap_DTIMPeriod
unsigned int ap_DTIMPeriod
The number of beacon intervals that elapse between transmission of Beacon frames containing a TIM ele...
Definition: wifi_common_hal.h:427
_wifi_neighbor_ap::ap_Channel
unsigned int ap_Channel
The current radio channel used by the neighboring WiFi radio.
Definition: wifi_common_hal.h:415
wifi_createInitialConfigFiles
int wifi_createInitialConfigFiles()
Creates wifi configuration files.
_wifi_ssidTrafficStats::ssid_BroadcastPacketsSent
unsigned long ssid_BroadcastPacketsSent
The total number of packets that higher-level protocols requested for transmission and which were add...
Definition: wifi_common_hal.h:401
_wifi_diag_ipping_result::ipping_FailureCount
unsigned int ipping_FailureCount
Result parameter indicating the number of failed pings in the most recent ping test.
Definition: wifi_common_hal.h:447
_wifi_diag_ipping_setting::ipping_Timeout
unsigned int ipping_Timeout
Timeout in milliseconds for the ping test.
Definition: wifi_common_hal.h:437
wifiRSSILevel_t
wifiRSSILevel_t
Enumerators for Wifi RSSI Levels.
Definition: wifi_common_hal.h:257
_wifi_diag_ipping_result::ipping_SuccessCount
unsigned int ipping_SuccessCount
Result parameter indicating the number of successful pings (those in which a successful response was ...
Definition: wifi_common_hal.h:446
_wifi_neighbor_ap::ap_Noise
int ap_Noise
Indicator of average noise strength (in&#160;dBm) received from the neighboring WiFi radio.
Definition: wifi_common_hal.h:424
wifi_setRadioOperatingChannelBandwidth
int wifi_setRadioOperatingChannelBandwidth(int radioIndex, char *bandwidth)
Set the Operating Channel Bandwidth.
_wifi_radioTrafficStatsMeasure
Definition: wifi_common_hal.h:372
_wifi_ssidTrafficStats::ssid_DiscardedPacketsReceived
unsigned long ssid_DiscardedPacketsReceived
The total number of inbound packets which were chosen to be discarded even though no errors had been ...
Definition: wifi_common_hal.h:398
wifi_setSSIDName
int wifi_setSSIDName(int apIndex, char *ssid_string)
Set SSID name.
_wifi_radioTrafficStats::radio_BytesSent
unsigned long radio_BytesSent
The total number of bytes transmitted out of the interface, including framing characters.
Definition: wifi_common_hal.h:349
wifi_getRadioAutoChannelSupported
int wifi_getRadioAutoChannelSupported(int radioIndex, unsigned char *output_bool)
Check if the driver support the Auto Channel Selection / Dynamic channel selection.
WIFI_SECURITY_WPA2_ENTERPRISE_AES
@ WIFI_SECURITY_WPA2_ENTERPRISE_AES
WPA2 Enterprise with AES (Advanced Encryption Standard) encryption.
Definition: wifi_common_hal.h:332
wifi_getBaseBSSID
int wifi_getBaseBSSID(int ssidIndex, char *output_string)
Get the BSSID. Basic Service Set Identifier (BSSID) is the mac addresss of the wireless access point.
_wifi_sta_stats::sta_BAND
char sta_BAND[16]
The BAND used for connected SSID.
Definition: wifi_common_hal.h:459
_wifi_ssidTrafficStats::ssid_MultipleRetryCount
unsigned long ssid_MultipleRetryCount
The number of packets that were successfully transmitted after more than one retransmission....
Definition: wifi_common_hal.h:389
wifi_applyRadioSettings
int wifi_applyRadioSettings(int radioIndex)
This API is used to apply (push) all previously set radio level variables and make these settings act...
_wifi_diag_ipping_setting::ipping_Interface
char ipping_Interface[256]
The value MUST be the path name of a row in the IP.Interface table. The IP-layer interface over which...
Definition: wifi_common_hal.h:434
_wifi_radioTrafficStats::radio_ActivityFactor
int radio_ActivityFactor
Percentage of time that the radio was transmitting or receiving Wi-Fi packets to/from associated clie...
Definition: wifi_common_hal.h:364
wifi_getRadioTransmitPower
int wifi_getRadioTransmitPower(int radioIndex, int *output_INT)
Get the current transmit Power.
wifi_setRadioGuardInterval
int wifi_setRadioGuardInterval(int radioIndex, char *string)
Set the guard interval value.
wifi_getSSIDStatus
int wifi_getSSIDStatus(int ssidIndex, char *output_string)
Get the SSID enable status.
_wifi_ssidTrafficStats::ssid_UnknownPacketsReceived
unsigned long ssid_UnknownPacketsReceived
The total number of packets received via the interface which were discarded because of an unknown or ...
Definition: wifi_common_hal.h:403
wifi_getSSIDName
int wifi_getSSIDName(int apIndex, char *output_string)
Get SSID name.
_wifi_neighbor_ap::ap_BSSID
char ap_BSSID[64]
[MACAddress] The BSSID used for the neighboring WiFi SSID.
Definition: wifi_common_hal.h:413
_wifi_ssidTrafficStats::ssid_BytesReceived
unsigned long ssid_BytesReceived
The total number of bytes received on the interface, including framing characters.
Definition: wifi_common_hal.h:382
WIFI_HAL_SUCCESS
@ WIFI_HAL_SUCCESS
Definition: wifi_common_hal.h:291
WIFI_SECURITY_WPA_WPA2_PSK
@ WIFI_SECURITY_WPA_WPA2_PSK
WPA2(Pre-Shared Key) with TKIP AES encryption.
Definition: wifi_common_hal.h:333
ULONG
#define ULONG
Defines for the basic data types.
Definition: wifi_common_hal.h:168
_wifi_diag_ipping_setting::ipping_Host
char ipping_Host[256]
Host name or address of the host to ping. In the case where Host is specified by name,...
Definition: wifi_common_hal.h:435
wifi_getRadioTrafficStats
int wifi_getRadioTrafficStats(int radioIndex, wifi_radioTrafficStats_t *output_struct)
Get detail radio traffic statistics information.
wifi_getRadioMCS
int wifi_getRadioMCS(int radioIndex, int *output_INT)
Get the Modulation Coding Scheme index.
wifi_getRadioBeaconPeriod
int wifi_getRadioBeaconPeriod(int radioIndex, unsigned int *output)
Gets the time interval between transmitting beacons (expressed in milliseconds).
_wifi_neighbor_ap::ap_SupportedDataTransferRates
char ap_SupportedDataTransferRates[256]
Comma-separated list (maximum list length 256) of strings. Data transmit rates (in Mbps) for unicast ...
Definition: wifi_common_hal.h:426
wifi_getRadioNumberOfEntries
int wifi_getRadioNumberOfEntries(unsigned long *output)
Get total number of radios in the wifi subsystem.
wifi_getRadioEnable
int wifi_getRadioEnable(int radioIndex, unsigned char *output_bool)
Get the Radio enable config parameter.
_wifi_ssidTrafficStats::ssid_BroadcastPacketsRecevied
unsigned long ssid_BroadcastPacketsRecevied
The total number of packets that higher-level protocols requested for transmission and which were add...
Definition: wifi_common_hal.h:402
WIFI_SECURITY_WPA2_ENTERPRISE_TKIP
@ WIFI_SECURITY_WPA2_ENTERPRISE_TKIP
WPA2 Enterprise with TKIP (Temporal Key Integrity Protocol) encryption.
Definition: wifi_common_hal.h:331
_wifi_neighbor_ap::ap_BasicDataTransferRates
char ap_BasicDataTransferRates[256]
Comma-separated list (maximum list length 256) of strings. Basic data transmit rates (in Mbps) for th...
Definition: wifi_common_hal.h:425
WIFI_SECURITY_WPA_PSK_TKIP
@ WIFI_SECURITY_WPA_PSK_TKIP
WPA(Pre-Shared Key) with TKIP (Temporal Key Integrity Protocol) encryption.
Definition: wifi_common_hal.h:325
wifi_setRadioEnable
int wifi_setRadioEnable(int radioIndex, unsigned char enable)
Set the Radio enable config parameter.
WIFI_SECURITY_WPA2_PSK_TKIP
@ WIFI_SECURITY_WPA2_PSK_TKIP
WPA2(Pre-Shared Key) with TKIP (Temporal Key Integrity Protocol) encryption.
Definition: wifi_common_hal.h:327
_wifi_neighbor_ap::ap_SecurityModeEnabled
char ap_SecurityModeEnabled[64]
The type of encryption the neighboring WiFi SSID advertises. Enumeration of:None, WPA-WPA2 etc.
Definition: wifi_common_hal.h:417
_wifi_radioTrafficStats::radio_BytesReceived
unsigned long radio_BytesReceived
The total number of bytes received on the interface, including framing characters.
Definition: wifi_common_hal.h:350
WIFI_HAL_ERROR_INVALID_CREDENTIALS
@ WIFI_HAL_ERROR_INVALID_CREDENTIALS
Definition: wifi_common_hal.h:303
WIFI_SECURITY_NONE
@ WIFI_SECURITY_NONE
No Security.
Definition: wifi_common_hal.h:322
_wifi_diag_ipping_result::ipping_MaximumResponseTime
unsigned int ipping_MaximumResponseTime
Result parameter indicating the maximum response time in milliseconds over all repetitions with succe...
Definition: wifi_common_hal.h:450
_wifi_radioTrafficStats::radio_PacketsSent
unsigned long radio_PacketsSent
The total number of packets transmitted out of the interface.
Definition: wifi_common_hal.h:351
WIFI_RSSI_GOOD
@ WIFI_RSSI_GOOD
Good (3 bars)
Definition: wifi_common_hal.h:261
wifi_getRadioMaxBitRate
int wifi_getRadioMaxBitRate(int radioIndex, char *output_string)
Get the maximum PHY bit rate supported by the interface.
_wifi_radioTrafficStats::radio_FCSErrorCount
unsigned long radio_FCSErrorCount
The number of packets that were received with a detected FCS error. This parameter is based on dot11F...
Definition: wifi_common_hal.h:359
wifi_getRadioTransmitPowerSupported
int wifi_getRadioTransmitPowerSupported(int radioIndex, char *output_list)
Get supported Transmit Power list.
wifi_getRadioStandard
int wifi_getRadioStandard(int radioIndex, char *output_string, unsigned char *gOnly, unsigned char *nOnly, unsigned char *acOnly)
Get the radio operating mode and pure mode flag. Mode flags are the IEEE 802.11 standards to indicate...
_wifi_neighbor_ap
Definition: wifi_common_hal.h:409
wifi_getSSIDNumberOfEntries
int wifi_getSSIDNumberOfEntries(unsigned long *output)
Get the total number of SSID entries in the wifi subsystem.
_wifi_sta_stats::sta_SecMode
char sta_SecMode[64]
WiFi Security Mode WPA2-PSK , WPA2-EAP etc..
Definition: wifi_common_hal.h:460
wifi_getSSIDMACAddress
int wifi_getSSIDMACAddress(int ssidIndex, char *output_string)
Get the MAC address associated with the Wifi SSID.
WIFI_SECURITY_WPA_ENTERPRISE_AES
@ WIFI_SECURITY_WPA_ENTERPRISE_AES
WPA Enterprise with AES (Advanced Encryption Standard) encryption.
Definition: wifi_common_hal.h:330
wifi_getRadioChannelSwitchingCount
int wifi_getRadioChannelSwitchingCount(int radioIndex, int *output)
Function returns the total number of channel changes.
_wifi_radioTrafficStats::radio_NoiseFloor
int radio_NoiseFloor
The noise floor for this radio channel where a recoverable signal can be obtained....
Definition: wifi_common_hal.h:362
WIFI_RSSI_FAIR
@ WIFI_RSSI_FAIR
Fair (2 bars)
Definition: wifi_common_hal.h:260
wifi_down
int wifi_down()
Turns off transmit power for the entire Wifi subsystem, for all radios.
Definition: wifi_common_hal.c:555
WIFI_HAL_ERROR_UNKNOWN
@ WIFI_HAL_ERROR_UNKNOWN
Definition: wifi_common_hal.h:306
wifi_getRegulatoryDomain
int wifi_getRegulatoryDomain(int radioIndex, char *output_string)
Gets the Access Point regulatory domain.
wifi_uninit
int wifi_uninit()
Uninitilizes wifi module.
Definition: wifi_common_hal.c:482
WIFI_SECURITY_WPA2_PSK_AES
@ WIFI_SECURITY_WPA2_PSK_AES
WPA2(Pre-Shared Key) with AES (Advanced Encryption Standard) encryption.
Definition: wifi_common_hal.h:328
wifi_getRadioChannel
int wifi_getRadioChannel(int radioIndex, unsigned long *output_ulong)
Get the running channel number.
_wifi_radioTrafficStats::radio_MaximumNoiseFloorOnChannel
int radio_MaximumNoiseFloorOnChannel
Maximum Noise on the channel during the measuring interval. The metric is updated in this parameter a...
Definition: wifi_common_hal.h:367
wifi_setRadioMCS
int wifi_setRadioMCS(int radioIndex, int MCS)
Set the Modulation Coding Scheme index.
_wifi_diag_ipping_result::ipping_AverageResponseTime
unsigned int ipping_AverageResponseTime
Result parameter indicating the average response time in milliseconds over all repetitions with succe...
Definition: wifi_common_hal.h:448
_wifi_diag_ipping_setting::ipping_DataBlockSize
unsigned int ipping_DataBlockSize
Size of the data block in bytes to be sent for each ping.
Definition: wifi_common_hal.h:438
wifi_getStats
void wifi_getStats(int radioIndex, wifi_sta_stats_t *wifi_sta_stats)
Returns current station connection status.
_wifi_radioTrafficStats::radio_DiscardPacketsSent
unsigned long radio_DiscardPacketsSent
The total number of outbound packets which were chosen to be discarded even though no errors had been...
Definition: wifi_common_hal.h:356
_wifi_ssidTrafficStats::ssid_ErrorsReceived
unsigned long ssid_ErrorsReceived
The total number of inbound packets that contained errors preventing them from being delivered to a h...
Definition: wifi_common_hal.h:394
wifi_getRadioOperatingChannelBandwidth
int wifi_getRadioOperatingChannelBandwidth(int radioIndex, char *output_string)
Get the Operating Channel Bandwidth.
wifi_init
int wifi_init()
Initializes the wifi subsystem.
Definition: wifi_common_hal.c:383
WIFI_SECURITY_WEP_64
@ WIFI_SECURITY_WEP_64
WEP with 64 bit encryption.
Definition: wifi_common_hal.h:323
wifi_getRadioStatus
int wifi_getRadioStatus(int radioIndex, char *output_string)
Get the Radio enable status.
_wifi_sta_stats::sta_RSSI
float sta_RSSI
RSSI value in dBm.
Definition: wifi_common_hal.h:464
_wifi_diag_ipping_setting::ipping_NumberOfRepetitions
unsigned int ipping_NumberOfRepetitions
Number of repetitions of the ping test to perform before reporting the results.
Definition: wifi_common_hal.h:436
_wifi_radioTrafficStats::radio_MinimumNoiseFloorOnChannel
int radio_MinimumNoiseFloorOnChannel
Minimum Noise on the channel. The metric is updated in this Parameter at the end of the interval defi...
Definition: wifi_common_hal.h:368
wifi_getRadioSupportedStandards
int wifi_getRadioSupportedStandards(int radioIndex, char *output_string)
Get Supported frequency bands at which the radio can operate.
WIFI_HAL_ERROR_AUTH_FAILED
@ WIFI_HAL_ERROR_AUTH_FAILED
Definition: wifi_common_hal.h:305
WIFI_HAL_ERROR_CONNECTION_INTERRUPTED
@ WIFI_HAL_ERROR_CONNECTION_INTERRUPTED
Definition: wifi_common_hal.h:302
_wifi_sta_stats::sta_Retransmissions
unsigned int sta_Retransmissions
Definition: wifi_common_hal.h:468
wifi_getRadioPossibleChannels
int wifi_getRadioPossibleChannels(int radioIndex, char *output_string)
Gets the supported channel list.
WIFI_HAL_ERROR_DEV_DISCONNECT
@ WIFI_HAL_ERROR_DEV_DISCONNECT
Definition: wifi_common_hal.h:298
wifi_setRadioBeaconPeriod
int wifi_setRadioBeaconPeriod(int radioIndex, unsigned int BeaconPeriod)
Sets the BeaconPeriod.
WIFI_SECURITY_WPA3_PSK_AES
@ WIFI_SECURITY_WPA3_PSK_AES
WPA3(Pre-Shared Key) with AES encryption.
Definition: wifi_common_hal.h:335
wifi_factoryReset
int wifi_factoryReset()
Implements factory reset of the Wi-Fi subsystem.
Definition: wifi_common_hal.c:533
wifi_getSSIDTrafficStats
int wifi_getSSIDTrafficStats(int ssidIndex, wifi_ssidTrafficStats_t *output_struct)
Get the basic SSID traffic statistics info.
_wifi_diag_ipping_setting
Definition: wifi_common_hal.h:432
WIFI_RSSI_POOR
@ WIFI_RSSI_POOR
Poor (1 bar)
Definition: wifi_common_hal.h:259
_wifi_neighbor_ap::ap_SSID
char ap_SSID[64]
The current service set identifier in use by the neighboring WiFi SSID. The value MAY be empty for hi...
Definition: wifi_common_hal.h:412
_wifi_diag_ipping_result
Definition: wifi_common_hal.h:443
_wifi_neighbor_ap::ap_SupportedStandards
char ap_SupportedStandards[64]
Comma-separated list of strings. List items indicate which IEEE 802.11 standards this&#160;Result&#160;instance...
Definition: wifi_common_hal.h:420
_wifi_sta_stats
Definition: wifi_common_hal.h:455
_wifi_radioTrafficStatsMeasure::radio_RadioStatisticsMeasuringRate
int radio_RadioStatisticsMeasuringRate
Input //"The rate at which radio related statistics are periodically collected. Only statistics that...
Definition: wifi_common_hal.h:374
_wifi_diag_ipping_result::ipping_MinimumResponseTime
unsigned int ipping_MinimumResponseTime
Result parameter indicating the minimum response time in milliseconds over all repetitions with succe...
Definition: wifi_common_hal.h:449
wifi_getRadioBasicDataTransmitRates
int wifi_getRadioBasicDataTransmitRates(int radioIndex, char *output)
Gets the basic data transmit rate.
_wifi_ssidTrafficStats::ssid_AggregatedPacketCount
unsigned long ssid_AggregatedPacketCount
The number of aggregated packets that were transmitted. This applies only to 802.11n and 802....
Definition: wifi_common_hal.h:391
WIFI_SECURITY_WEP_128
@ WIFI_SECURITY_WEP_128
WEP with 128 bit encryption.
Definition: wifi_common_hal.h:324
_wifi_neighbor_ap::ap_ChannelUtilization
unsigned int ap_ChannelUtilization[64]
Indicates the fraction of the time AP senses that the channel is in use by the neighboring AP for tra...
Definition: wifi_common_hal.h:428
_wifi_neighbor_ap::ap_SignalStrength
int ap_SignalStrength
An indicator of radio signal strength (RSSI) of the neighboring WiFi radio measured in&#160;dBm,...
Definition: wifi_common_hal.h:416
_wifi_sta_stats::sta_Noise
float sta_Noise
Indicator of average noise strength (in dBm) received from the connected WiFi radio.
Definition: wifi_common_hal.h:463
_wifi_radioTrafficStats::radio_ChannelUtilization
unsigned long radio_ChannelUtilization
Percentage of time the channel was occupied by the radio’s own activity (Activity Factor) or the acti...
Definition: wifi_common_hal.h:363
wifi_setRadioCarrierSenseThresholdInUse
int wifi_setRadioCarrierSenseThresholdInUse(int radioIndex, int threshold)
Set carrier sense threshold.
WIFI_SECURITY_WPA_WPA2_ENTERPRISE
@ WIFI_SECURITY_WPA_WPA2_ENTERPRISE
WPA,WPA2 Enterprise with TKIP AES encryption.
Definition: wifi_common_hal.h:334
wifi_setRadioTransmitPower
int wifi_setRadioTransmitPower(int radioIndex, unsigned long TransmitPower)
Set the transmit power.
WIFI_RSSI_NONE
@ WIFI_RSSI_NONE
No signal (0 bar)
Definition: wifi_common_hal.h:258
_wifi_neighbor_ap::ap_EncryptionMode
char ap_EncryptionMode[64]
Comma-separated list of strings. The type of encryption the neighboring WiFi SSID advertises....
Definition: wifi_common_hal.h:418
wifi_getNeighboringWiFiDiagnosticResult
int wifi_getNeighboringWiFiDiagnosticResult(int radioIndex, wifi_neighbor_ap_t **neighbor_ap_array, unsigned int *output_array_size)
Get neighbor wifi diagnostics.
wifi_factoryResetRadio
int wifi_factoryResetRadio(int radioIndex)
Reset specified radio parameter.
Definition: wifi_common_hal.c:544
wifi_setRadioAutoChannelRefreshPeriod
int wifi_setRadioAutoChannelRefreshPeriod(int radioIndex, unsigned long seconds)
Set the Auto Channel Selection / Dynamic channel selection refresh period in seconds.
_wifi_neighbor_ap::ap_OperatingStandards
char ap_OperatingStandards[16]
Comma-separated list of strings. Each list item MUST be a member of the list reported by theSupported...
Definition: wifi_common_hal.h:421
wifi_getRadioCarrierSenseThresholdInUse
int wifi_getRadioCarrierSenseThresholdInUse(int radioIndex, int *output)
Get carrier sense threshold.
wifi_getRadioAutoChannelEnable
int wifi_getRadioAutoChannelEnable(int radioIndex, unsigned char *output_bool)
Get the Auto Channel Selection / Dynamic channel selection enable status.
WIFI_SECURITY_WPA_PSK_AES
@ WIFI_SECURITY_WPA_PSK_AES
WPA(Pre-Shared Key) with AES (Advanced Encryption Standard) encryption.
Definition: wifi_common_hal.h:326
WIFI_HAL_UNRECOVERABLE_ERROR
@ WIFI_HAL_UNRECOVERABLE_ERROR
Definition: wifi_common_hal.h:304
WIFI_HAL_ERROR_NOT_FOUND
@ WIFI_HAL_ERROR_NOT_FOUND
Definition: wifi_common_hal.h:296
wifi_factoryResetRadios
int wifi_factoryResetRadios()
Reset all radio parameters.
Definition: wifi_common_hal.c:539
wifiStatusCode_t
wifiStatusCode_t
Enumerators for Wi-Fi connection status.
Definition: wifi_common_hal.h:290
wifi_applySSIDSettings
int wifi_applySSIDSettings(int ssidIndex)
This API is used to apply SSID settings to the hardware.
_wifi_radioTrafficStats::radio_MedianNoiseFloorOnChannel
int radio_MedianNoiseFloorOnChannel
Median Noise on the channel during the measuring interval. The metric is updated in this parameter at...
Definition: wifi_common_hal.h:369
WIFI_HAL_ERROR_TIMEOUT_EXPIRED
@ WIFI_HAL_ERROR_TIMEOUT_EXPIRED
Definition: wifi_common_hal.h:297
_wifi_ssidTrafficStats
Definition: wifi_common_hal.h:379
wifi_reset
int wifi_reset()
Deletes all the saved access point configuration details.
Definition: wifi_common_hal.c:550