RE: Change check for BT_ENABLE to really be a check for BLUEDROID_ENABLED (#4497)

* Change check for CONFIG_BT_ENABLE to really be a check for CONFIG_BLUEDROID_ENABLED

Which is really what should have been tested.  This allows use of
the Arduino layer with the newer Nimble stack for those that don't want
to use Bluedroid.

In support of https://github.com/meshtastic/Meshtastic-device/issues/266

* Change check for CONFIG_BT_ENABLE to really be a check for CONFIG_BLUEDROID_ENABLED

Which is really what should have been tested.  This allows use of
the Arduino layer with the newer Nimble stack for those that don't want
to use Bluedroid.

In support of https://github.com/meshtastic/Meshtastic-device/issues/266

* wifi prov changes

* merge fixes

Co-authored-by: geeksville <kevinh@geeksville.com>
This commit is contained in:
Me No Dev
2020-11-06 14:00:06 +02:00
committed by GitHub
parent 8767419289
commit 591c43880a
48 changed files with 95 additions and 96 deletions

View File

@ -10,7 +10,7 @@
* https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLE2902.h" #include "BLE2902.h"

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLE2902_H_ #ifndef COMPONENTS_CPP_UTILS_BLE2902_H_
#define COMPONENTS_CPP_UTILS_BLE2902_H_ #define COMPONENTS_CPP_UTILS_BLE2902_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEDescriptor.h" #include "BLEDescriptor.h"
@ -30,5 +30,5 @@ public:
}; // BLE2902 }; // BLE2902
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */

View File

@ -10,7 +10,7 @@
* https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLE2904.h" #include "BLE2904.h"

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLE2904_H_ #ifndef COMPONENTS_CPP_UTILS_BLE2904_H_
#define COMPONENTS_CPP_UTILS_BLE2904_H_ #define COMPONENTS_CPP_UTILS_BLE2904_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEDescriptor.h" #include "BLEDescriptor.h"
@ -70,5 +70,5 @@ private:
BLE2904_Data m_data; BLE2904_Data m_data;
}; // BLE2904 }; // BLE2904
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLE2904_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLE2904_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEAddress.h" #include "BLEAddress.h"
#include <string> #include <string>

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_ #ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_
#define COMPONENTS_CPP_UTILS_BLEADDRESS_H_ #define COMPONENTS_CPP_UTILS_BLEADDRESS_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gap_ble_api.h> // ESP32 BLE #include <esp_gap_ble_api.h> // ESP32 BLE
#include <string> #include <string>
@ -30,5 +30,5 @@ private:
esp_bd_addr_t m_address; esp_bd_addr_t m_address;
}; };
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */

View File

@ -12,7 +12,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include "BLEAdvertisedDevice.h" #include "BLEAdvertisedDevice.h"
#include "BLEUtils.h" #include "BLEUtils.h"
@ -571,5 +571,5 @@ size_t BLEAdvertisedDevice::getPayloadLength() {
return m_payloadLength; return m_payloadLength;
} }
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ #ifndef COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_
#define COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ #define COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gattc_api.h> #include <esp_gattc_api.h>
#include <map> #include <map>
@ -124,5 +124,5 @@ public:
virtual void onResult(BLEAdvertisedDevice advertisedDevice) = 0; virtual void onResult(BLEAdvertisedDevice advertisedDevice) = 0;
}; };
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */

View File

@ -17,7 +17,7 @@
* *
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEAdvertising.h" #include "BLEAdvertising.h"
#include <esp_err.h> #include <esp_err.h>
#include "BLEUtils.h" #include "BLEUtils.h"
@ -525,4 +525,4 @@ void BLEAdvertising::handleGAPEvent(
} }
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ #ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_
#define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ #define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gap_ble_api.h> #include <esp_gap_ble_api.h>
#include "BLEUUID.h" #include "BLEUUID.h"
#include <vector> #include <vector>
@ -77,5 +77,5 @@ private:
bool m_scanResp = true; bool m_scanResp = true;
}; };
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string.h> #include <string.h>
#include "BLEBeacon.h" #include "BLEBeacon.h"
#include "esp32-hal-log.h" #include "esp32-hal-log.h"

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include <string.h> #include <string.h>
#include <iomanip> #include <iomanip>
@ -800,4 +800,4 @@ void BLECharacteristicCallbacks::onStatus(BLECharacteristic* pCharacteristic, St
} // onStatus } // onStatus
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ #ifndef COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_
#define COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ #define COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string> #include <string>
#include <map> #include <map>
#include "BLEUUID.h" #include "BLEUUID.h"
@ -150,5 +150,5 @@ public:
virtual void onNotify(BLECharacteristic* pCharacteristic); virtual void onNotify(BLECharacteristic* pCharacteristic);
virtual void onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code); virtual void onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code);
}; };
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include "BLEService.h" #include "BLEService.h"
@ -131,4 +131,4 @@ std::string BLECharacteristicMap::toString() {
} // toString } // toString
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_bt.h> #include <esp_bt.h>
#include <esp_bt_main.h> #include <esp_bt_main.h>
#include <esp_gap_ble_api.h> #include <esp_gap_ble_api.h>
@ -535,4 +535,4 @@ std::string BLEClient::toString() {
} // toString } // toString
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -9,7 +9,7 @@
#define MAIN_BLEDEVICE_H_ #define MAIN_BLEDEVICE_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gattc_api.h> #include <esp_gattc_api.h>
#include <string.h> #include <string.h>
@ -99,5 +99,5 @@ public:
virtual void onDisconnect(BLEClient *pClient) = 0; virtual void onDisconnect(BLEClient *pClient) = 0;
}; };
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif /* MAIN_BLEDEVICE_H_ */ #endif /* MAIN_BLEDEVICE_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include <string.h> #include <string.h>
#include <iomanip> #include <iomanip>
@ -284,4 +284,4 @@ void BLEDescriptorCallbacks::onWrite(BLEDescriptor* pDescriptor) {
} // onWrite } // onWrite
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ #ifndef COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_
#define COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ #define COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string> #include <string>
#include "BLEUUID.h" #include "BLEUUID.h"
#include "BLECharacteristic.h" #include "BLECharacteristic.h"
@ -73,5 +73,5 @@ public:
virtual void onRead(BLEDescriptor* pDescriptor); virtual void onRead(BLEDescriptor* pDescriptor);
virtual void onWrite(BLEDescriptor* pDescriptor); virtual void onWrite(BLEDescriptor* pDescriptor);
}; };
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include "BLECharacteristic.h" #include "BLECharacteristic.h"
@ -145,4 +145,4 @@ BLEDescriptor* BLEDescriptorMap::getNext() {
m_iterator++; m_iterator++;
return pRet; return pRet;
} // getNext } // getNext
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <freertos/FreeRTOS.h> #include <freertos/FreeRTOS.h>
#include <freertos/event_groups.h> #include <freertos/event_groups.h>
#include <freertos/task.h> #include <freertos/task.h>
@ -669,4 +669,4 @@ void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) {
m_customGattsHandler = handler; m_customGattsHandler = handler;
} }
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -8,7 +8,7 @@
#ifndef MAIN_BLEDevice_H_ #ifndef MAIN_BLEDevice_H_
#define MAIN_BLEDevice_H_ #define MAIN_BLEDevice_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gap_ble_api.h> // ESP32 BLE #include <esp_gap_ble_api.h> // ESP32 BLE
#include <esp_gattc_api.h> // ESP32 BLE #include <esp_gattc_api.h> // ESP32 BLE
#include <map> // Part of C++ STL #include <map> // Part of C++ STL
@ -96,5 +96,5 @@ public:
}; // class BLE }; // class BLE
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif /* MAIN_BLEDevice_H_ */ #endif /* MAIN_BLEDevice_H_ */

View File

@ -10,7 +10,7 @@
* *
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "esp32-hal-log.h" #include "esp32-hal-log.h"

View File

@ -5,7 +5,7 @@
* Author: pcbreflux * Author: pcbreflux
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string.h> #include <string.h>
#include "esp32-hal-log.h" #include "esp32-hal-log.h"
#include "BLEEddystoneURL.h" #include "BLEEddystoneURL.h"

View File

@ -5,7 +5,7 @@
* Author: chegewara * Author: chegewara
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEHIDDevice.h" #include "BLEHIDDevice.h"
#include "BLE2904.h" #include "BLE2904.h"
@ -239,5 +239,5 @@ BLEService* BLEHIDDevice::batteryService() {
return m_batteryService; return m_batteryService;
} }
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -9,7 +9,7 @@
#define _BLEHIDDEVICE_H_ #define _BLEHIDDEVICE_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLECharacteristic.h" #include "BLECharacteristic.h"
#include "BLEService.h" #include "BLEService.h"
@ -71,5 +71,5 @@ private:
BLECharacteristic* m_protocolModeCharacteristic; //0x2a4e BLECharacteristic* m_protocolModeCharacteristic; //0x2a4e
BLECharacteristic* m_batteryLevelCharacteristic; //0x2a19 BLECharacteristic* m_batteryLevelCharacteristic; //0x2a19
}; };
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif /* _BLEHIDDEVICE_H_ */ #endif /* _BLEHIDDEVICE_H_ */

View File

@ -8,7 +8,7 @@
#include "BLERemoteCharacteristic.h" #include "BLERemoteCharacteristic.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gattc_api.h> #include <esp_gattc_api.h>
#include <esp_err.h> #include <esp_err.h>
@ -613,4 +613,4 @@ void BLERemoteCharacteristic::setAuth(esp_gatt_auth_req_t auth) {
m_auth = auth; m_auth = auth;
} }
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ #ifndef COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_
#define COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ #define COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string> #include <string>
@ -83,5 +83,5 @@ private:
// We maintain a map of descriptors owned by this characteristic keyed by a string representation of the UUID. // We maintain a map of descriptors owned by this characteristic keyed by a string representation of the UUID.
std::map<std::string, BLERemoteDescriptor*> m_descriptorMap; std::map<std::string, BLERemoteDescriptor*> m_descriptorMap;
}; // BLERemoteCharacteristic }; // BLERemoteCharacteristic
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include "BLERemoteDescriptor.h" #include "BLERemoteDescriptor.h"
#include "GeneralUtils.h" #include "GeneralUtils.h"
@ -201,4 +201,4 @@ void BLERemoteDescriptor::setAuth(esp_gatt_auth_req_t auth) {
m_auth = auth; m_auth = auth;
} }
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ #ifndef COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_
#define COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ #define COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string> #include <string>
#include <esp_gattc_api.h> #include <esp_gattc_api.h>
@ -54,5 +54,5 @@ private:
}; };
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <sstream> #include <sstream>
#include "BLERemoteService.h" #include "BLERemoteService.h"
@ -359,4 +359,4 @@ std::string BLERemoteService::toString() {
} // toString } // toString
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ #ifndef COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_
#define COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ #define COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <map> #include <map>
@ -81,5 +81,5 @@ private:
uint16_t m_endHandle; // The ending handle of this service. uint16_t m_endHandle; // The ending handle of this service.
}; // BLERemoteService }; // BLERemoteService
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_err.h> #include <esp_err.h>
@ -330,4 +330,4 @@ void BLEScan::clearResults() {
m_scanResults.m_vectorAdvertisedDevices.clear(); m_scanResults.m_vectorAdvertisedDevices.clear();
} }
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLESCAN_H_ #ifndef COMPONENTS_CPP_UTILS_BLESCAN_H_
#define COMPONENTS_CPP_UTILS_BLESCAN_H_ #define COMPONENTS_CPP_UTILS_BLESCAN_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gap_ble_api.h> #include <esp_gap_ble_api.h>
// #include <vector> // #include <vector>
@ -81,5 +81,5 @@ private:
void (*m_scanCompleteCB)(BLEScanResults scanResults); void (*m_scanCompleteCB)(BLEScanResults scanResults);
}; // BLEScan }; // BLEScan
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLESCAN_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLESCAN_H_ */

View File

@ -7,7 +7,7 @@
#include "BLESecurity.h" #include "BLESecurity.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
BLESecurity::BLESecurity() { BLESecurity::BLESecurity() {
} }
@ -112,4 +112,4 @@ char* BLESecurity::esp_key_type_to_str(esp_ble_key_type_t key_type) {
} }
return key_str; return key_str;
} // esp_key_type_to_str } // esp_key_type_to_str
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLESECURITY_H_ #ifndef COMPONENTS_CPP_UTILS_BLESECURITY_H_
#define COMPONENTS_CPP_UTILS_BLESECURITY_H_ #define COMPONENTS_CPP_UTILS_BLESECURITY_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gap_ble_api.h> #include <esp_gap_ble_api.h>
@ -69,5 +69,5 @@ public:
virtual bool onConfirmPIN(uint32_t pin) = 0; virtual bool onConfirmPIN(uint32_t pin) = 0;
}; // BLESecurityCallbacks }; // BLESecurityCallbacks
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif // COMPONENTS_CPP_UTILS_BLESECURITY_H_ #endif // COMPONENTS_CPP_UTILS_BLESECURITY_H_

View File

@ -6,7 +6,7 @@
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_bt.h> #include <esp_bt.h>
#include <esp_bt_main.h> #include <esp_bt_main.h>
#include "GeneralUtils.h" #include "GeneralUtils.h"
@ -423,4 +423,4 @@ void BLEServer::disconnect(uint16_t connId) {
esp_ble_gatts_close(m_gatts_if, connId); esp_ble_gatts_close(m_gatts_if, connId);
} }
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLESERVER_H_ #ifndef COMPONENTS_CPP_UTILS_BLESERVER_H_
#define COMPONENTS_CPP_UTILS_BLESERVER_H_ #define COMPONENTS_CPP_UTILS_BLESERVER_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gatts_api.h> #include <esp_gatts_api.h>
#include <string> #include <string>
@ -137,5 +137,5 @@ public:
}; // BLEServerCallbacks }; // BLEServerCallbacks
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLESERVER_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLESERVER_H_ */

View File

@ -8,7 +8,7 @@
// A service is identified by a UUID. A service is also the container for one or more characteristics. // A service is identified by a UUID. A service is also the container for one or more characteristics.
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_err.h> #include <esp_err.h>
#include <esp_gatts_api.h> #include <esp_gatts_api.h>
@ -410,4 +410,4 @@ BLEServer* BLEService::getServer() {
return m_pServer; return m_pServer;
} // getServer } // getServer
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLESERVICE_H_ #ifndef COMPONENTS_CPP_UTILS_BLESERVICE_H_
#define COMPONENTS_CPP_UTILS_BLESERVICE_H_ #define COMPONENTS_CPP_UTILS_BLESERVICE_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gatts_api.h> #include <esp_gatts_api.h>
@ -93,5 +93,5 @@ private:
}; // BLEService }; // BLEService
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif /* COMPONENTS_CPP_UTILS_BLESERVICE_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLESERVICE_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <stdio.h> #include <stdio.h>
#include <iomanip> #include <iomanip>
#include "BLEService.h" #include "BLEService.h"
@ -134,4 +134,4 @@ int BLEServiceMap::getRegisteredServiceCount(){
return m_handleMap.size(); return m_handleMap.size();
} }
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string.h> #include <string.h>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
@ -383,4 +383,4 @@ std::string BLEUUID::toString() {
return res; return res;
} // toString } // toString
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */

View File

@ -9,7 +9,7 @@
#define COMPONENTS_CPP_UTILS_BLEUUID_H_ #define COMPONENTS_CPP_UTILS_BLEUUID_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#include <string> #include <string>
#if defined(CONFIG_BT_ENABLED) #if CONFIG_BLUEDROID_ENABLED
#include <esp_gatt_defs.h> #include <esp_gatt_defs.h>
/** /**
@ -35,5 +35,5 @@ private:
esp_bt_uuid_t m_uuid; // The underlying UUID structure that this class wraps. esp_bt_uuid_t m_uuid; // The underlying UUID structure that this class wraps.
bool m_valueSet = false; // Is there a value set for this instance. bool m_valueSet = false; // Is there a value set for this instance.
}; // BLEUUID }; // BLEUUID
#endif /* CONFIG_BT_ENABLED */ #endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEAddress.h" #include "BLEAddress.h"
#include "BLEClient.h" #include "BLEClient.h"
#include "BLEUtils.h" #include "BLEUtils.h"
@ -2037,4 +2037,4 @@ const char* BLEUtils::searchEventTypeToString(esp_gap_search_evt_t searchEvt) {
} }
} // searchEventTypeToString } // searchEventTypeToString
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEUTILS_H_ #ifndef COMPONENTS_CPP_UTILS_BLEUTILS_H_
#define COMPONENTS_CPP_UTILS_BLEUTILS_H_ #define COMPONENTS_CPP_UTILS_BLEUTILS_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gattc_api.h> // ESP32 BLE #include <esp_gattc_api.h> // ESP32 BLE
#include <esp_gatts_api.h> // ESP32 BLE #include <esp_gatts_api.h> // ESP32 BLE
#include <esp_gap_ble_api.h> // ESP32 BLE #include <esp_gap_ble_api.h> // ESP32 BLE
@ -59,5 +59,5 @@ public:
static const char* searchEventTypeToString(esp_gap_search_evt_t searchEvt); static const char* searchEventTypeToString(esp_gap_search_evt_t searchEvt);
}; };
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif /* COMPONENTS_CPP_UTILS_BLEUTILS_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEUTILS_H_ */

View File

@ -5,7 +5,7 @@
* Author: kolban * Author: kolban
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLEValue.h" #include "BLEValue.h"
#include "esp32-hal-log.h" #include "esp32-hal-log.h"
@ -127,4 +127,4 @@ void BLEValue::setValue(uint8_t* pData, size_t length) {
} // setValue } // setValue
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED

View File

@ -8,7 +8,7 @@
#ifndef COMPONENTS_CPP_UTILS_BLEVALUE_H_ #ifndef COMPONENTS_CPP_UTILS_BLEVALUE_H_
#define COMPONENTS_CPP_UTILS_BLEVALUE_H_ #define COMPONENTS_CPP_UTILS_BLEVALUE_H_
#include "sdkconfig.h" #include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) #if defined(CONFIG_BLUEDROID_ENABLED)
#include <string> #include <string>
/** /**
@ -35,5 +35,5 @@ private:
std::string m_value; std::string m_value;
}; };
#endif // CONFIG_BT_ENABLED #endif // CONFIG_BLUEDROID_ENABLED
#endif /* COMPONENTS_CPP_UTILS_BLEVALUE_H_ */ #endif /* COMPONENTS_CPP_UTILS_BLEVALUE_H_ */

View File

@ -28,7 +28,7 @@
#include <esp32-hal.h> #include <esp32-hal.h>
#include <nvs_flash.h> #include <nvs_flash.h>
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
#include "wifi_provisioning/scheme_ble.h" #include "wifi_provisioning/scheme_ble.h"
#endif #endif
#include <wifi_provisioning/scheme_softap.h> #include <wifi_provisioning/scheme_softap.h>
@ -86,20 +86,20 @@ void WiFiProvClass :: beginProvision(prov_scheme_t prov_scheme, scheme_handler_t
static char service_name_temp[32]; static char service_name_temp[32];
wifi_prov_mgr_config_t config; wifi_prov_mgr_config_t config;
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
if(prov_scheme == WIFI_PROV_SCHEME_BLE) { if(prov_scheme == WIFI_PROV_SCHEME_BLE) {
config.scheme = wifi_prov_scheme_ble; config.scheme = wifi_prov_scheme_ble;
} else { } else {
#endif #endif
config.scheme = wifi_prov_scheme_softap; config.scheme = wifi_prov_scheme_softap;
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
} }
if(scheme_handler == WIFI_PROV_SCHEME_HANDLER_NONE){ if(scheme_handler == WIFI_PROV_SCHEME_HANDLER_NONE){
#endif #endif
wifi_prov_event_handler_t scheme_event_handler = WIFI_PROV_EVENT_HANDLER_NONE; wifi_prov_event_handler_t scheme_event_handler = WIFI_PROV_EVENT_HANDLER_NONE;
memcpy(&config.scheme_event_handler, &scheme_event_handler, sizeof(wifi_prov_event_handler_t)); memcpy(&config.scheme_event_handler, &scheme_event_handler, sizeof(wifi_prov_event_handler_t));
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
} else if(scheme_handler == WIFI_PROV_SCHEME_HANDLER_FREE_BTDM){ } else if(scheme_handler == WIFI_PROV_SCHEME_HANDLER_FREE_BTDM){
wifi_prov_event_handler_t scheme_event_handler = WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM; wifi_prov_event_handler_t scheme_event_handler = WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM;
memcpy(&config.scheme_event_handler, &scheme_event_handler, sizeof(wifi_prov_event_handler_t)); memcpy(&config.scheme_event_handler, &scheme_event_handler, sizeof(wifi_prov_event_handler_t));
@ -126,7 +126,7 @@ void WiFiProvClass :: beginProvision(prov_scheme_t prov_scheme, scheme_handler_t
return; return;
} }
if(provisioned == false) { if(provisioned == false) {
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
if(prov_scheme == WIFI_PROV_SCHEME_BLE) { if(prov_scheme == WIFI_PROV_SCHEME_BLE) {
service_key = NULL; service_key = NULL;
if(uuid == NULL) { if(uuid == NULL) {
@ -141,7 +141,7 @@ void WiFiProvClass :: beginProvision(prov_scheme_t prov_scheme, scheme_handler_t
service_name = (const char *)service_name_temp; service_name = (const char *)service_name_temp;
} }
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
if(prov_scheme == WIFI_PROV_SCHEME_BLE) { if(prov_scheme == WIFI_PROV_SCHEME_BLE) {
log_i("Starting AP using BLE. service_name : %s, pop : %s",service_name,pop); log_i("Starting AP using BLE. service_name : %s, pop : %s",service_name,pop);
} else { } else {
@ -151,7 +151,7 @@ void WiFiProvClass :: beginProvision(prov_scheme_t prov_scheme, scheme_handler_t
} else { } else {
log_i("Starting provisioning AP using SOFTAP. service_name : %s, password : %s, pop : %s",service_name,service_key,pop); log_i("Starting provisioning AP using SOFTAP. service_name : %s, password : %s, pop : %s",service_name,service_key,pop);
} }
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
} }
#endif #endif

View File

@ -19,11 +19,10 @@
#include "WiFi.h" #include "WiFi.h"
#include "wifi_provisioning/manager.h" #include "wifi_provisioning/manager.h"
//Select the scheme using which you want to provision //Select the scheme using which you want to provision
typedef enum { typedef enum {
WIFI_PROV_SCHEME_SOFTAP, WIFI_PROV_SCHEME_SOFTAP,
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_BLE,
#endif #endif
WIFI_PROV_SCHEME_MAX WIFI_PROV_SCHEME_MAX
@ -31,7 +30,7 @@ typedef enum {
typedef enum { typedef enum {
WIFI_PROV_SCHEME_HANDLER_NONE, WIFI_PROV_SCHEME_HANDLER_NONE,
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_BLUEDROID_ENABLED
WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM,
WIFI_PROV_SCHEME_HANDLER_FREE_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BLE,
WIFI_PROV_SCHEME_HANDLER_FREE_BT, WIFI_PROV_SCHEME_HANDLER_FREE_BT,