chegewara wrote: ↑Mon Jan 24, 2022 5:20 pm
I will try to explain it slower:
- CONFIG_BT_BLE_ENABLED=y is not the same as CONFIG_BT_BLE_BLUFI_ENABLE
- CONFIG_BT_BLE_ENABLED=y wont enable blufi no matter how much you will want it
- blufi is not the same as BLE, even if blufi is protocol on top of BLE
- here is espressif blufi example, with default sdkconfigs
https://github.com/espressif/esp-idf/bl ... esp32#L474
Apologies. I didn't state the correct config variable when writing the post (they are right next to each other in sdkconfig). CONFIG_BT_BLE_BLUFI_ENABLE=y is what's in sdkconfig. The rest of my post is correct.
I have compared the config file of the blufi sample project with my config file, but am not seeing any difference that would cause this issue.
Code: Select all
ESP_LOGE(TAG, "callback init: CONFIG_BT_BLE_BLUFI_ENABLE: %d", CONFIG_BT_BLE_BLUFI_ENABLE);
#ifdef UC_BT_BLUFI_ENABLE
ESP_LOGE(TAG, "callback init: UC_BT_BLUFI_ENABLE: %d", UC_BT_BLUFI_ENABLE);
#endif
#ifdef BLUFI_INCLUDED
ESP_LOGE(TAG, "callback init: BLUFI_INCLUDED: %d", BLUFI_INCLUDED);
#endif
Running that chunk of code, it compiles, runs and confirms that CONFIG_BT_BLE_BLUFI_ENABLE is defined. That being defined should result in UC_BT_BLUFI_ENABLE being defined as TRUE, but I do not get the log for that item, and if I uncomment the #ifdef, it will not compile. Same for BLUFI_INCLUDED.
To clarify, if I run this code
Code: Select all
ESP_LOGE(TAG, "callback init: CONFIG_BT_BLE_BLUFI_ENABLE: %d", CONFIG_BT_BLE_BLUFI_ENABLE);
ESP_LOGE(TAG, "callback init: UC_BT_BLUFI_ENABLE: %d", UC_BT_BLUFI_ENABLE);
ESP_LOGE(TAG, "callback init: BLUFI_INCLUDED: %d", BLUFI_INCLUDED);
I get this
../main/Services/BluetoothService.cpp:192:5: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "callback init: UC_BT_BLUFI_ENABLE: %d", UC_BT_BLUFI_ENABLE);
^~~~~~~~
../main/Services/BluetoothService.cpp:192:60: error: 'UC_BT_BLUFI_ENABLE' was not declared in this scope
ESP_LOGE(TAG, "callback init: UC_BT_BLUFI_ENABLE: %d", UC_BT_BLUFI_ENABLE);
^~~~~~~~~~~~~~~~~~
C:/Users/Ricky/esp/esp-idf/components/log/include/esp_log.h:337:137: note: in definition of macro 'ESP_LOG_LEVEL'
else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
C:/Users/Ricky/esp/esp-idf/components/log/include/esp_log.h:299:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
../main/Services/BluetoothService.cpp:192:5: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "callback init: UC_BT_BLUFI_ENABLE: %d", UC_BT_BLUFI_ENABLE);
^~~~~~~~
../main/Services/BluetoothService.cpp:192:60: error: 'UC_BT_BLUFI_ENABLE' was not declared in this scope
ESP_LOGE(TAG, "callback init: UC_BT_BLUFI_ENABLE: %d", UC_BT_BLUFI_ENABLE);
^~~~~~~~~~~~~~~~~~
C:/Users/Ricky/esp/esp-idf/components/log/include/esp_log.h:338:137: note: in definition of macro 'ESP_LOG_LEVEL'
else { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
The problem is that even though CONFIG_BT_BLE_BLUFI_ENABLE is defined, UC_BT_BLUFI_ENABLE and BLUFI_INCLUDED are not defined.