diff --git a/components/protocomm/include/common/protocomm.h b/components/protocomm/include/common/protocomm.h index e2704a3364..5056f78771 100644 --- a/components/protocomm/include/common/protocomm.h +++ b/components/protocomm/include/common/protocomm.h @@ -192,6 +192,8 @@ esp_err_t protocomm_req_handle(protocomm_t *pc, const char *ep_name, uint32_t se * For protocomm security version 1 and 2 * sec_params should contain pointer to struct of type * protocomm_security1_params_t and protocmm_security2_params_t respectively. + * The contents of this pointer must be valid till the security session + * has been running and is not closed. * @return * - ESP_OK : Success * - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists diff --git a/components/wifi_provisioning/include/wifi_provisioning/manager.h b/components/wifi_provisioning/include/wifi_provisioning/manager.h index e65ef3ea70..a1ead0d4dc 100644 --- a/components/wifi_provisioning/include/wifi_provisioning/manager.h +++ b/components/wifi_provisioning/include/wifi_provisioning/manager.h @@ -301,6 +301,8 @@ esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned); * This pointer should hold the struct of type * wifi_prov_security1_params_t for protocomm security 1 * and wifi_prov_security2_params_t for protocomm security 2 respectively. + * This pointer and its contents should be valid till the provisioning service is + * running and has not been stopped or de-inited. * @param[in] service_name Unique name of the service. This translates to: * - Wi-Fi SSID when provisioning mode is softAP * - Device name when provisioning mode is BLE diff --git a/examples/provisioning/wifi_prov_mgr/main/app_main.c b/examples/provisioning/wifi_prov_mgr/main/app_main.c index e786a7f01e..9f17dfe1b2 100644 --- a/examples/provisioning/wifi_prov_mgr/main/app_main.c +++ b/examples/provisioning/wifi_prov_mgr/main/app_main.c @@ -336,6 +336,9 @@ void app_main(void) * - NULL if not used */ const char *pop = "abcd1234"; + /* If the pop is allocated dynamically, then it should be valid till the provisioning process is running. + * it can be only freed when the WIFI_PROV_END event is triggered */ + /* This is the structure for passing security parameters * for the protocomm security 1. * This does not need not be static i.e. could be dynamically allocated