Skip to content

refactor(BLE): Add NimBLE support #10937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLE2901.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLE2901.h"

Expand Down
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLE2901.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLEDescriptor.h"

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

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLE2901_H_ */
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLE2902.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLE2902.h"

Expand Down
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLE2902.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLEDescriptor.h"

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

}; // BLE2902

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLE2904.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLE2904.h"

Expand Down
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLE2904.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLEDescriptor.h"

Expand Down Expand Up @@ -73,6 +73,6 @@ class BLE2904 : public BLEDescriptor {
BLE2904_Data m_data;
}; // BLE2904

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLE2904_H_ */
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLEAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLEAddress.h"
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <esp_gap_ble_api.h> // ESP32 BLE
#include <string>

Expand All @@ -39,6 +39,6 @@ class BLEAddress {
esp_bd_addr_t m_address;
};

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEAdvertisedDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "soc/soc_caps.h"
#if SOC_BLE_SUPPORTED
#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <sstream>
#include "BLEAdvertisedDevice.h"
#include "BLEUtils.h"
Expand Down Expand Up @@ -595,5 +595,5 @@ size_t BLEAdvertisedDevice::getPayloadLength() {
return m_payloadLength;
}

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEAdvertisedDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <esp_gattc_api.h>

#include <map>
Expand Down Expand Up @@ -147,6 +147,6 @@ class BLEExtAdvertisingCallbacks {
};
#endif // SOC_BLE_50_SUPPORTED

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEAdvertising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include "BLEAdvertising.h"
#include <esp_err.h>
#include "BLEUtils.h"
Expand Down Expand Up @@ -801,5 +801,5 @@ void BLEMultiAdvertising::setDuration(uint8_t instance, int duration, int max_ev

#endif // SOC_BLE_50_SUPPORTED

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEAdvertising.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <esp_gap_ble_api.h>
#include "BLEUUID.h"
#include <vector>
Expand Down Expand Up @@ -112,6 +112,6 @@ class BLEMultiAdvertising {

#endif // SOC_BLE_50_SUPPORTED

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */
2 changes: 1 addition & 1 deletion libraries/BLE/src/BLEBeacon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include "BLEBeacon.h"
#include "esp32-hal-log.h"

Expand Down
4 changes: 4 additions & 0 deletions libraries/BLE/src/BLEBeacon.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include "soc/soc_caps.h"
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include "BLEUUID.h"
/**
* @brief Representation of a beacon.
Expand Down Expand Up @@ -44,5 +47,6 @@ class BLEBeacon {
void setSignalPower(int8_t signalPower);
}; // BLEBeacon

#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEBEACON_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLECharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <sstream>
#include <string.h>
#include <iomanip>
Expand Down Expand Up @@ -795,5 +795,5 @@ void BLECharacteristicCallbacks::onStatus(BLECharacteristic *pCharacteristic, St
log_d("<< onStatus");
} // onStatus

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLECharacteristic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <string>
#include <map>
#include "BLEUUID.h"
Expand Down Expand Up @@ -184,6 +184,6 @@ class BLECharacteristicCallbacks {
virtual void onStatus(BLECharacteristic *pCharacteristic, Status s, uint32_t code);
};

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLECharacteristicMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <sstream>
#include <iomanip>
#include "BLEService.h"
Expand Down Expand Up @@ -130,5 +130,5 @@ String BLECharacteristicMap::toString() {
return res;
} // toString

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <esp_bt.h>
#include <esp_bt_main.h>
#include <esp_gap_ble_api.h>
Expand Down Expand Up @@ -582,5 +582,5 @@ String BLEClient::toString() {
return res;
} // toString

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)

#include <esp_gattc_api.h>
#include <string.h>
Expand Down Expand Up @@ -98,6 +98,6 @@ class BLEClientCallbacks {
virtual void onDisconnect(BLEClient *pClient) = 0;
};

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* MAIN_BLEDEVICE_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <sstream>
#include <string.h>
#include <iomanip>
Expand Down Expand Up @@ -268,5 +268,5 @@ void BLEDescriptorCallbacks::onWrite(BLEDescriptor *pDescriptor) {
log_d("BLEDescriptorCallbacks", "<< onWrite");
} // onWrite

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <string>
#include "BLEUUID.h"
#include "BLECharacteristic.h"
Expand Down Expand Up @@ -73,6 +73,6 @@ class BLEDescriptorCallbacks {
virtual void onWrite(BLEDescriptor *pDescriptor);
};

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEDescriptorMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <sstream>
#include <iomanip>
#include "BLECharacteristic.h"
Expand Down Expand Up @@ -142,5 +142,5 @@ BLEDescriptor *BLEDescriptorMap::getNext() {
return pRet;
} // getNext

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <freertos/FreeRTOS.h>
#include <freertos/event_groups.h>
#include <freertos/task.h>
Expand Down Expand Up @@ -650,5 +650,5 @@ void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) {
m_customGattsHandler = handler;
}

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <esp_gap_ble_api.h> // ESP32 BLE
#include <esp_gattc_api.h> // ESP32 BLE
#include <map> // Part of C++ STL
Expand Down Expand Up @@ -93,6 +93,6 @@ class BLEDevice {

}; // class BLE

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* MAIN_BLEDevice_H_ */
4 changes: 2 additions & 2 deletions libraries/BLE/src/BLEEddystoneTLM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if SOC_BLE_SUPPORTED

#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#if defined(CONFIG_BLUEDROID_ENABLED) || defined(CONFIG_NIMBLE_ENABLED)
#include <string.h>
#include <stdio.h>
#include "esp32-hal-log.h"
Expand Down Expand Up @@ -176,5 +176,5 @@ void BLEEddystoneTLM::setTime(uint32_t tmil) {
m_eddystoneData.tmil = tmil;
} // setTime

#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
Loading
Loading