What is the proper way to deinit BluFi(want to release memory and resource after connect to WiFi)

specialvict
Posts: 3
Joined: Mon Oct 23, 2017 3:16 pm

What is the proper way to deinit BluFi(want to release memory and resource after connect to WiFi)

Postby specialvict » Thu Oct 26, 2017 4:00 pm

Dears,

I'm trying to use BluFi to implement the WiFi connection, which is a great way to do it.
However, when Bluetooth and WiFi coexist, it takes too much resource and the WiFi somehow keep disconnect after few seconds.

So I want to deinitialize the BluFi after connecting the WiFi successfully.

I saw the call back, but didn't see the API for call deinit manually.

Code: Select all

static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_param_t *param)
{
    /* actually, should post to blufi_task handle the procedure,
     * now, as a example, we do it more simply */
    switch (event) {
    case ESP_BLUFI_EVENT_INIT_FINISH:
        BLUFI_INFO("BLUFI init finish\n");

        esp_ble_gap_set_device_name(BLUFI_DEVICE_NAME);
        esp_ble_gap_config_adv_data(&example_adv_data);
        break;
    case ESP_BLUFI_EVENT_DEINIT_FINISH:
        BLUFI_INFO("BLUFI deinit finish\n");
        break;
Can anyone help me to do it?

Thanks in advance,

Victor

d1_jaime
Posts: 4
Joined: Wed Nov 15, 2017 5:18 pm

Re: What is the proper way to deinit BluFi(want to release memory and resource after connect to WiFi)

Postby d1_jaime » Thu Nov 16, 2017 3:25 pm

Hey,

I was already looking at the source code so I may have found the API call for you.

Code: Select all

/**
 *
 * @brief           This function is called to de-initialize blufi_profile
 *
 * @return          ESP_OK - success, other - failed
 *
 */
esp_err_t esp_blufi_profile_deinit(void);

Who is online

Users browsing this forum: No registered users and 128 guests