Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/BLE_EddystoneTLM_Beacon/BLE_EddystoneTLM_Beacon.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
4. wait
5. Stop advertising.
6. deep sleep

*/

#include "NimBLEDevice.h"
Expand All @@ -26,7 +26,7 @@
#define GPIO_DEEP_SLEEP_DURATION 10 // sleep x seconds and then wake up

// UUID 1 128-Bit (may use linux tool uuidgen or random numbers via https://www.uuidgenerator.net/)
#define BEACON_UUID "8ec76ea3-6668-48da-9866-75be8bc86f4d"
#define BEACON_UUID "8ec76ea3-6668-48da-9866-75be8bc86f4d"

RTC_DATA_ATTR static time_t last; // remember last boot in RTC Memory
RTC_DATA_ATTR static uint32_t bootcount; // remember number of boots in RTC Memory
Expand Down Expand Up @@ -96,6 +96,7 @@ void setup()
BLEDevice::setPower(ESP_PWR_LVL_N12);

pAdvertising = BLEDevice::getAdvertising();
pAdvertising->enableScanResponse(true);

setBeacon();
// Start advertising
Expand Down
3 changes: 2 additions & 1 deletion examples/BLE_EddystoneURL_Beacon/BLE_EddystoneURL_Beacon.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define GPIO_DEEP_SLEEP_DURATION 10 // sleep x seconds and then wake up

// UUID 1 128-Bit (may use linux tool uuidgen or random numbers via https://www.uuidgenerator.net/)
#define BEACON_UUID "8ec76ea3-6668-48da-9866-75be8bc86f4d"
#define BEACON_UUID "8ec76ea3-6668-48da-9866-75be8bc86f4d"

RTC_DATA_ATTR static time_t last; // remember last boot in RTC Memory
RTC_DATA_ATTR static uint32_t bootcount; // remember number of boots in RTC Memory
Expand Down Expand Up @@ -168,6 +168,7 @@ void setup()
BLEDevice::setPower(ESP_PWR_LVL_N12);

pAdvertising = BLEDevice::getAdvertising();
pAdvertising->enableScanResponse(true);

setBeacon();
// Start advertising
Expand Down
2 changes: 1 addition & 1 deletion examples/NimBLE_Server/NimBLE_Server.ino
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void setup() {
/** If your device is battery powered you may consider setting scan response
* to false as it will extend battery life at the expense of less data sent.
*/
pAdvertising->setScanResponse(true);
pAdvertising->enableScanResponse(true);
pAdvertising->start();

Serial.println("Advertising Started");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void setup() {
// Start advertising
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(false);
pAdvertising->enableScanResponse(false);
pAdvertising->start();
Serial.println("Waiting a client connection to notify...");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void setup() {

BLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(true);
pAdvertising->enableScanResponse(true);

pAdvertising->start();
Serial.println("Advertising started, connect with your phone.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void setup() {
// Start advertising
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(false);
pAdvertising->enableScanResponse(false);
/** Note, this could be left out as that is the default value */
pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ void setup() {
BLEService *pService = pServer->createService(SERVICE_UUID);
BLECharacteristic *pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID,
/***** Enum Type NIMBLE_PROPERTY now *****
/***** Enum Type NIMBLE_PROPERTY now *****
BLECharacteristic::PROPERTY_READ |
BLECharacteristic::PROPERTY_WRITE
BLECharacteristic::PROPERTY_WRITE
);
*****************************************/
NIMBLE_PROPERTY::READ |
NIMBLE_PROPERTY::WRITE
NIMBLE_PROPERTY::WRITE
);

pCharacteristic->setValue("Hello World says Neil");
pService->start();
// BLEAdvertising *pAdvertising = pServer->getAdvertising(); // this still is working for backward compatibility
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(true);
pAdvertising->enableScanResponse(true);
pAdvertising->setMinPreferred(0x06); // functions that help with iPhone connections issue
pAdvertising->setMaxPreferred(0x12);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void setup() {
// Start advertising
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->setScanResponse(false);
pAdvertising->enableScanResponse(false);
/** Note, this could be left out as that is the default value */
pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter

Expand Down
Loading