Skip to content

Commit c492583

Browse files
committed
Update samples
1 parent fcd3276 commit c492583

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

cpp_utils/BLEServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static const char* LOG_TAG = "BLEServer";
2828
* @brief Construct a %BLE Server
2929
*
3030
* 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.
3232
*/
3333
BLEServer::BLEServer() {
3434
m_appId = -1;

cpp_utils/tests/BLE Tests/Sample-MLE-15.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <esp_log.h>
44
#include <string>
55

6-
#include "../../BLEDevice.h"
6+
#include "../components/cpp_utils/BLEDevice.h"
77
#include "BLEAdvertisedDevice.h"
88
#include "BLEClient.h"
99
#include "sdkconfig.h"
@@ -22,7 +22,7 @@ static BLEUUID charUUID((uint16_t)0x2a06);
2222
class MyClient: public Task {
2323
void run(void *data) {
2424
BLEAddress* pAddress = (BLEAddress *)data;
25-
BLEClient* pClient = BLE::createClient();
25+
BLEClient* pClient = BLEDevice::createClient();
2626

2727

2828
pClient->connect(*pAddress);
@@ -55,8 +55,8 @@ class MyClient: public Task {
5555

5656
static void run() {
5757
ESP_LOGD(LOG_TAG, "MLE-15 sample starting");
58-
BLE::initClient();
59-
BLEClient* pClient = BLE::createClient();
58+
BLEDevice::init("");
59+
BLEClient* pClient = BLEDevice::createClient();
6060

6161

6262
pClient->connect(BLEAddress("ff:ff:45:19:14:80"));

cpp_utils/tests/BLE Tests/SampleClient.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <string>
33
#include <sstream>
44
#include <sys/time.h>
5-
#include "../../BLEDevice.h"
5+
#include "../components/cpp_utils/BLEDevice.h"
66

77
#include "BLEAdvertisedDevice.h"
88
#include "BLEClient.h"
@@ -29,7 +29,7 @@ static BLEUUID charUUID("0d563a58-196a-48ce-ace2-dfec78acc814");
2929
class MyClient: public Task {
3030
void run(void* data) {
3131
BLEAddress* pAddress = (BLEAddress*)data;
32-
BLEClient* pClient = BLE::createClient();
32+
BLEClient* pClient = BLEDevice::createClient();
3333

3434
// Connect to the remove BLE Server.
3535
pClient->connect(*pAddress);
@@ -100,8 +100,8 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
100100
*/
101101
void SampleClient(void) {
102102
ESP_LOGD(LOG_TAG, "Scanning sample starting");
103-
BLE::initClient();
104-
BLEScan *pBLEScan = BLE::getScan();
103+
BLEDevice::init("");
104+
BLEScan *pBLEScan = BLEDevice::getScan();
105105
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
106106
pBLEScan->setActiveScan(true);
107107
pBLEScan->start(30);

cpp_utils/tests/BLE Tests/SampleNotify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <string>
2424
#include <sstream>
2525
#include <sys/time.h>
26-
#include "../../BLEDevice.h"
26+
#include "../components/cpp_utils/BLEDevice.h"
2727

2828
#include "BLEServer.h"
2929
#include "BLEUtils.h"
@@ -72,7 +72,7 @@ static void run() {
7272
pMyNotifyTask->setStackSize(8000);
7373

7474
// Create the BLE Device
75-
BLE::initServer("MYDEVICE");
75+
BLEDevice::init("MYDEVICE");
7676

7777
// Create the BLE Server
7878
BLEServer *pServer = new BLEServer();

cpp_utils/tests/BLE Tests/SampleRead.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string>
55
#include <sys/time.h>
66
#include <sstream>
7-
#include "../../BLEDevice.h"
7+
#include "../components/cpp_utils/BLEDevice.h"
88

99
#include "sdkconfig.h"
1010

@@ -27,7 +27,7 @@ class MyCallbackHandler: public BLECharacteristicCallbacks {
2727
};
2828

2929
static void run() {
30-
BLE::initServer("MYDEVICE");
30+
BLEDevice::init("MYDEVICE");
3131
BLEServer *pServer = new BLEServer();
3232

3333
BLEService *pService = pServer->createService(BLEUUID(SERVICE_UUID_BIN, 16, true));

cpp_utils/tests/BLE Tests/SampleScan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <esp_log.h>
44
#include <string>
55

6-
#include "../../BLEDevice.h"
6+
#include "../components/cpp_utils/BLEDevice.h"
77
#include "BLEAdvertisedDevice.h"
88
#include "sdkconfig.h"
99

@@ -17,8 +17,8 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
1717

1818
static void run() {
1919
ESP_LOGD(LOG_TAG, "Scanning sample starting");
20-
BLE::initClient();
21-
BLEScan* pBLEScan = BLE::getScan();
20+
BLEDevice::init("");
21+
BLEScan* pBLEScan = BLEDevice::getScan();
2222
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
2323
pBLEScan->setActiveScan(true);
2424
BLEScanResults scanResults = pBLEScan->start(30);

cpp_utils/tests/BLE Tests/SampleServer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <esp_log.h>
55
#include <string>
66
#include <Task.h>
7-
#include "../../BLEDevice.h"
7+
#include "../components/cpp_utils/BLEDevice.h"
88

99
#include "sdkconfig.h"
1010

@@ -14,7 +14,7 @@ class MainBLEServer: public Task {
1414
void run(void *data) {
1515
ESP_LOGD(LOG_TAG, "Starting BLE work!");
1616

17-
BLE::initServer("MYDEVICE");
17+
BLEDevice::init("MYDEVICE");
1818
BLEServer* pServer = new BLEServer();
1919

2020
BLEService* pService = pServer->createService(BLEUUID((uint16_t)0x1234));

cpp_utils/tests/BLE Tests/SampleWrite.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string>
55
#include <sys/time.h>
66
#include <sstream>
7-
#include "../../BLEDevice.h"
7+
#include "../components/cpp_utils/BLEDevice.h"
88

99
#include "sdkconfig.h"
1010

@@ -28,7 +28,7 @@ class MyCallbacks: public BLECharacteristicCallbacks {
2828
};
2929

3030
static void run() {
31-
BLE::initServer("MYDEVICE");
31+
BLEDevice::init("MYDEVICE");
3232
BLEServer *pServer = new BLEServer();
3333

3434
BLEService *pService = pServer->createService(BLEUUID(SERVICE_UUID));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy