fix(wifi_prov_mgr): Api to keep BLE on after provisioning

This commit is contained in:
shreeyash
2024-07-29 14:27:45 +05:30
parent 1ddd2f42b5
commit 6e6fd2f6a3
8 changed files with 90 additions and 19 deletions

View File

@@ -23,9 +23,21 @@ extern const wifi_prov_scheme_t wifi_prov_scheme_ble;
static uint8_t *custom_service_uuid;
static uint8_t *custom_ble_addr;
static uint8_t custom_keep_ble_on;
static uint8_t *custom_manufacturer_data;
static size_t custom_manufacturer_data_len;
esp_err_t wifi_prov_mgr_keep_ble_on(uint8_t is_on_after_ble_stop)
{
if (!is_on_after_ble_stop) {
return ESP_ERR_INVALID_ARG;
}
custom_keep_ble_on = is_on_after_ble_stop;
return ESP_OK;
}
static esp_err_t prov_start(protocomm_t *pc, void *config)
{
if (!pc) {
@@ -40,6 +52,8 @@ static esp_err_t prov_start(protocomm_t *pc, void *config)
protocomm_ble_config_t *ble_config = (protocomm_ble_config_t *) config;
ble_config->keep_ble_on = custom_keep_ble_on;
#if defined(CONFIG_WIFI_PROV_BLE_BONDING)
ble_config->ble_bonding = 1;
#endif