Skip to content

Commit

Permalink
Merge branch 'optimize/zero_provisioning' into 'master'
Browse files Browse the repository at this point in the history
optimize: zero provision

See merge request ae_group/esp-mesh-lite!113
  • Loading branch information
xcguang committed Aug 7, 2024
2 parents ffa943f + aa2f639 commit e65961b
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 103 deletions.
4 changes: 4 additions & 0 deletions components/mesh_lite/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ menu "ESP Wi-Fi Mesh Lite"
config DEVICE_INFO_LENGTH
int "Device information length"
default 40

config ZERO_PROV_LISTENING_TIMEOUT
int "Zero Provisioning listening timeout"
default 360
endmenu

endmenu
11 changes: 10 additions & 1 deletion components/mesh_lite/include/zero_provisioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@
#ifndef zero_prov_H
#define zero_prov_H

#define ZERO_PROV_QUEUE_SIZE 100
#define ZERO_PROV_DEBUG (0)
#define ZERO_PROV_QUEUE_SIZE (100)
#define ZERO_PROV_LISTENING_TIMEOUT CONFIG_ZERO_PROV_LISTENING_TIMEOUT
#define ZERO_PROV_ERR_CHECK(a, str, ret) if(!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
return (ret); \
}
#define ZERO_PROV_CHECK_RETURN_VAIL(func_call) \
do { \
esp_err_t err = (func_call); \
if (err == ESP_FAIL) { \
ESP_LOGW(TAG, "%s %d %s failed with error: %d", __func__, __LINE__, #func_call, err); \
} \
} while (0)

typedef enum {
ZERO_PROV_SEND_BROADCAST,
Expand Down
2 changes: 1 addition & 1 deletion components/mesh_lite/src/wifi_prov/wifi_prov_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ esp_err_t __attribute__((weak)) wifi_prov_wifi_connect(wifi_sta_config_t *conf)
{
esp_err_t ret = ESP_OK;
#if CONFIG_MESH_LITE_ENABLE
mesh_lite_sta_config_t config;
mesh_lite_sta_config_t config = {0};
memcpy((char*)config.ssid, (char*)conf->ssid, sizeof(config.ssid));
memcpy((char*)config.password, (char*)conf->password, sizeof(config.password));
config.bssid_set = conf->bssid_set;
Expand Down
Loading

0 comments on commit e65961b

Please sign in to comment.