1 /*
2  * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _ESP_MBO_H
8 #define _ESP_MBO_H
9 
10 #include <stdbool.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /**
16  * @brief Enumeration of reasons for a channel being non-preferred in a wireless network.
17  *
18  * This enumeration defines various reasons why a specific channel might be considered non-preferred
19  * in a wireless network configuration.
20  */
21 enum non_pref_chan_reason {
22     NON_PREF_CHAN_REASON_UNSPECIFIED = 0,      /**< Unspecified reason for non-preference */
23     NON_PREF_CHAN_REASON_RSSI = 1,             /**< Non-preferred due to low RSSI (Received Signal Strength Indication) */
24     NON_PREF_CHAN_REASON_EXT_INTERFERENCE = 2, /**< Non-preferred due to external interference */
25     NON_PREF_CHAN_REASON_INT_INTERFERENCE = 3, /**< Non-preferred due to internal interference */
26 };
27 
28 /**
29  * @brief Structure representing a non-preferred channel in a wireless network.
30  *
31  * This structure encapsulates information about a non-preferred channel
32  * including the reason for its non-preference, the operating class, channel number, and preference level.
33  */
34 struct non_pref_chan {
35     enum non_pref_chan_reason reason; /**< Reason for the channel being non-preferred */
36     uint8_t oper_class;               /**< Operating class of the channel */
37     uint8_t chan;                     /**< Channel number */
38     uint8_t preference;               /**< Preference level of the channel */
39 };
40 
41 /**
42  * @brief Structure representing a list of non-preferred channels in a wireless network.
43  *
44  * This structure encapsulates information about a list of non-preferred channels
45  * including the number of non-preferred channels and an array of structures
46  * representing individual non-preferred channels.
47  */
48 struct non_pref_chan_s {
49     size_t non_pref_chan_num; /**< Number of non-preferred channels in the list */
50     struct non_pref_chan chan[]; /**< Array of structures representing individual non-preferred channels */
51 };
52 
53 /**
54   * @brief  Update channel preference for MBO IE
55   *
56   * @param  non_pref_chan: Non preference channel list
57   *
58   * @return
59   *    - 0: success else failure
60   */
61 int esp_mbo_update_non_pref_chan(struct non_pref_chan_s *non_pref_chan);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 #endif
67