8000 Merge pull request #668 from chegewara/revert-667-master · CLPopescu-1999-02/esp32-snippets@ade8bcd · GitHub
[go: up one dir, main page]

Skip to content

Commit ade8bcd

Browse files
authored
Merge pull request nkolban#668 from chegewara/revert-667-master
Revert "Move m_advertising to BLEDevice"
2 parents e827bd9 + b5ab56a commit ade8bcd

15 files changed

+2916
-2941
lines changed

cpp_utils/BLEClient.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#ifdef ARDUINO_ARCH_ESP32
2222
#include "esp32-hal-log.h"
2323
#endif
24-
#include "BLEDevice.h"
2524

2625
/*
2726
* Design
@@ -45,9 +44,9 @@
4544
*/
4645
static const char* LOG_TAG = "BLEClient";
4746

48-
BLEClient::BLEClient(uint16_t connID) {
47+
BLEClient::BLEClient() {
4948
m_pClientCallbacks = nullptr;
50-
m_conn_id = connID;
49+
m_conn_id = 0;
5150
m_gattc_if = 0;
5251
m_haveServices = false;
5352
m_isConnected = false; // Initially, we are flagged as not connected.
@@ -97,7 +96,7 @@ bool BLEClient::connect(BLEAddress address) {
9796

9897
clearServices(); // Delete any services that may exist.
9998

100-
esp_err_t errRc = ::esp_ble_gattc_app_register(m_conn_id);
99+
esp_err_t errRc = ::esp_ble_gattc_app_register(0);
101100
if (errRc != ESP_OK) {
102101
ESP_LOGE(LOG_TAG, "esp_ble_gattc_app_register: rc=%d %s", errRc, GeneralUtils::errorToString(errRc));
103102
return false;
@@ -139,7 +138,6 @@ void BLEClient::disconnect() {
139138
}
140139
esp_ble_gattc_app_unregister(getGattcIf());
141140
m_peerAddress = BLEAddress("00:00:00:00:00:00");
142-
BLEDevice::removeClient(m_conn_id);
143141
ESP_LOGD(LOG_TAG, "<< disconnect()");
144142
} // disconnect
145143

cpp_utils/BLEClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BLEClientCallbacks;
2828
*/
2929
class BLEClient {
3030
public:
31-
BLE 4CBF Client(uint16_t connID);
31+
BLEClient();
3232
~BLEClient();
3333

3434
bool connect(BLEAddress address); // Connect to the remote BLE Server

0 commit comments

Comments
 (0)
0