File tree Expand file tree Collapse file tree 8 files changed +20
-20
lines changed Expand file tree Collapse file tree 8 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ static const char* LOG_TAG = "BLEServer";
28
28
* @brief Construct a %BLE Server
29
29
*
30
30
* This class is not designed to be individually instantiated. Instead one should create a server by asking
31
- * the BLE device class.
31
+ * the BLEDevice class.
32
32
*/
33
33
BLEServer::BLEServer () {
34
34
m_appId = -1 ;
Original file line number Diff line number Diff line change 3
3
#include < esp_log.h>
4
4
#include < string>
5
5
6
- #include " ../.. /BLEDevice.h"
6
+ #include " ../components/cpp_utils /BLEDevice.h"
7
7
#include " BLEAdvertisedDevice.h"
8
8
#include " BLEClient.h"
9
9
#include " sdkconfig.h"
@@ -22,7 +22,7 @@ static BLEUUID charUUID((uint16_t)0x2a06);
22
22
class MyClient : public Task {
23
23
void run (void *data) {
24
24
BLEAddress* pAddress = (BLEAddress *)data;
25
- BLEClient* pClient = BLE ::createClient ();
25
+ BLEClient* pClient = BLEDevice ::createClient ();
26
26
27
27
28
28
pClient->connect (*pAddress);
@@ -55,8 +55,8 @@ class MyClient: public Task {
55
55
56
56
static void run () {
57
57
ESP_LOGD (LOG_TAG, " MLE-15 sample starting" );
58
- BLE::initClient ( );
59
- BLEClient* pClient = BLE ::createClient ();
58
+ BLEDevice::init ( " " );
59
+ BLEClient* pClient = BLEDevice ::createClient ();
60
60
61
61
62
62
pClient->connect (BLEAddress (" ff:ff:45:19:14:80" ));
Original file line number Diff line number Diff line change 2
2
#include < string>
3
3
#include < sstream>
4
4
#include < sys/time.h>
5
- #include " ../.. /BLEDevice.h"
5
+ #include " ../components/cpp_utils /BLEDevice.h"
6
6
7
7
#include " BLEAdvertisedDevice.h"
8
8
#include " BLEClient.h"
@@ -29,7 +29,7 @@ static BLEUUID charUUID("0d563a58-196a-48ce-ace2-dfec78acc814");
29
29
class MyClient : public Task {
30
30
void run (void * data) {
31
31
BLEAddress* pAddress = (BLEAddress*)data;
32
- BLEClient* pClient = BLE ::createClient ();
32
+ BLEClient* pClient = BLEDevice ::createClient ();
33
33
34
34
// Connect to the remove BLE Server.
35
35
pClient->connect (*pAddress);
@@ -100,8 +100,8 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
100
100
*/
101
101
void SampleClient (void ) {
102
102
ESP_LOGD (LOG_TAG, " Scanning sample starting" );
103
- BLE::initClient ( );
104
- BLEScan *pBLEScan = BLE ::getScan ();
103
+ BLEDevice::init ( " " );
104
+ BLEScan *pBLEScan = BLEDevice ::getScan ();
105
105
pBLEScan->setAdvertisedDeviceCallbacks (new MyAdvertisedDeviceCallbacks ());
106
106
pBLEScan->setActiveScan (true );
107
107
pBLEScan->start (30 );
Original file line number Diff line number Diff line change 23
23
#include < string>
24
24
#include < sstream>
25
25
#include < sys/time.h>
26
- #include " ../.. /BLEDevice.h"
26
+ #include " ../components/cpp_utils /BLEDevice.h"
27
27
28
28
#include " BLEServer.h"
29
29
#include " BLEUtils.h"
@@ -72,7 +72,7 @@ static void run() {
72
72
pMyNotifyTask->setStackSize (8000 );
73
73
74
74
// Create the BLE Device
75
- BLE::initServer (" MYDEVICE" );
75
+ BLEDevice::init (" MYDEVICE" );
76
76
77
77
// Create the BLE Server
78
78
BLEServer *pServer = new BLEServer ();
Original file line number Diff line number Diff line change 4
4
#include < string>
5
5
#include < sys/time.h>
6
6
#include < sstream>
7
- #include " ../.. /BLEDevice.h"
7
+ #include " ../components/cpp_utils /BLEDevice.h"
8
8
9
9
#include " sdkconfig.h"
10
10
@@ -27,7 +27,7 @@ class MyCallbackHandler: public BLECharacteristicCallbacks {
27
27
};
28
28
29
29
static void run () {
30
- BLE::initServer (" MYDEVICE" );
30
+ BLEDevice::init (" MYDEVICE" );
31
31
BLEServer *pServer = new BLEServer ();
32
32
33
33
BLEService *pService = pServer->createService (BLEUUID (SERVICE_UUID_BIN, 16 , true ));
Original file line number Diff line number Diff line change 3
3
#include < esp_log.h>
4
4
#include < string>
5
5
6
- #include " ../.. /BLEDevice.h"
6
+ #include " ../components/cpp_utils /BLEDevice.h"
7
7
#include " BLEAdvertisedDevice.h"
8
8
#include " sdkconfig.h"
9
9
@@ -17,8 +17,8 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
17
17
18
18
static void run () {
19
19
ESP_LOGD (LOG_TAG, " Scanning sample starting" );
20
- BLE::initClient ( );
21
- BLEScan* pBLEScan = BLE ::getScan ();
20
+ BLEDevice::init ( " " );
21
+ BLEScan* pBLEScan = BLEDevice ::getScan ();
22
22
pBLEScan->setAdvertisedDeviceCallbacks (new MyAdvertisedDeviceCallbacks ());
23
23
pBLEScan->setActiveScan (true );
24
24
BLEScanResults scanResults = pBLEScan->start (30 );
Original file line number Diff line number Diff line change 4
4
#include < esp_log.h>
5
5
#include < string>
6
6
#include < Task.h>
7
- #include " ../.. /BLEDevice.h"
7
+ #include " ../components/cpp_utils /BLEDevice.h"
8
8
9
9
#include " sdkconfig.h"
10
10
@@ -14,7 +14,7 @@ class MainBLEServer: public Task {
14
14
void run (void *data) {
15
15
ESP_LOGD (LOG_TAG, " Starting BLE work!" );
16
16
17
- BLE::initServer (" MYDEVICE" );
17
+ BLEDevice::init (" MYDEVICE" );
18
18
BLEServer* pServer = new BLEServer ();
19
19
20
20
BLEService* pService = pServer->createService (BLEUUID ((uint16_t )0x1234 ));
Original file line number Diff line number Diff line change 4
4
#include < string>
5
5
#include < sys/time.h>
6
6
#include < sstream>
7
- #include " ../.. /BLEDevice.h"
7
+ #include " ../components/cpp_utils /BLEDevice.h"
8
8
9
9
#include " sdkconfig.h"
10
10
@@ -28,7 +28,7 @@ class MyCallbacks: public BLECharacteristicCallbacks {
616D
28
28
};
29
29
30
30
static void run () {
31
- BLE::initServer (" MYDEVICE" );
31
+ BLEDevice::init (" MYDEVICE" );
32
32
BLEServer *pServer = new BLEServer ();
33
33
34
34
BLEService *pService = pServer->createService (BLEUUID (SERVICE_UUID));
You can’t perform that action at this time.
0 commit comments