8000 Merge pull request #123 from me-no-dev/master · kebot-embedded/esp32-snippets@5bac3df · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bac3df

Browse files
authored
Merge pull request nkolban#123 from me-no-dev/master
Fix Arduino Examples
2 parents ff93684 + 479a786 commit 5bac3df

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

cpp_utils/tests/BLETests/Arduino/BLE_notify/BLE_notify.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void setup() {
5353
BLEDevice::init("MyESP32");
5454

5555
// Create the BLE Server
56-
BLEServer *pServer = new BLEServer();
56+
BLEServer *pServer = BLEDevice::createServer();
5757
pServer->setCallbacks(new MyServerCallbacks());
5858

5959
// Create the BLE Service

cpp_utils/tests/BLETests/Arduino/BLE_server/BLE_server.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <BLEUtils.h>
88
#include <BLEServer.h>
99

10-
BLEDevice ble;
11-
1210
// See the following for generating UUIDs:
1311
// https://www.uuidgenerator.net/
1412

@@ -19,8 +17,8 @@ void setup() {
1917
Serial.begin(115200);
2018
Serial.println("Starting BLE work!");
2119

22-
ble.init("MyESP32");
23-
BLEServer *pServer = new BLEServer();
20+
BLEDevice::init("MyESP32");
21+
BLEServer *pServer = BLEDevice::createServer();
2422
BLEService *pService = pServer->createService(SERVICE_UUID);
2523
BLECharacteristic *pCharacteristic = pService->createCharacteristic(
2624
CHARACTERISTIC_UUID,

cpp_utils/tests/BLETests/Arduino/BLE_uart/BLE_uart.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void setup() {
7070
BLEDevice::init("UART Service");
7171

7272
// Create the BLE Server
73-
BLEServer *pServer = new BLEServer();
73+
BLEServer *pServer = BLEDevice::createServer();
7474
pServer->setCallbacks(new MyServerCallbacks());
7575

7676
// Create the BLE Service

cpp_utils/tests/BLETests/Arduino/BLE_write/BLE_write.ino

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <BLEUtils.h>
88
#include <BLEServer.h>
99

10-
BLEDevice ble;
11-
1210
// See the following for generating UUIDs:
1311
// https://www.uuidgenerator.net/
1412

@@ -41,9 +39,8 @@ void setup() {
4139
Serial.println("4- Go to CUSTOM CHARACTERISTIC in CUSTOM SERVICE and write something");
4240
Serial.println("5- See the magic =)");
4341

44-
//ble.begin("MyESP32");
45-
ble.init("MyESP32");
46-
BLEServer *pServer = new BLEServer();
42+
BLEDevice::init("MyESP32");
43+
BLEServer *pServer = BLEDevice::createServer();
4744

4845
BLEService *pService = pServer->createService(SERVICE_UUID);
4946

0 commit comments

Comments
 (0)
0