File tree 5 files changed +7
-12
lines changed 5 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ void setup() {
53
53
BLEDevice::init (" MyESP32" );
54
54
55
55
// Create the BLE Server
56
- BLEServer *pServer = new BLEServer ();
56
+ BLEServer *pServer = BLEDevice::createServer ();
57
57
pServer->setCallbacks (new MyServerCallbacks ());
58
58
59
59
// Create the BLE Service
Original file line number Diff line number Diff line change 7
7
#include < BLEUtils.h>
8
8
#include < BLEServer.h>
9
9
10
- BLEDevice ble;
11
-
12
10
// See the following for generating UUIDs:
13
11
// https://www.uuidgenerator.net/
14
12
@@ -19,8 +17,8 @@ void setup() {
19
17
Serial.begin (115200 );
20
18
Serial.println (" Starting BLE work!" );
21
19
22
- ble. init (" MyESP32" );
23
- BLEServer *pServer = new BLEServer ();
20
+ BLEDevice:: init (" MyESP32" );
21
+ BLEServer *pServer = BLEDevice::createServer ();
24
22
BLEService *pService = pServer->createService (SERVICE_UUID);
25
23
BLECharacteristic *pCharacteristic = pService->createCharacteristic (
26
24
CHARACTERISTIC_UUID,
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ void setup() {
70
70
BLEDevice::init (" UART Service" );
71
71
72
72
// Create the BLE Server
73
- BLEServer *pServer = new BLEServer ();
73
+ BLEServer *pServer = BLEDevice::createServer ();
74
74
pServer->setCallbacks (new MyServerCallbacks ());
75
75
76
76
// Create the BLE Service
Original file line number Diff line number Diff line change 7
7
#include < BLEUtils.h>
8
8
#include < BLEServer.h>
9
9
10
- BLEDevice ble;
11
-
12
10
// See the following for generating UUIDs:
13
11
// https://www.uuidgenerator.net/
14
12
@@ -41,9 +39,8 @@ void setup() {
41
39
Serial.println (" 4- Go to CUSTOM CHARACTERISTIC in CUSTOM SERVICE and write something" );
42
40
Serial.println (" 5- See the magic =)" );
43
41
44
- // ble.begin("MyESP32");
45
- ble.init (" MyESP32" );
46
- BLEServer *pServer = new BLEServer ();
42
+ BLEDevice::init (" MyESP32" );
43
+ BLEServer *pServer = BLEDevice::createServer ();
47
44
48
45
BLEService *pService = pServer->createService (SERVICE_UUID);
49
46
Original file line number Diff line number Diff line change 1
1
name =ESP32 BLE Arduino
2
- version =0.4.4
2
+ version =0.4.5
3
3
author =Neil Kolban <
[email protected] >
4
4
maintainer =Neil Kolban <
[email protected] >
5
5
sentence =BLE functions for ESP32
You can’t perform that action at this time.
0 commit comments