Skip to content

Commit 20ddeb0

Browse files
committed
Add guards
1 parent 5ba4c21 commit 20ddeb0

Some content is hidden

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

53 files changed

+102
-358
lines changed

Diff for: libraries/BLE/src/BLE2901.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#if SOC_BLE_SUPPORTED
2020

2121
#include "sdkconfig.h"
22-
#if defined(CONFIG_BLUEDROID_ENABLED)
22+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
2323

2424
#include "BLE2901.h"
2525

Diff for: libraries/BLE/src/BLE2901.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#if SOC_BLE_SUPPORTED
2323

2424
#include "sdkconfig.h"
25-
#if defined(CONFIG_BLUEDROID_ENABLED)
25+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
2626

2727
#include "BLEDescriptor.h"
2828

@@ -32,6 +32,6 @@ class BLE2901 : public BLEDescriptor {
3232
void setDescription(String desc);
3333
}; // BLE2901
3434

35-
#endif /* CONFIG_BLUEDROID_ENABLED */
35+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
3636
#endif /* SOC_BLE_SUPPORTED */
3737
#endif /* COMPONENTS_CPP_UTILS_BLE2901_H_ */

Diff for: libraries/BLE/src/BLE2902.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#if SOC_BLE_SUPPORTED
1414

1515
#include "sdkconfig.h"
16-
#if defined(CONFIG_BLUEDROID_ENABLED)
16+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1717

1818
#include "BLE2902.h"
1919

Diff for: libraries/BLE/src/BLE2902.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515

1616
#include "BLEDescriptor.h"
1717

@@ -33,6 +33,6 @@ class BLE2902 : public BLEDescriptor {
3333

3434
}; // BLE2902
3535

36-
#endif /* CONFIG_BLUEDROID_ENABLED */
36+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
3737
#endif /* SOC_BLE_SUPPORTED */
3838
#endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */

Diff for: libraries/BLE/src/BLE2904.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#if SOC_BLE_SUPPORTED
1414

1515
#include "sdkconfig.h"
16-
#if defined(CONFIG_BLUEDROID_ENABLED)
16+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1717

1818
#include "BLE2904.h"
1919

Diff for: libraries/BLE/src/BLE2904.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515

1616
#include "BLEDescriptor.h"
1717

@@ -73,6 +73,6 @@ class BLE2904 : public BLEDescriptor {
7373
BLE2904_Data m_data;
7474
}; // BLE2904
7575

76-
#endif /* CONFIG_BLUEDROID_ENABLED */
76+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
7777
#endif /* SOC_BLE_SUPPORTED */
7878
#endif /* COMPONENTS_CPP_UTILS_BLE2904_H_ */

Diff for: libraries/BLE/src/BLEAddress.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212

1313
#include "BLEAddress.h"
1414
#include <string>

Diff for: libraries/BLE/src/BLEAddress.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#if SOC_BLE_SUPPORTED
1313

1414
#include "sdkconfig.h"
15-
#if defined(CONFIG_BLUEDROID_ENABLED)
15+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1616
#include <esp_gap_ble_api.h> // ESP32 BLE
1717
#include <string>
1818

@@ -39,6 +39,6 @@ class BLEAddress {
3939
esp_bd_addr_t m_address;
4040
};
4141

42-
#endif /* CONFIG_BLUEDROID_ENABLED */
42+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
4343
#endif /* SOC_BLE_SUPPORTED */
4444
#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */

Diff for: libraries/BLE/src/BLEAdvertisedDevice.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "soc/soc_caps.h"
1515
#if SOC_BLE_SUPPORTED
1616
#include "sdkconfig.h"
17-
#if defined(CONFIG_BLUEDROID_ENABLED)
17+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1818
#include <sstream>
1919
#include "BLEAdvertisedDevice.h"
2020
#include "BLEUtils.h"
@@ -595,5 +595,5 @@ size_t BLEAdvertisedDevice::getPayloadLength() {
595595
return m_payloadLength;
596596
}
597597

598-
#endif /* CONFIG_BLUEDROID_ENABLED */
598+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
599599
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEAdvertisedDevice.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515
#include <esp_gattc_api.h>
1616

1717
#include <map>
@@ -147,6 +147,6 @@ class BLEExtAdvertisingCallbacks {
147147
};
148148
#endif // SOC_BLE_50_SUPPORTED
149149

150-
#endif /* CONFIG_BLUEDROID_ENABLED */
150+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
151151
#endif /* SOC_BLE_SUPPORTED */
152152
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */

Diff for: libraries/BLE/src/BLEAdvertising.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#if SOC_BLE_SUPPORTED
2121

2222
#include "sdkconfig.h"
23-
#if defined(CONFIG_BLUEDROID_ENABLED)
23+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
2424
#include "BLEAdvertising.h"
2525
#include <esp_err.h>
2626
#include "BLEUtils.h"
@@ -801,5 +801,5 @@ void BLEMultiAdvertising::setDuration(uint8_t instance, int duration, int max_ev
801801

802802
#endif // SOC_BLE_50_SUPPORTED
803803

804-
#endif /* CONFIG_BLUEDROID_ENABLED */
804+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
805805
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEAdvertising.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515
#include <esp_gap_ble_api.h>
1616
#include "BLEUUID.h"
1717
#include <vector>
@@ -112,6 +112,6 @@ class BLEMultiAdvertising {
112112

113113
#endif // SOC_BLE_50_SUPPORTED
114114

115-
#endif /* CONFIG_BLUEDROID_ENABLED */
115+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
116116
#endif /* SOC_BLE_SUPPORTED */
117117
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */

Diff for: libraries/BLE/src/BLEBeacon.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include "BLEBeacon.h"
1313
#include "esp32-hal-log.h"
1414

Diff for: libraries/BLE/src/BLEBeacon.h

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "soc/soc_caps.h"
1111
#if SOC_BLE_SUPPORTED
1212

13+
#include "sdkconfig.h"
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
15+
1316
#include "BLEUUID.h"
1417
/**
1518
* @brief Representation of a beacon.
@@ -44,5 +47,6 @@ class BLEBeacon {
4447
void setSignalPower(int8_t signalPower);
4548
}; // BLEBeacon
4649

50+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
4751
#endif /* SOC_BLE_SUPPORTED */
4852
#endif /* COMPONENTS_CPP_UTILS_BLEBEACON_H_ */

Diff for: libraries/BLE/src/BLECharacteristic.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include <sstream>
1313
#include <string.h>
1414
#include <iomanip>
@@ -795,5 +795,5 @@ void BLECharacteristicCallbacks::onStatus(BLECharacteristic *pCharacteristic, St
795795
log_d("<< onStatus");
796796
} // onStatus
797797

798-
#endif /* CONFIG_BLUEDROID_ENABLED */
798+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
799799
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLECharacteristic.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515
#include <string>
1616
#include <map>
1717
#include "BLEUUID.h"
@@ -184,6 +184,6 @@ class BLECharacteristicCallbacks {
184184
virtual void onStatus(BLECharacteristic *pCharacteristic, Status s, uint32_t code);
185185
};
186186

187-
#endif /* CONFIG_BLUEDROID_ENABLED */
187+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
188188
#endif /* SOC_BLE_SUPPORTED */
189189
#endif /* COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ */

Diff for: libraries/BLE/src/BLECharacteristicMap.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include <sstream>
1313
#include <iomanip>
1414
#include "BLEService.h"
@@ -130,5 +130,5 @@ String BLECharacteristicMap::toString() {
130130
return res;
131131
} // toString
132132

133-
#endif /* CONFIG_BLUEDROID_ENABLED */
133+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
134134
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include <esp_bt.h>
1313
#include <esp_bt_main.h>
1414
#include <esp_gap_ble_api.h>
@@ -582,5 +582,5 @@ String BLEClient::toString() {
582582
return res;
583583
} // toString
584584

585-
#endif /* CONFIG_BLUEDROID_ENABLED */
585+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
586586
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEClient.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#if SOC_BLE_SUPPORTED
1313

1414
#include "sdkconfig.h"
15-
#if defined(CONFIG_BLUEDROID_ENABLED)
15+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1616

1717
#include <esp_gattc_api.h>
1818
#include <string.h>
@@ -98,6 +98,6 @@ class BLEClientCallbacks {
9898
virtual void onDisconnect(BLEClient *pClient) = 0;
9999
};
100100

101-
#endif /* CONFIG_BLUEDROID_ENABLED */
101+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
102102
#endif /* SOC_BLE_SUPPORTED */
103103
#endif /* MAIN_BLEDEVICE_H_ */

Diff for: libraries/BLE/src/BLEDescriptor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include <sstream>
1313
#include <string.h>
1414
#include <iomanip>
@@ -268,5 +268,5 @@ void BLEDescriptorCallbacks::onWrite(BLEDescriptor *pDescriptor) {
268268
log_d("BLEDescriptorCallbacks", "<< onWrite");
269269
} // onWrite
270270

271-
#endif /* CONFIG_BLUEDROID_ENABLED */
271+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
272272
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEDescriptor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515
#include <string>
1616
#include "BLEUUID.h"
1717
#include "BLECharacteristic.h"
@@ -73,6 +73,6 @@ class BLEDescriptorCallbacks {
7373
virtual void onWrite(BLEDescriptor *pDescriptor);
7474
};
7575

76-
#endif /* CONFIG_BLUEDROID_ENABLED */
76+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
7777
#endif /* SOC_BLE_SUPPORTED */
7878
#endif /* COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ */

Diff for: libraries/BLE/src/BLEDescriptorMap.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include <sstream>
1313
#include <iomanip>
1414
#include "BLECharacteristic.h"
@@ -142,5 +142,5 @@ BLEDescriptor *BLEDescriptorMap::getNext() {
142142
return pRet;
143143
} // getNext
144144

145-
#endif /* CONFIG_BLUEDROID_ENABLED */
145+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
146146
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEDevice.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BLE_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1212
#include <freertos/FreeRTOS.h>
1313
#include <freertos/event_groups.h>
1414
#include <freertos/task.h>
@@ -650,5 +650,5 @@ void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) {
650650
m_customGattsHandler = handler;
651651
}
652652

653-
#endif /* CONFIG_BLUEDROID_ENABLED */
653+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
654654
#endif /* SOC_BLE_SUPPORTED */

Diff for: libraries/BLE/src/BLEDevice.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#if SOC_BLE_SUPPORTED
1212

1313
#include "sdkconfig.h"
14-
#if defined(CONFIG_BLUEDROID_ENABLED)
14+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1515
#include <esp_gap_ble_api.h> // ESP32 BLE
1616
#include <esp_gattc_api.h> // ESP32 BLE
1717
#include <map> // Part of C++ STL
@@ -93,6 +93,6 @@ class BLEDevice {
9393

9494
}; // class BLE
9595

96-
#endif /* CONFIG_BLUEDROID_ENABLED */
96+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
9797
#endif /* SOC_BLE_SUPPORTED */
9898
#endif /* MAIN_BLEDevice_H_ */

Diff for: libraries/BLE/src/BLEEddystoneTLM.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#if SOC_BLE_SUPPORTED
1414

1515
#include "sdkconfig.h"
16-
#if defined(CONFIG_BLUEDROID_ENABLED)
16+
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
1717
#include <string.h>
1818
#include <stdio.h>
1919
#include "esp32-hal-log.h"
@@ -176,5 +176,5 @@ void BLEEddystoneTLM::setTime(uint32_t tmil) {
176176
m_eddystoneData.tmil = tmil;
177177
} // setTime
178178

179-
#endif /* CONFIG_BLUEDROID_ENABLED */
179+
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
180180
#endif /* SOC_BLE_SUPPORTED */

0 commit comments

Comments
 (0)