1 // Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #ifndef __ESP_MESH_INTERNAL_H__
16 #define __ESP_MESH_INTERNAL_H__
20 #include "esp_wifi_types.h"
21 #include "esp_wifi_internal.h"
22 #include "esp_wifi_crypto_types.h"
28 /*******************************************************
30 *******************************************************/
32 /*******************************************************
34 *******************************************************/
36 int scan; /**< minimum scan times before being a root, default:10 */
37 int vote; /**< max vote times in self-healing, default:10000 */
38 int fail; /**< parent selection fail times, if the scan times reach this value,
39 will disconnect with associated children and join self-healing. default:60 */
40 int monitor_ie; /**< acceptable times of parent ie change before update self ie, default:3 */
44 int duration_ms; /* parent weak RSSI monitor duration, if the RSSI continues to be weak during this duration_ms,
45 will switch to a better parent */
46 int cnx_rssi; /* RSSI threshold for keeping a good connection with parent */
47 int select_rssi; /* RSSI threshold for parent selection, should be a value greater than switch_rssi */
48 int switch_rssi; /* RSSI threshold for action to reselect a better parent */
49 int backoff_rssi; /* RSSI threshold for connecting to the root */
50 } mesh_switch_parent_t;
52 /*******************************************************
53 * Function Definitions
54 *******************************************************/
56 * @brief set mesh softAP beacon interval
58 * @param interval beacon interval(ms) (100ms ~ 60000ms)
65 esp_err_t esp_mesh_set_beacon_interval(int interval_ms);
68 * @brief get mesh softAP beacon interval
70 * @param interval beacon interval(ms)
75 esp_err_t esp_mesh_get_beacon_interval(int *interval_ms);
78 * @brief set attempts for mesh self-organized networking
86 esp_err_t esp_mesh_set_attempts(mesh_attempts_t *attempts);
89 * @brief get attempts for mesh self-organized networking
97 esp_err_t esp_mesh_get_attempts(mesh_attempts_t *attempts);
100 * @brief set parameters for parent switch
102 * @param paras parameters for parent switch
108 esp_err_t esp_mesh_set_switch_parent_paras(mesh_switch_parent_t *paras);
111 * @brief get parameters for parent switch
113 * @param paras parameters for parent switch
119 esp_err_t esp_mesh_get_switch_parent_paras(mesh_switch_parent_t *paras);
122 * @brief print the number of txQ waiting
128 esp_err_t esp_mesh_print_txQ_waiting(void);
131 * @brief print the number of rxQ waiting
137 esp_err_t esp_mesh_print_rxQ_waiting(void);
140 * @brief set passive scan time
142 * @param interval_ms passive scan time(ms)
149 esp_err_t esp_mesh_set_passive_scan_time(int time_ms);
152 * @brief get passive scan time
154 * @return interval_ms passive scan time(ms)
156 int esp_mesh_get_passive_scan_time(void);
162 #endif /* __ESP_MESH_INTERNAL_H__ */