8000 sync 2017-07-08 · ICELUCKBR/esp32-snippets@5715cd7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5715cd7

Browse files
committed
sync 2017-07-08
1 parent 39a79f6 commit 5715cd7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+586
-163
lines changed

cpp_utils/BLE.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static void gatt_server_event_handler(
8888
) {
8989
ESP_LOGD(LOG_TAG, "gatt_server_event_handler [esp_gatt_if: %d] ... %s",
9090
gatts_if,
91-
bt_utils_gatt_server_event_type_to_string(event).c_str());
91+
BLEUtils::gattServerEventTypeToString(event).c_str());
9292
BLEUtils::dumpGattServerEvent(event, gatts_if, param);
9393
if (BLE::m_bleServer != nullptr) {
9494
BLE::m_bleServer->handleGATTServerEvent(event, gatts_if, param);
@@ -115,7 +115,7 @@ static void gatt_client_event_handler(
115115
esp_ble_gattc_cb_param_t *param) {
116116

117117
ESP_LOGD(LOG_TAG, "gatt_client_event_handler [esp_gatt_if: %d] ... %s",
118-
gattc_if, bt_utils_gatt_client_event_type_to_string(event).c_str());
118+
gattc_if, BLEUtils::gattClientEventTypeToString(event).c_str());
119119
BLEUtils::dumpGattClientEvent(event, gattc_if, param);
120120

121121
switch(event) {
@@ -352,11 +352,6 @@ void BLE::initClient() {
352352
return;
353353
}
354354

355-
errRc = esp_ble_gattc_app_register(0);
356-
if (errRc != ESP_OK) {
357-
ESP_LOGE(LOG_TAG, "esp_ble_gattc_app_register: rc=%d %s", errRc, GeneralUtils::errorToString(errRc));
358-
return;
359-
}
360355
g_eventGroup = xEventGroupCreate();
361356
xEventGroupClearBits(g_eventGroup, 0xff);
362357
} // init

cpp_utils/BLE2902.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* See also:
1010
* https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
1111
*/
12+
#include "sdkconfig.h"
13+
#if defined(CONFIG_BT_ENABLED)
14+
1215
#include "BLE2902.h"
1316

1417
BLE2902::BLE2902() : BLEDescriptor(BLEUUID((uint16_t) 0x2902)) {
@@ -45,3 +48,4 @@ void BLE2902::setIndications(bool flag) {
4548
pValue[0] &= ~(1<<1);
4649
}
4750
} // setIndications
51+
#endif

cpp_utils/BLE2902.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#ifndef COMPONENTS_CPP_UTILS_BLE2902_H_
99
#define COMPONENTS_CPP_UTILS_BLE2902_H_
10+
#include "sdkconfig.h"
11+
#if defined(CONFIG_BT_ENABLED)
1012

1113
#include "BLEDescriptor.h"
1214

@@ -27,4 +29,5 @@ class BLE2902: public BLEDescriptor {
2729
void setIndications(bool flag);
2830
}; // BLE2902
2931

32+
#endif /* CONFIG_BT_ENABLED */
3033
#endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */

cpp_utils/BLEAddress.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Created on: Jul 2, 2017
55
* Author: kolban
66
*/
7+
#include "sdkconfig.h"
8+
#if defined(CONFIG_BT_ENABLED)
79

810
#include "BLEAddress.h"
911
#include <string>
@@ -75,3 +77,4 @@ std::string BLEAddress::toString() {
7577
esp_bd_addr_t *BLEAddress::getNative() {
7678
return &m_address;
7779
} // getNative
80+
#endif

cpp_utils/BLEAddress.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_
99
#define COMPONENTS_CPP_UTILS_BLEADDRESS_H_
10+
#include "sdkconfig.h"
11+
#if defined(CONFIG_BT_ENABLED)
1012
#include <esp_gap_ble_api.h> // ESP32 BLE
1113
#include <string>
1214

@@ -22,4 +24,5 @@ class BLEAddress {
2224
esp_bd_addr_t m_address;
2325
};
2426

27+
#endif /* CONFIG_BT_ENABLED */
2528
#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */

cpp_utils/BLEAdvertisedDevice.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Created on: Jul 3, 2017
1212
* Author: kolban
1313
*/
14+
#include "sdkconfig.h"
15+
#if defined(CONFIG_BT_ENABLED)
1416
#include <esp_log.h>
1517
#include <sstream>
1618
#include "BLEAdvertisedDevice.h"
@@ -362,6 +364,5 @@ std::string BLEAdvertisedDevice::toString() {
362364
return ss.str();
363365
} // toString
364366

365-
366-
367+
#endif /* CONFIG_BT_ENABLED */
367368

cpp_utils/BLEAdvertisedDevice.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_
99
#define COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_
10+
#include "sdkconfig.h"
11+
#if defined(CONFIG_BT_ENABLED)
1012
#include "BLEAddress.h"
1113
#include "BLEScan.h"
1214
#include "BLEUUID.h"
@@ -69,4 +71,5 @@ class BLEAdvertisedDevice {
6971
BLEScan *m_pScan;
7072
};
7173

74+
#endif /* CONFIG_BT_ENABLED */
7275
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */

cpp_utils/BLEAdvertisedDeviceCallbacks.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Created on: Jul 3, 2017
55
* Author: kolban
66
*/
7+
#include "sdkconfig.h"
8+
#if defined(CONFIG_BT_ENABLED)
79

810
#include "BLEAdvertisedDeviceCallbacks.h"
911

@@ -12,3 +14,4 @@ BLEAdvertisedDeviceCallbacks::BLEAdvertisedDeviceCallbacks() {
1214

1315
BLEAdvertisedDeviceCallbacks::~BLEAdvertisedDeviceCallbacks() {
1416
}
17+
#endif /* CONFIG_BT_ENABLED */

cpp_utils/BLEAdvertisedDeviceCallbacks.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICECALLBACKS_H_
99
#define COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICECALLBACKS_H_
10+
#include "sdkconfig.h"
11+
#if defined(CONFIG_BT_ENABLED)
1012
#include "BLEAdvertisedDevice.h"
1113
class BLEAdvertisedDevice;
1214

@@ -16,5 +18,5 @@ class BLEAdvertisedDeviceCallbacks {
1618
virtual ~BLEAdvertisedDeviceCallbacks();
1719
virtual void onResult(BLEAdvertisedDevice *pAdvertisedDevice) = 0;
1820
};
19-
21+
#endif /* CONFIG_BT_ENABLED */
2022
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICECALLBACKS_H_ */

cpp_utils/BLEAdvertising.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* Created on: Jun 21, 2017
66
* Author: kolban
77
*/
8-
8+
#include "sdkconfig.h"
9+
#if defined(CONFIG_BT_ENABLED)
910
#include "BLEAdvertising.h"
1011
#include <esp_log.h>
1112
#include <esp_err.h>
@@ -138,3 +139,4 @@ void BLEAdvertising::stop() {
138139
return;
139140
}
140141
} // stop
142+
#endif /* CONFIG_BT_ENABLED */

0 commit comments

Comments
 (0)
0