NimBLE-Arduino
NimBLE-Arduino copied to clipboard
example BT5.0 nimble extended server not working on ESP32-C3
Hi, had issues moving my nimble project from 'standard' BLE to the more advanced bluetooth 5.0. The standard NimBLE version compiles fine so my Arduino setup is correct, also rund fine on HW. So I just opened the "nimBLE extended server" example and tried to compile it but it fails (I have added nimconfig.h and NimBLEDevice.h)
Here is the output log: \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:59:66: error: expected class-name before '{' token class advertisingCallbacks: public NimBLEExtAdvertisingCallbacks { ^ \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:60:20: error: 'NimBLEExtAdvertising' has not been declared void onStopped(NimBLEExtAdvertising* pAdv, int reason, uint8_t inst_id) { ^~~~~~~~~~~~~~~~~~~~ \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino: In function 'void setup()': \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:102:5: error: 'NimBLEExtAdvertisement' was not declared in this scope NimBLEExtAdvertisement extAdv(primaryPhy, secondaryPhy); ^~~~~~~~~~~~~~~~~~~~~~ \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:102:5: note: suggested alternative: 'NimBLEAdvertising' NimBLEExtAdvertisement extAdv(primaryPhy, secondaryPhy); ^~~~~~~~~~~~~~~~~~~~~~ NimBLEAdvertising \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:105:5: error: 'extAdv' was not declared in this scope extAdv.setConnectable(true); ^~~~~~ \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:105:5: note: suggested alternative: 'execv' extAdv.setConnectable(true); ^~~~~~ execv \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:121:5: error: 'NimBLEExtAdvertising' was not declared in this scope NimBLEExtAdvertising* pAdvertising = NimBLEDevice::getAdvertising(); ^~~~~~~~~~~~~~~~~~~~ \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:121:5: note: suggested alternative: 'NimBLEAdvertising' NimBLEExtAdvertising* pAdvertising = NimBLEDevice::getAdvertising(); ^~~~~~~~~~~~~~~~~~~~ NimBLEAdvertising \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:121:27: error: 'pAdvertising' was not declared in this scope NimBLEExtAdvertising* pAdvertising = NimBLEDevice::getAdvertising(); ^~~~~~~~~~~~ \Arduino\NimBLE_extended_server\NimBLE_extended_server.ino:121:27: note: suggested alternative: 'BLEAdvertising' NimBLEExtAdvertising* pAdvertising = NimBLEDevice::getAdvertising(); ^~~~~~~~~~~~ BLEAdvertising
exit status 1
Compilation error: expected class-name before '{' token
You need to enable BT5 as explained here https://github.com/h2zero/NimBLE-Arduino/blob/release/1.4/docs/Bluetooth%205%20features.md