esp-nimble-cpp 2.3.3
|
A model of a BLE Device from which all the BLE roles are created. More...
#include <NimBLEDevice.h>
Static Public Member Functions | |
static bool | init (const std::string &deviceName) |
Initialize the BLE environment. | |
static bool | deinit (bool clearAll=false) |
Shutdown the NimBLE stack/controller. | |
static bool | setDeviceName (const std::string &deviceName) |
Set the BLEDevice name. | |
static bool | isInitialized () |
Check if the initialization is complete. | |
static NimBLEAddress | getAddress () |
Get our device address. | |
static std::string | toString () |
Return a string representation of the address of this device. | |
static bool | whiteListAdd (const NimBLEAddress &address) |
Add a peer address to the whitelist. | |
static bool | whiteListRemove (const NimBLEAddress &address) |
Remove a peer address from the whitelist. | |
static bool | onWhiteList (const NimBLEAddress &address) |
Checks if a peer device is whitelisted. | |
static size_t | getWhiteListCount () |
Gets the count of addresses in the whitelist. | |
static NimBLEAddress | getWhiteListAddress (size_t index) |
Gets the address at the vector index. | |
static bool | setOwnAddrType (uint8_t type) |
Sets the address type to use. | |
static bool | setOwnAddr (const NimBLEAddress &addr) |
Set the device address to use. | |
static bool | setOwnAddr (const uint8_t *addr) |
Set the device address to use. | |
static bool | setCustomGapHandler (gap_event_handler handler) |
Set a custom callback for gap events. | |
static void | setSecurityAuth (bool bonding, bool mitm, bool sc) |
Set the authorization mode for this device. | |
static void | setSecurityAuth (uint8_t auth) |
Set the authorization mode for this device. | |
static void | setSecurityIOCap (uint8_t iocap) |
Set the Input/Output capabilities of this device. | |
static void | setSecurityInitKey (uint8_t initKey) |
If we are the initiator of the security procedure this sets the keys we will distribute. | |
static void | setSecurityRespKey (uint8_t respKey) |
Set the keys we are willing to accept during pairing. | |
static void | setSecurityPasskey (uint32_t passKey) |
Set the passkey the server will ask for when pairing. | |
static uint32_t | getSecurityPasskey () |
Get the current passkey used for pairing. | |
static bool | startSecurity (uint16_t connHandle, int *rcPtr=nullptr) |
Start the connection securing and authorization for this connection. | |
static bool | setMTU (uint16_t mtu) |
Setup local mtu that will be used to negotiate mtu during request from client peer. | |
static uint16_t | getMTU () |
Get local MTU value set. | |
static void | onReset (int reason) |
Host reset, we pass the message so we don't make calls until re-synced. | |
static void | onSync (void) |
Host synced with controller, all clear to make calls to the stack. | |
static void | host_task (void *param) |
The main host task. | |
static int | getPower (NimBLETxPowerType type=NimBLETxPowerType::All) |
Get the transmission power. | |
static bool | setPower (int8_t dbm, NimBLETxPowerType type=NimBLETxPowerType::All) |
Retrieve the Scan object that we use for scanning. | |
static bool | setDefaultPhy (uint8_t txPhyMask, uint8_t rxPhyMask) |
Set the preferred default phy to use for connections. | |
A model of a BLE Device from which all the BLE roles are created.
|
static |
Shutdown the NimBLE stack/controller.
[in] | clearAll | If true, deletes all server/advertising/scan/client objects after de-initializing. |
|
static |
Get our device address.
|
static |
Get local MTU value set.
|
static |
Get the transmission power.
|
static |
Get the current passkey used for pairing.
|
static |
Gets the address at the vector index.
[in] | index | The vector index to retrieve the address from. |
|
static |
Gets the count of addresses in the whitelist.
|
static |
Initialize the BLE environment.
[in] | deviceName | The device name of the device. |
|
static |
Check if the initialization is complete.
|
static |
Host reset, we pass the message so we don't make calls until re-synced.
[in] | reason | The reason code for the reset. |
|
static |
Checks if a peer device is whitelisted.
[in] | address | The address to check for in the whitelist. |
|
static |
Set a custom callback for gap events.
[in] | handler | The function to call when gap events occur. |
|
static |
Set the preferred default phy to use for connections.
[in] | txPhyMask | TX PHY. Can be mask of following:
|
[in] | rxPhyMask | RX PHY. Can be mask of following:
|
|
static |
Set the BLEDevice name.
[in] | deviceName | The name to set. |
|
static |
Setup local mtu that will be used to negotiate mtu during request from client peer.
[in] | mtu | Value to set local mtu:
|
|
static |
Set the device address to use.
[in] | addr | The address to set. |
To use the address generated the address type must be set to random with setOwnAddrType
.
|
static |
Set the device address to use.
[in] | addr | The address to set. |
To use the address generated the address type must be set to random with setOwnAddrType
.
|
static |
Sets the address type to use.
[in] | type | Bluetooth Device address type. The available types are defined as:
|
|
static |
Retrieve the Scan object that we use for scanning.
Set the transmission power.
[in] | dbm | The power level to set in dBm. |
|
static |
Set the authorization mode for this device.
bonding | If true we allow bonding, false no bonding will be performed. |
mitm | If true we are capable of man in the middle protection, false if not. |
sc | If true we will perform secure connection pairing, false we will use legacy pairing. |
|
static |
Set the authorization mode for this device.
auth_req | A bitmap indicating what modes are supported. The available bits are defined as:
|
|
static |
If we are the initiator of the security procedure this sets the keys we will distribute.
initKey | A bitmap indicating which keys to distribute during pairing. The available bits are defined as:
|
|
static |
Set the Input/Output capabilities of this device.
iocap | One of the following values:
|
|
static |
Set the passkey the server will ask for when pairing.
[in] | passkey | The passkey to use. |
|
static |
Set the keys we are willing to accept during pairing.
respKey | A bitmap indicating which keys to accept during pairing. The available bits are defined as:
|
|
static |
Start the connection securing and authorization for this connection.
connHandle | The connection handle of the peer device. |
rcPtr | Optional pointer to pass the return code to the caller. |
|
static |
Return a string representation of the address of this device.
|
static |
Add a peer address to the whitelist.
[in] | address | The address to add to the whitelist. |
|
static |
Remove a peer address from the whitelist.
[in] | address | The address to remove from the whitelist. |