mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_wifi_mesh: add non mesh connections access
This commit is contained in:
parent
42ea9b7cb1
commit
b408043d7e
@ -505,8 +505,13 @@ typedef struct {
|
||||
* @brief Mesh softAP configuration
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t password[64]; /**< mesh softAP password */
|
||||
uint8_t max_connection; /**< max number of stations allowed to connect in, max 10 */
|
||||
uint8_t password[64]; /**< mesh softAP password */
|
||||
/**
|
||||
* max number of stations allowed to connect in, default 6, max 10
|
||||
* = max_connection + nonmesh_max_connection
|
||||
*/
|
||||
uint8_t max_connection; /**< max mesh connections */
|
||||
uint8_t nonmesh_max_connection; /**< max non-mesh connections */
|
||||
} mesh_ap_cfg_t;
|
||||
|
||||
/**
|
||||
@ -947,7 +952,8 @@ esp_err_t esp_mesh_set_ap_authmode(wifi_auth_mode_t authmode);
|
||||
wifi_auth_mode_t esp_mesh_get_ap_authmode(void);
|
||||
|
||||
/**
|
||||
* @brief Set mesh softAP max connection value
|
||||
* @brief Set mesh max connection value
|
||||
* - Set mesh softAP max connection = mesh max connection + non-mesh max connection
|
||||
*
|
||||
* @attention This API shall be called before mesh is started.
|
||||
*
|
||||
@ -960,12 +966,19 @@ wifi_auth_mode_t esp_mesh_get_ap_authmode(void);
|
||||
esp_err_t esp_mesh_set_ap_connections(int connections);
|
||||
|
||||
/**
|
||||
* @brief Get mesh softAP max connection configuration
|
||||
* @brief Get mesh max connection configuration
|
||||
*
|
||||
* @return the number of max connections
|
||||
* @return the number of mesh max connections
|
||||
*/
|
||||
int esp_mesh_get_ap_connections(void);
|
||||
|
||||
/**
|
||||
* @brief Get non-mesh max connection configuration
|
||||
*
|
||||
* @return the number of non-mesh max connections
|
||||
*/
|
||||
int esp_mesh_get_non_mesh_connections(void);
|
||||
|
||||
/**
|
||||
* @brief Get current layer value over the mesh network
|
||||
*
|
||||
|
@ -256,7 +256,8 @@ typedef struct {
|
||||
uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */
|
||||
uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */
|
||||
uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */
|
||||
uint32_t reserved:28; /**< bit: 4..31 reserved */
|
||||
uint32_t is_mesh_child:1;/**< bit: 4 flag to identify mesh child */
|
||||
uint32_t reserved:27; /**< bit: 5..31 reserved */
|
||||
} wifi_sta_info_t;
|
||||
|
||||
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32 soft-AP */
|
||||
@ -600,12 +601,14 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint8_t mac[6]; /**< MAC address of the station connected to ESP32 soft-AP */
|
||||
uint8_t aid; /**< the aid that ESP32 soft-AP gives to the station connected to */
|
||||
bool is_mesh_child; /**< flag to identify mesh child */
|
||||
} wifi_event_ap_staconnected_t;
|
||||
|
||||
/** Argument structure for WIFI_EVENT_AP_STADISCONNECTED event */
|
||||
typedef struct {
|
||||
uint8_t mac[6]; /**< MAC address of the station disconnects to ESP32 soft-AP */
|
||||
uint8_t aid; /**< the aid that ESP32 soft-AP gave to the station disconnects to */
|
||||
bool is_mesh_child; /**< flag to identify mesh child */
|
||||
} wifi_event_ap_stadisconnected_t;
|
||||
|
||||
/** Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event */
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 3712c028c0c0791008dbf7317df9d6218211f7e7
|
||||
Subproject commit 90fa34580fc0067bf580b6b37ffcf8e3f8fd37ee
|
@ -154,7 +154,14 @@ menu "Example Configuration"
|
||||
range 1 10
|
||||
default 6
|
||||
help
|
||||
The number of stations allowed to connect in.
|
||||
The number of mesh stations allowed to connect in.
|
||||
|
||||
config MESH_NON_MESH_AP_CONNECTIONS
|
||||
int "Mesh Non Mesh AP Connections"
|
||||
range 0 9
|
||||
default 0
|
||||
help
|
||||
The number of non-mesh stations allowed to connect in.
|
||||
|
||||
config MESH_ROUTE_TABLE_SIZE
|
||||
int "Mesh Routing Table Size"
|
||||
|
@ -433,6 +433,7 @@ void app_main(void)
|
||||
/* mesh softAP */
|
||||
ESP_ERROR_CHECK(esp_mesh_set_ap_authmode(CONFIG_MESH_AP_AUTHMODE));
|
||||
cfg.mesh_ap.max_connection = CONFIG_MESH_AP_CONNECTIONS;
|
||||
cfg.mesh_ap.nonmesh_max_connection = CONFIG_MESH_NON_MESH_AP_CONNECTIONS;
|
||||
memcpy((uint8_t *) &cfg.mesh_ap.password, CONFIG_MESH_AP_PASSWD,
|
||||
strlen(CONFIG_MESH_AP_PASSWD));
|
||||
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
||||
|
@ -55,7 +55,14 @@ menu "Example Configuration"
|
||||
range 1 10
|
||||
default 6
|
||||
help
|
||||
The number of stations allowed to connect in.
|
||||
The number of mesh stations allowed to connect in.
|
||||
|
||||
config MESH_NON_MESH_AP_CONNECTIONS
|
||||
int "Mesh Non Mesh AP Connections"
|
||||
range 0 9
|
||||
default 0
|
||||
help
|
||||
The number of non-mesh stations allowed to connect in.
|
||||
|
||||
config MESH_MAX_LAYER
|
||||
int "Mesh Max Layer"
|
||||
|
@ -416,6 +416,7 @@ void app_main(void)
|
||||
/* mesh softAP */
|
||||
ESP_ERROR_CHECK(esp_mesh_set_ap_authmode(CONFIG_MESH_AP_AUTHMODE));
|
||||
cfg.mesh_ap.max_connection = CONFIG_MESH_AP_CONNECTIONS;
|
||||
cfg.mesh_ap.nonmesh_max_connection = CONFIG_MESH_NON_MESH_AP_CONNECTIONS;
|
||||
memcpy((uint8_t *) &cfg.mesh_ap.password, CONFIG_MESH_AP_PASSWD,
|
||||
strlen(CONFIG_MESH_AP_PASSWD));
|
||||
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
||||
|
@ -67,7 +67,14 @@ menu "Example Configuration"
|
||||
range 1 10
|
||||
default 6
|
||||
help
|
||||
The number of stations allowed to connect in.
|
||||
The number of mesh stations allowed to connect in.
|
||||
|
||||
config MESH_NON_MESH_AP_CONNECTIONS
|
||||
int "Mesh Non Mesh AP Connections"
|
||||
range 0 9
|
||||
default 0
|
||||
help
|
||||
The number of non-mesh stations allowed to connect in.
|
||||
|
||||
config MESH_MAX_LAYER
|
||||
int "Mesh Max Layer"
|
||||
|
@ -323,6 +323,7 @@ void app_main(void)
|
||||
/* mesh softAP */
|
||||
ESP_ERROR_CHECK(esp_mesh_set_ap_authmode(CONFIG_MESH_AP_AUTHMODE));
|
||||
cfg.mesh_ap.max_connection = CONFIG_MESH_AP_CONNECTIONS;
|
||||
cfg.mesh_ap.nonmesh_max_connection = CONFIG_MESH_NON_MESH_AP_CONNECTIONS;
|
||||
memcpy((uint8_t *) &cfg.mesh_ap.password, CONFIG_MESH_AP_PASSWD,
|
||||
strlen(CONFIG_MESH_AP_PASSWD));
|
||||
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
||||
|
Loading…
Reference in New Issue
Block a user