forked from espressif/arduino-esp32
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:
@ -10,7 +10,7 @@
|
||||
* https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLE2902.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLE2902_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLE2902_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLEDescriptor.h"
|
||||
|
||||
@ -30,5 +30,5 @@ public:
|
||||
|
||||
}; // BLE2902
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLE2902_H_ */
|
||||
|
@ -10,7 +10,7 @@
|
||||
* https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLE2904.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLE2904_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLE2904_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLEDescriptor.h"
|
||||
|
||||
@ -70,5 +70,5 @@ private:
|
||||
BLE2904_Data m_data;
|
||||
}; // BLE2904
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLE2904_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLEAddress.h"
|
||||
#include <string>
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEADDRESS_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gap_ble_api.h> // ESP32 BLE
|
||||
#include <string>
|
||||
|
||||
@ -30,5 +30,5 @@ private:
|
||||
esp_bd_addr_t m_address;
|
||||
};
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <sstream>
|
||||
#include "BLEAdvertisedDevice.h"
|
||||
#include "BLEUtils.h"
|
||||
@ -571,5 +571,5 @@ size_t BLEAdvertisedDevice::getPayloadLength() {
|
||||
return m_payloadLength;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gattc_api.h>
|
||||
|
||||
#include <map>
|
||||
@ -124,5 +124,5 @@ public:
|
||||
virtual void onResult(BLEAdvertisedDevice advertisedDevice) = 0;
|
||||
};
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISEDDEVICE_H_ */
|
||||
|
@ -17,7 +17,7 @@
|
||||
*
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include "BLEAdvertising.h"
|
||||
#include <esp_err.h>
|
||||
#include "BLEUtils.h"
|
||||
@ -525,4 +525,4 @@ void BLEAdvertising::handleGAPEvent(
|
||||
}
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gap_ble_api.h>
|
||||
#include "BLEUUID.h"
|
||||
#include <vector>
|
||||
@ -77,5 +77,5 @@ private:
|
||||
bool m_scanResp = true;
|
||||
|
||||
};
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string.h>
|
||||
#include "BLEBeacon.h"
|
||||
#include "esp32-hal-log.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
#include <iomanip>
|
||||
@ -800,4 +800,4 @@ void BLECharacteristicCallbacks::onStatus(BLECharacteristic* pCharacteristic, St
|
||||
} // onStatus
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "BLEUUID.h"
|
||||
@ -150,5 +150,5 @@ public:
|
||||
virtual void onNotify(BLECharacteristic* pCharacteristic);
|
||||
virtual void onStatus(BLECharacteristic* pCharacteristic, Status s, uint32_t code);
|
||||
};
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLECHARACTERISTIC_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include "BLEService.h"
|
||||
@ -131,4 +131,4 @@ std::string BLECharacteristicMap::toString() {
|
||||
} // toString
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_bt.h>
|
||||
#include <esp_bt_main.h>
|
||||
#include <esp_gap_ble_api.h>
|
||||
@ -535,4 +535,4 @@ std::string BLEClient::toString() {
|
||||
} // toString
|
||||
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define MAIN_BLEDEVICE_H_
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
#include <string.h>
|
||||
@ -99,5 +99,5 @@ public:
|
||||
virtual void onDisconnect(BLEClient *pClient) = 0;
|
||||
};
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif /* MAIN_BLEDEVICE_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
#include <iomanip>
|
||||
@ -284,4 +284,4 @@ void BLEDescriptorCallbacks::onWrite(BLEDescriptor* pDescriptor) {
|
||||
} // onWrite
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string>
|
||||
#include "BLEUUID.h"
|
||||
#include "BLECharacteristic.h"
|
||||
@ -73,5 +73,5 @@ public:
|
||||
virtual void onRead(BLEDescriptor* pDescriptor);
|
||||
virtual void onWrite(BLEDescriptor* pDescriptor);
|
||||
};
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEDESCRIPTOR_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include "BLECharacteristic.h"
|
||||
@ -145,4 +145,4 @@ BLEDescriptor* BLEDescriptorMap::getNext() {
|
||||
m_iterator++;
|
||||
return pRet;
|
||||
} // getNext
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/event_groups.h>
|
||||
#include <freertos/task.h>
|
||||
@ -669,4 +669,4 @@ void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) {
|
||||
m_customGattsHandler = handler;
|
||||
}
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef MAIN_BLEDevice_H_
|
||||
#define MAIN_BLEDevice_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gap_ble_api.h> // ESP32 BLE
|
||||
#include <esp_gattc_api.h> // ESP32 BLE
|
||||
#include <map> // Part of C++ STL
|
||||
@ -96,5 +96,5 @@ public:
|
||||
|
||||
}; // class BLE
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif /* MAIN_BLEDevice_H_ */
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "esp32-hal-log.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: pcbreflux
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string.h>
|
||||
#include "esp32-hal-log.h"
|
||||
#include "BLEEddystoneURL.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: chegewara
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLEHIDDevice.h"
|
||||
#include "BLE2904.h"
|
||||
@ -239,5 +239,5 @@ BLEService* BLEHIDDevice::batteryService() {
|
||||
return m_batteryService;
|
||||
}
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define _BLEHIDDEVICE_H_
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "BLECharacteristic.h"
|
||||
#include "BLEService.h"
|
||||
@ -71,5 +71,5 @@ private:
|
||||
BLECharacteristic* m_protocolModeCharacteristic; //0x2a4e
|
||||
BLECharacteristic* m_batteryLevelCharacteristic; //0x2a19
|
||||
};
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif /* _BLEHIDDEVICE_H_ */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "BLERemoteCharacteristic.h"
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
#include <esp_err.h>
|
||||
@ -613,4 +613,4 @@ void BLERemoteCharacteristic::setAuth(esp_gatt_auth_req_t auth) {
|
||||
m_auth = auth;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#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.
|
||||
std::map<std::string, BLERemoteDescriptor*> m_descriptorMap;
|
||||
}; // BLERemoteCharacteristic
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEREMOTECHARACTERISTIC_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <sstream>
|
||||
#include "BLERemoteDescriptor.h"
|
||||
#include "GeneralUtils.h"
|
||||
@ -201,4 +201,4 @@ void BLERemoteDescriptor::setAuth(esp_gatt_auth_req_t auth) {
|
||||
m_auth = auth;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string>
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
@ -54,5 +54,5 @@ private:
|
||||
|
||||
|
||||
};
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEREMOTEDESCRIPTOR_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <sstream>
|
||||
#include "BLERemoteService.h"
|
||||
@ -359,4 +359,4 @@ std::string BLERemoteService::toString() {
|
||||
} // toString
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <map>
|
||||
|
||||
@ -81,5 +81,5 @@ private:
|
||||
uint16_t m_endHandle; // The ending handle of this service.
|
||||
}; // BLERemoteService
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEREMOTESERVICE_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
|
||||
#include <esp_err.h>
|
||||
@ -330,4 +330,4 @@ void BLEScan::clearResults() {
|
||||
m_scanResults.m_vectorAdvertisedDevices.clear();
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLESCAN_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLESCAN_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gap_ble_api.h>
|
||||
|
||||
// #include <vector>
|
||||
@ -81,5 +81,5 @@ private:
|
||||
void (*m_scanCompleteCB)(BLEScanResults scanResults);
|
||||
}; // BLEScan
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLESCAN_H_ */
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "BLESecurity.h"
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
BLESecurity::BLESecurity() {
|
||||
}
|
||||
@ -112,4 +112,4 @@ char* BLESecurity::esp_key_type_to_str(esp_ble_key_type_t key_type) {
|
||||
}
|
||||
return key_str;
|
||||
} // esp_key_type_to_str
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLESECURITY_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLESECURITY_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <esp_gap_ble_api.h>
|
||||
|
||||
@ -69,5 +69,5 @@ public:
|
||||
virtual bool onConfirmPIN(uint32_t pin) = 0;
|
||||
}; // BLESecurityCallbacks
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif // COMPONENTS_CPP_UTILS_BLESECURITY_H_
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_bt.h>
|
||||
#include <esp_bt_main.h>
|
||||
#include "GeneralUtils.h"
|
||||
@ -423,4 +423,4 @@ void BLEServer::disconnect(uint16_t connId) {
|
||||
esp_ble_gatts_close(m_gatts_if, connId);
|
||||
}
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLESERVER_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLESERVER_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gatts_api.h>
|
||||
|
||||
#include <string>
|
||||
@ -137,5 +137,5 @@ public:
|
||||
}; // BLEServerCallbacks
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLESERVER_H_ */
|
||||
|
@ -8,7 +8,7 @@
|
||||
// A service is identified by a UUID. A service is also the container for one or more characteristics.
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_err.h>
|
||||
#include <esp_gatts_api.h>
|
||||
|
||||
@ -410,4 +410,4 @@ BLEServer* BLEService::getServer() {
|
||||
return m_pServer;
|
||||
} // getServer
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLESERVICE_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLESERVICE_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <esp_gatts_api.h>
|
||||
|
||||
@ -93,5 +93,5 @@ private:
|
||||
}; // BLEService
|
||||
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLESERVICE_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <stdio.h>
|
||||
#include <iomanip>
|
||||
#include "BLEService.h"
|
||||
@ -134,4 +134,4 @@ int BLEServiceMap::getRegisteredServiceCount(){
|
||||
return m_handleMap.size();
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string.h>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
@ -383,4 +383,4 @@ std::string BLEUUID::toString() {
|
||||
return res;
|
||||
} // toString
|
||||
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define COMPONENTS_CPP_UTILS_BLEUUID_H_
|
||||
#include "sdkconfig.h"
|
||||
#include <string>
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
#include <esp_gatt_defs.h>
|
||||
|
||||
/**
|
||||
@ -35,5 +35,5 @@ private:
|
||||
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.
|
||||
}; // BLEUUID
|
||||
#endif /* CONFIG_BT_ENABLED */
|
||||
#endif /* CONFIG_BLUEDROID_ENABLED */
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include "BLEAddress.h"
|
||||
#include "BLEClient.h"
|
||||
#include "BLEUtils.h"
|
||||
@ -2037,4 +2037,4 @@ const char* BLEUtils::searchEventTypeToString(esp_gap_search_evt_t searchEvt) {
|
||||
}
|
||||
} // searchEventTypeToString
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEUTILS_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEUTILS_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <esp_gattc_api.h> // ESP32 BLE
|
||||
#include <esp_gatts_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);
|
||||
};
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEUTILS_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include "BLEValue.h"
|
||||
#include "esp32-hal-log.h"
|
||||
|
||||
@ -127,4 +127,4 @@ void BLEValue::setValue(uint8_t* pData, size_t length) {
|
||||
} // setValue
|
||||
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef COMPONENTS_CPP_UTILS_BLEVALUE_H_
|
||||
#define COMPONENTS_CPP_UTILS_BLEVALUE_H_
|
||||
#include "sdkconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
#if defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
@ -35,5 +35,5 @@ private:
|
||||
std::string m_value;
|
||||
|
||||
};
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // CONFIG_BLUEDROID_ENABLED
|
||||
#endif /* COMPONENTS_CPP_UTILS_BLEVALUE_H_ */
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <esp32-hal.h>
|
||||
|
||||
#include <nvs_flash.h>
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
#include "wifi_provisioning/scheme_ble.h"
|
||||
#endif
|
||||
#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];
|
||||
|
||||
wifi_prov_mgr_config_t config;
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
if(prov_scheme == WIFI_PROV_SCHEME_BLE) {
|
||||
config.scheme = wifi_prov_scheme_ble;
|
||||
} else {
|
||||
#endif
|
||||
config.scheme = wifi_prov_scheme_softap;
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
}
|
||||
|
||||
if(scheme_handler == WIFI_PROV_SCHEME_HANDLER_NONE){
|
||||
#endif
|
||||
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));
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
} 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;
|
||||
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;
|
||||
}
|
||||
if(provisioned == false) {
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
if(prov_scheme == WIFI_PROV_SCHEME_BLE) {
|
||||
service_key = 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;
|
||||
}
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
if(prov_scheme == WIFI_PROV_SCHEME_BLE) {
|
||||
log_i("Starting AP using BLE. service_name : %s, pop : %s",service_name,pop);
|
||||
} else {
|
||||
@ -151,7 +151,7 @@ void WiFiProvClass :: beginProvision(prov_scheme_t prov_scheme, scheme_handler_t
|
||||
} else {
|
||||
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
|
||||
|
||||
|
@ -19,11 +19,10 @@
|
||||
|
||||
#include "WiFi.h"
|
||||
#include "wifi_provisioning/manager.h"
|
||||
|
||||
//Select the scheme using which you want to provision
|
||||
typedef enum {
|
||||
WIFI_PROV_SCHEME_SOFTAP,
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_BLUEDROID_ENABLED
|
||||
WIFI_PROV_SCHEME_BLE,
|
||||
#endif
|
||||
WIFI_PROV_SCHEME_MAX
|
||||
@ -31,7 +30,7 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
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_BLE,
|
||||
WIFI_PROV_SCHEME_HANDLER_FREE_BT,
|
||||
|
Reference in New Issue
Block a user