Replies: 1 comment
-
When extended advertisements are enable you must use a different class, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello…I’ve managed to successfully migrate my ESP32 Arduino sketch (originally coded using the Kolban/Chegewara Arduino BLE library) to NimBLE-Arduino format. The sketch simply notifies a couple of volts/amps characteristic values on a one-second interval. I can currently connect the Android phone app I created to the ESP32 via BLE at up to ~ 24 meters. I’d like to try LE Coded (coded PHY) to see if I can extend this range. The XIAO ESP32S3 I’m using is capable of BLE 5.0 Long Range.
The first step I took was to un-comment the line ‘#define CONFIG_BT_NIMBLE_EXT_ADV 1’ in the nimconfig.h file. That produced the error: ‘Compilation error: 'NimBLEAdvertising' was not declared in this scope’. I then added the following commands but continued to get the same error. At this stage, I’m not sure how to proceed. I suspect the way BLE advertising functions are called in my sketch need to change with coded PHY, but I'm not sure how. Any guidance you could provide would be greatly appreciated! - Frank
#define CONFIG_BT_NIMBLE_EXT_ADV 1
NimBLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(false);
pAdvertising->setAdvertisementType(BLE_HCI_ADV_TYPE_EXT_IND);
pAdvertising->setAdvertisementParameters(
BLE_HCI_ADV_PHY_CODED,
BLE_HCI_ADV_PHY_CODED);
NimBLEDevice::startAdvertising();
Serial.println("Start advertising...");
This is my sketch that functions properly at LE 1M advertising type:
Beta Was this translation helpful? Give feedback.
All reactions