forked from h2zero/esp-nimble-cpp
[BREAKING] Refactor NimBLEDevice
* General code cleanup
* `NimBLEDevice::getInitialized` renamed to `NimBLEDevice::isInitialized`.
* `NimBLEDevice::setPower` no longer takes the `esp_power_level_t` and `esp_ble_power_type_t`, instead only an integer value in dbm units is accepted.
* `NimBLEDevice::setPower` now returns a bool value, true = success.
* `NimBLEDevice::setMTU` now returns a bool value, true = success.
* `NimBLEDevice::injectConfirmPIN` renamed to `NimBLEDevice::injectConfirmPasskey` to use Bluetooth naming.
* Fixes crash if `NimBLEDevice::deinit` is called when the stack has not been initialized.
* Reverts 73f0277 as it would cause a crash when the NimBLEServer instance has a connection.
* `NimBLEDevice::getAddress` will now return the address currently in use.
* `NimBLEDevice::init` now returns a bool with `true` indicating success.
* `NimBLEDevice::deinit` now returns a bool with `true` inidicating success.
* `NimBLEDevice::setDeviceName` now returns a bool with `true` indicating success.
* `NimBLEDevice::setCustomGapHandler` now returns a bool with `true` indicating success.
* `NimBLEDevice::setOwnAddrType` now returns a bool with `true` indicating success.
* `NimBLEDevice::setOwnAddrType` will now correctly apply the provided address type for all devices.
* `NimBLEDevice::setOwnAddrType` no longer takes a `bool nrpa` parameter.
This commit is contained in:
1 parent
877a29a8b1
commit
a2fe5b4780
13 files changed
+800
-796
No files matched your search
+209
-190
@@ -12,241 +12,260 @@
|
||||
* Author: kolban
|
||||
*/
|
||||
|
||||
#ifndef MAIN_NIMBLEDEVICE_H_
|
||||
#define MAIN_NIMBLEDEVICE_H_
|
||||
#ifndef NIMBLE_CPP_DEVICE_H_
|
||||
#define NIMBLE_CPP_DEVICE_H_
|
||||
|
||||
#include "nimconfig.h"
|
||||
#if defined(CONFIG_BT_ENABLED)
|
||||
# ifdef ESP_PLATFORM
|
||||
# include <esp_bt.h>
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
#include "NimBLEScan.h"
|
||||
#endif
|
||||
# if defined(CONFIG_NIMBLE_CPP_IDF)
|
||||
# include <host/ble_gap.h>
|
||||
# else
|
||||
# include <nimble/nimble/host/include/host/ble_gap.h>
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
# include "NimBLEExtAdvertising.h"
|
||||
# else
|
||||
# include "NimBLEAdvertising.h"
|
||||
# endif
|
||||
#endif
|
||||
/**** FIX COMPILATION ****/
|
||||
# undef min
|
||||
# undef max
|
||||
/**************************/
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
# include <string>
|
||||
# include <vector>
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
# include <array>
|
||||
class NimBLEClient;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
#include "NimBLEServer.h"
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
class NimBLEScan;
|
||||
# endif
|
||||
|
||||
#include "NimBLEUtils.h"
|
||||
#include "NimBLEAddress.h"
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
class NimBLEExtAdvertising;
|
||||
# else
|
||||
class NimBLEAdvertising;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32P4
|
||||
# include "esp_bt.h"
|
||||
#endif
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
class NimBLEServer;
|
||||
# endif
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) || defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
class NimBLEConnInfo;
|
||||
# endif
|
||||
|
||||
#define BLEDevice NimBLEDevice
|
||||
#define BLEClient NimBLEClient
|
||||
#define BLERemoteService NimBLERemoteService
|
||||
#define BLERemoteCharacteristic NimBLERemoteCharacteristic
|
||||
#define BLERemoteDescriptor NimBLERemoteDescriptor
|
||||
#define BLEAdvertisedDevice NimBLEAdvertisedDevice
|
||||
#define BLEScan NimBLEScan
|
||||
#define BLEUUID NimBLEUUID
|
||||
#define BLESecurity NimBLESecurity
|
||||
#define BLESecurityCallbacks NimBLESecurityCallbacks
|
||||
#define BLEAddress NimBLEAddress
|
||||
#define BLEUtils NimBLEUtils
|
||||
#define BLEClientCallbacks NimBLEClientCallbacks
|
||||
#define BLEAdvertisedDeviceCallbacks NimBLEScanCallbacks
|
||||
#define BLEScanResults NimBLEScanResults
|
||||
#define BLEServer NimBLEServer
|
||||
#define BLEService NimBLEService
|
||||
#define BLECharacteristic NimBLECharacteristic
|
||||
#define BLEAdvertising NimBLEAdvertising
|
||||
#define BLEServerCallbacks NimBLEServerCallbacks
|
||||
#define BLECharacteristicCallbacks NimBLECharacteristicCallbacks
|
||||
#define BLEAdvertisementData NimBLEAdvertisementData
|
||||
#define BLEDescriptor NimBLEDescriptor
|
||||
#define BLE2902 NimBLE2902
|
||||
#define BLE2904 NimBLE2904
|
||||
#define BLEDescriptorCallbacks NimBLEDescriptorCallbacks
|
||||
#define BLEBeacon NimBLEBeacon
|
||||
#define BLEEddystoneTLM NimBLEEddystoneTLM
|
||||
#define BLEEddystoneURL NimBLEEddystoneURL
|
||||
#define BLEConnInfo NimBLEConnInfo
|
||||
class NimBLEAddress;
|
||||
|
||||
#ifdef CONFIG_BT_NIMBLE_MAX_CONNECTIONS
|
||||
#define NIMBLE_MAX_CONNECTIONS CONFIG_BT_NIMBLE_MAX_CONNECTIONS
|
||||
#else
|
||||
#define NIMBLE_MAX_CONNECTIONS CONFIG_NIMBLE_MAX_CONNECTIONS
|
||||
#endif
|
||||
# define BLEDevice NimBLEDevice
|
||||
# define BLEClient NimBLEClient
|
||||
# define BLERemoteService NimBLERemoteService
|
||||
# define BLERemoteCharacteristic NimBLERemoteCharacteristic
|
||||
# define BLERemoteDescriptor NimBLERemoteDescriptor
|
||||
# define BLEAdvertisedDevice NimBLEAdvertisedDevice
|
||||
# define BLEScan NimBLEScan
|
||||
# define BLEUUID NimBLEUUID
|
||||
# define BLEAddress NimBLEAddress
|
||||
# define BLEUtils NimBLEUtils
|
||||
# define BLEClientCallbacks NimBLEClientCallbacks
|
||||
# define BLEAdvertisedDeviceCallbacks NimBLEScanCallbacks
|
||||
# define BLEScanResults NimBLEScanResults
|
||||
# define BLEServer NimBLEServer
|
||||
# define BLEService NimBLEService
|
||||
# define BLECharacteristic NimBLECharacteristic
|
||||
# define BLEAdvertising NimBLEAdvertising
|
||||
# define BLEServerCallbacks NimBLEServerCallbacks
|
||||
# define BLECharacteristicCallbacks NimBLECharacteristicCallbacks
|
||||
# define BLEAdvertisementData NimBLEAdvertisementData
|
||||
# define BLEDescriptor NimBLEDescriptor
|
||||
# define BLE2904 NimBLE2904
|
||||
# define BLEDescriptorCallbacks NimBLEDescriptorCallbacks
|
||||
# define BLEBeacon NimBLEBeacon
|
||||
# define BLEEddystoneTLM NimBLEEddystoneTLM
|
||||
# define BLEEddystoneURL NimBLEEddystoneURL
|
||||
# define BLEConnInfo NimBLEConnInfo
|
||||
|
||||
typedef int (*gap_event_handler)(ble_gap_event *event, void *arg);
|
||||
# ifdef CONFIG_BT_NIMBLE_MAX_CONNECTIONS
|
||||
# define NIMBLE_MAX_CONNECTIONS CONFIG_BT_NIMBLE_MAX_CONNECTIONS
|
||||
# else
|
||||
# define NIMBLE_MAX_CONNECTIONS CONFIG_NIMBLE_MAX_CONNECTIONS
|
||||
# endif
|
||||
|
||||
extern "C" void ble_store_config_init(void);
|
||||
typedef int (*gap_event_handler)(ble_gap_event* event, void* arg);
|
||||
|
||||
/**
|
||||
* @brief A model of a %BLE Device from which all the BLE roles are created.
|
||||
* @brief A model of a BLE Device from which all the BLE roles are created.
|
||||
*/
|
||||
class NimBLEDevice {
|
||||
public:
|
||||
static void init(const std::string &deviceName);
|
||||
static void deinit(bool clearAll = false);
|
||||
static void setDeviceName(const std::string &deviceName);
|
||||
static bool getInitialized();
|
||||
static NimBLEAddress getAddress();
|
||||
static std::string toString();
|
||||
static bool whiteListAdd(const NimBLEAddress & address);
|
||||
static bool whiteListRemove(const NimBLEAddress & address);
|
||||
static bool onWhiteList(const NimBLEAddress & address);
|
||||
static size_t getWhiteListCount();
|
||||
static NimBLEAddress getWhiteListAddress(size_t index);
|
||||
public:
|
||||
static bool init(const std::string& deviceName);
|
||||
static bool deinit(bool clearAll = false);
|
||||
static bool setDeviceName(const std::string& deviceName);
|
||||
static bool isInitialized();
|
||||
static NimBLEAddress getAddress();
|
||||
static std::string toString();
|
||||
static bool whiteListAdd(const NimBLEAddress& address);
|
||||
static bool whiteListRemove(const NimBLEAddress& address);
|
||||
static bool onWhiteList(const NimBLEAddress& address);
|
||||
static size_t getWhiteListCount();
|
||||
static NimBLEAddress getWhiteListAddress(size_t index);
|
||||
static bool setPower(int8_t dbm);
|
||||
static int getPower();
|
||||
static bool setOwnAddrType(uint8_t type);
|
||||
static void setScanDuplicateCacheSize(uint16_t cacheSize);
|
||||
static void setScanFilterMode(uint8_t type);
|
||||
static bool setCustomGapHandler(gap_event_handler handler);
|
||||
static void setSecurityAuth(bool bonding, bool mitm, bool sc);
|
||||
static void setSecurityAuth(uint8_t auth);
|
||||
static void setSecurityIOCap(uint8_t iocap);
|
||||
static void setSecurityInitKey(uint8_t initKey);
|
||||
static void setSecurityRespKey(uint8_t respKey);
|
||||
static void setSecurityPasskey(uint32_t passKey);
|
||||
static uint32_t getSecurityPasskey();
|
||||
static bool startSecurity(uint16_t connHandle);
|
||||
static bool setMTU(uint16_t mtu);
|
||||
static uint16_t getMTU();
|
||||
static bool isIgnored(const NimBLEAddress& address);
|
||||
static void addIgnored(const NimBLEAddress& address);
|
||||
static void removeIgnored(const NimBLEAddress& address);
|
||||
static void onReset(int reason);
|
||||
static void onSync(void);
|
||||
static void host_task(void* param);
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
static NimBLEScan* getScan();
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
static NimBLEScan* getScan();
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
static NimBLEServer* createServer();
|
||||
static NimBLEServer* getServer();
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
static NimBLEServer* createServer();
|
||||
static NimBLEServer* getServer();
|
||||
# endif
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32P4
|
||||
static void setPower(esp_power_level_t powerLevel, esp_ble_power_type_t powerType=ESP_BLE_PWR_TYPE_DEFAULT);
|
||||
static int getPower(esp_ble_power_type_t powerType=ESP_BLE_PWR_TYPE_DEFAULT);
|
||||
#endif
|
||||
static void setOwnAddrType(uint8_t own_addr_type, bool useNRPA=false);
|
||||
static void setScanDuplicateCacheSize(uint16_t cacheSize);
|
||||
static void setScanFilterMode(uint8_t type);
|
||||
#else
|
||||
static void setPower(int dbm);
|
||||
static int getPower();
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) || defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
static bool injectConfirmPasskey(const NimBLEConnInfo& peerInfo, bool accept);
|
||||
static bool injectPassKey(const NimBLEConnInfo& peerInfo, uint32_t pin);
|
||||
# endif
|
||||
|
||||
static void setCustomGapHandler(gap_event_handler handler);
|
||||
static void setSecurityAuth(bool bonding, bool mitm, bool sc);
|
||||
static void setSecurityAuth(uint8_t auth_req);
|
||||
static void setSecurityIOCap(uint8_t iocap);
|
||||
static void setSecurityInitKey(uint8_t init_key);
|
||||
static void setSecurityRespKey(uint8_t init_key);
|
||||
static void setSecurityPasskey(uint32_t pin);
|
||||
static uint32_t getSecurityPasskey();
|
||||
static int startSecurity(uint16_t conn_id);
|
||||
static bool injectConfirmPIN(const NimBLEConnInfo& peerInfo, bool accept);
|
||||
static bool injectPassKey(const NimBLEConnInfo& peerInfo, uint32_t pin);
|
||||
static int setMTU(uint16_t mtu);
|
||||
static uint16_t getMTU();
|
||||
static bool isIgnored(const NimBLEAddress &address);
|
||||
static void addIgnored(const NimBLEAddress &address);
|
||||
static void removeIgnored(const NimBLEAddress &address);
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
static NimBLEExtAdvertising* getAdvertising();
|
||||
static bool startAdvertising(uint8_t inst_id,
|
||||
int duration = 0,
|
||||
int max_events = 0);
|
||||
static bool stopAdvertising(uint8_t inst_id);
|
||||
static bool startAdvertising(uint8_t instId, int duration = 0, int maxEvents = 0);
|
||||
static bool stopAdvertising(uint8_t instId);
|
||||
static bool stopAdvertising();
|
||||
# endif
|
||||
# if !CONFIG_BT_NIMBLE_EXT_ADV || defined(_DOXYGEN_)
|
||||
static NimBLEAdvertising* getAdvertising();
|
||||
static bool startAdvertising(uint32_t duration = 0);
|
||||
static bool stopAdvertising();
|
||||
static NimBLEAdvertising* getAdvertising();
|
||||
static bool startAdvertising(uint32_t duration = 0);
|
||||
static bool stopAdvertising();
|
||||
# endif
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
static NimBLEClient* createClient(NimBLEAddress peerAddress = NimBLEAddress{});
|
||||
static bool deleteClient(NimBLEClient* pClient);
|
||||
static NimBLEClient* getClientByID(uint16_t conn_id);
|
||||
static NimBLEClient* getClientByPeerAddress(const NimBLEAddress &peer_addr);
|
||||
static NimBLEClient* getDisconnectedClient();
|
||||
static size_t getCreatedClientCount();
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
static NimBLEClient* createClient();
|
||||
static NimBLEClient* createClient(const NimBLEAddress& peerAddress);
|
||||
static bool deleteClient(NimBLEClient* pClient);
|
||||
static NimBLEClient* getClientByHandle(uint16_t connHandle);
|
||||
static NimBLEClient* getClientByPeerAddress(const NimBLEAddress& peerAddress);
|
||||
static NimBLEClient* getDisconnectedClient();
|
||||
static size_t getCreatedClientCount();
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL) || defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
static bool deleteBond(const NimBLEAddress &address);
|
||||
static int getNumBonds();
|
||||
static bool isBonded(const NimBLEAddress &address);
|
||||
static bool deleteAllBonds();
|
||||
static NimBLEAddress getBondedAddress(int index);
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL) || defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
static bool deleteBond(const NimBLEAddress& address);
|
||||
static int getNumBonds();
|
||||
static bool isBonded(const NimBLEAddress& address);
|
||||
static bool deleteAllBonds();
|
||||
static NimBLEAddress getBondedAddress(int index);
|
||||
# endif
|
||||
|
||||
private:
|
||||
#if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
private:
|
||||
static bool m_synced;
|
||||
static bool m_initialized;
|
||||
static std::vector<NimBLEAddress> m_ignoreList;
|
||||
static uint32_t m_passkey;
|
||||
static ble_gap_event_listener m_listener;
|
||||
static uint8_t m_ownAddrType;
|
||||
static std::vector<NimBLEAddress> m_whiteList;
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
static NimBLEScan* m_pScan;
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
static NimBLEServer* m_pServer;
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
static NimBLEExtAdvertising* m_bleAdvertising;
|
||||
# else
|
||||
static NimBLEAdvertising* m_bleAdvertising;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
static std::array<NimBLEClient*, NIMBLE_MAX_CONNECTIONS> m_pClients;
|
||||
# endif
|
||||
|
||||
# ifdef ESP_PLATFORM
|
||||
# ifdef CONFIG_BTDM_BLE_SCAN_DUPL
|
||||
static uint16_t m_scanDuplicateSize;
|
||||
static uint8_t m_scanFilterMode;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
friend class NimBLEClient;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
friend class NimBLEScan;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
friend class NimBLEServer;
|
||||
friend class NimBLECharacteristic;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
friend class NimBLEAdvertising;
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
friend class NimBLEExtAdvertising;
|
||||
friend class NimBLEExtAdvertisement;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static void onReset(int reason);
|
||||
static void onSync(void);
|
||||
static void host_task(void *param);
|
||||
static bool m_synced;
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
static NimBLEScan* m_pScan;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
static NimBLEServer* m_pServer;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
static NimBLEExtAdvertising* m_bleAdvertising;
|
||||
# else
|
||||
static NimBLEAdvertising* m_bleAdvertising;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static std::vector<NimBLEAddress> m_ignoreList;
|
||||
static uint32_t m_passkey;
|
||||
static ble_gap_event_listener m_listener;
|
||||
static gap_event_handler m_customGapHandler;
|
||||
static uint8_t m_own_addr_type;
|
||||
static std::vector<NimBLEAddress> m_whiteList;
|
||||
#ifdef ESP_PLATFORM
|
||||
# ifdef CONFIG_BTDM_BLE_SCAN_DUPL
|
||||
static uint16_t m_scanDuplicateSize;
|
||||
static uint8_t m_scanFilterMode;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
static std::array<NimBLEClient*, NIMBLE_MAX_CONNECTIONS> m_pClients;
|
||||
#endif
|
||||
# endif
|
||||
};
|
||||
|
||||
#if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
#include "NimBLEClient.h"
|
||||
#include "NimBLERemoteService.h"
|
||||
#include "NimBLERemoteCharacteristic.h"
|
||||
#include "NimBLERemoteDescriptor.h"
|
||||
#endif
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
|
||||
# include "NimBLEClient.h"
|
||||
# include "NimBLERemoteService.h"
|
||||
# include "NimBLERemoteCharacteristic.h"
|
||||
# include "NimBLERemoteDescriptor.h"
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||
# include "NimBLEScan.h"
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
# include "NimBLEServer.h"
|
||||
# include "NimBLEService.h"
|
||||
# include "NimBLECharacteristic.h"
|
||||
# include "NimBLEDescriptor.h"
|
||||
# endif
|
||||
|
||||
# if defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
# include "NimBLEExtAdvertising.h"
|
||||
# else
|
||||
# include "NimBLEAdvertising.h"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif // CONFIG_BT_ENABLED
|
||||
#endif // MAIN_NIMBLEDEVICE_H_
|
||||
#endif // NIMBLE_CPP_DEVICE_H_
|
||||
Reference in new issue
Block a user