h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
667 stars 138 forks source link

Error compile Arduino BLE 5 example for ESP32 #672

Open alberk8 opened 1 month ago

alberk8 commented 1 month ago

Hi,

I am getting the following error using the sample code. Compiling using Arduino IDE 2.3.2 for ESP32 C3 (Nimble Arduino by h2zero 1.4.1). What is missing here?

d:\Staging\Arduino\libraries\NimBLE-Arduino\src\nimble\nimble\host\src\ble_hs_periodic_sync.c: In function 'ble_hs_periodic_sync_free':
d:\Staging\Arduino\libraries\NimBLE-Arduino\src\nimble\nimble\host\src\ble_hs_periodic_sync.c:58:24: error: 'struct ble_npl_event' has no member named 'event'
     if((psync->lost_ev).event != NULL)
h2zero commented 1 month ago

@alberk8, what arduino core version are you using?

alberk8 commented 1 month ago

@h2zero , It is using Esp32 2.0.11. Upgrading to 2.0.17 also did not work.

h2zero commented 1 month ago

Do you have periodic advertisements enabled? if so please disable and try again. I haven't had time to implement this yet.

alberk8 commented 1 month ago

Disabling the two lines in the nimconfig.h enable compilation of the code. Does the sample code actually extend the BLE 5 range?

/** @brief Un-comment to enable periodic advertising */
// #define CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV 1

/** @brief Un-comment to change the maximum number of periodically synced devices */
// #define CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS 1
h2zero commented 1 month ago

Great, yes it does extend it a good amount depending on your device/antenna.