Add new nimble service in wifi_provisioning example.
Posted: Tue Dec 20, 2022 7:21 am
Hello everyone!
I am using the wifi_provisioning example provided by espressif for my application. I am planning to use some ble/nimble functionalities while the wifi provisioning service is active and waiting for a connection. I have used the additional endpoint functionality the example provides:
However this is not flexible enough for the application. It is better if an extra service with its own function flow. One thing I have tried is using one of this endpoints, and write a byte into it. If the callback custom_ep_handler detects a certain byte, it kills the wifi provisioning and starts another nimble application.
However this obviously kills the connection with the phone, which is not ideal. Is there a way to add an extra primary service to this wifi prov example without ruining its functionality?
I am using the wifi_provisioning example provided by espressif for my application. I am planning to use some ble/nimble functionalities while the wifi provisioning service is active and waiting for a connection. I have used the additional endpoint functionality the example provides:
- wifi_prov_mgr_init(config);
- wifi_prov_mgr_endpoint_create("custom-endpoint");
- wifi_prov_mgr_start_provisioning(security, pop, service_name, service_key);
- wifi_prov_mgr_endpoint_register("custom-endpoint", custom_ep_handler, custom_ep_data);
- esp_err_t echo_req_handler (uint32_t session_id,
- const uint8_t *inbuf, ssize_t inlen,
- uint8_t **outbuf, ssize_t *outlen,
- void *priv_data)
- {
- if(*inbuf = certain_byte){
- wifi_prov_mgr_deinit();
- start_other_nimble_application();
- }
- return ESP_OK;
- }