esp-nimble-cpp 2.0.2
Loading...
Searching...
No Matches
NimBLEClientCallbacks Class Reference

Callbacks associated with a BLE client. More...

#include <NimBLEClient.h>

Public Member Functions

virtual void onConnect (NimBLEClient *pClient)
 Called after client connects.
 
virtual void onConnectFail (NimBLEClient *pClient, int reason)
 Called when a connection attempt fails.
 
virtual void onDisconnect (NimBLEClient *pClient, int reason)
 Called when disconnected from the server.
 
virtual bool onConnParamsUpdateRequest (NimBLEClient *pClient, const ble_gap_upd_params *params)
 Called when server requests to update the connection parameters.
 
virtual void onPassKeyEntry (NimBLEConnInfo &connInfo)
 Called when server requests a passkey for pairing.
 
virtual void onAuthenticationComplete (NimBLEConnInfo &connInfo)
 Called when the pairing procedure is complete.
 
virtual void onConfirmPasskey (NimBLEConnInfo &connInfo, uint32_t pin)
 Called when using numeric comparision for pairing.
 
virtual void onIdentity (NimBLEConnInfo &connInfo)
 Called when the peer identity address is resolved.
 
virtual void onMTUChange (NimBLEClient *pClient, uint16_t MTU)
 Called when the connection MTU changes.
 
virtual void onPhyUpdate (NimBLEClient *pClient, uint8_t txPhy, uint8_t rxPhy)
 Called when the PHY update procedure is complete.
 

Detailed Description

Callbacks associated with a BLE client.

Member Function Documentation

◆ onAuthenticationComplete()

void NimBLEClientCallbacks::onAuthenticationComplete ( NimBLEConnInfo connInfo)
virtual

Called when the pairing procedure is complete.

Parameters
[in]connInfoA reference to a NimBLEConnInfo instance containing the peer info.
This can be used to check the status of the connection encryption/pairing.

◆ onConfirmPasskey()

void NimBLEClientCallbacks::onConfirmPasskey ( NimBLEConnInfo connInfo,
uint32_t  pin 
)
virtual

Called when using numeric comparision for pairing.

Parameters
[in]connInfoA reference to a NimBLEConnInfo instance containing the peer info.
[in]pinThe pin to compare with the server.

◆ onConnect()

void NimBLEClientCallbacks::onConnect ( NimBLEClient pClient)
virtual

Called after client connects.

Parameters
[in]pClientA pointer to the connecting client object.

◆ onConnectFail()

void NimBLEClientCallbacks::onConnectFail ( NimBLEClient pClient,
int  reason 
)
virtual

Called when a connection attempt fails.

Parameters
[in]pClientA pointer to the connecting client object.
[in]reasonContains the reason code for the connection failure.

◆ onConnParamsUpdateRequest()

bool NimBLEClientCallbacks::onConnParamsUpdateRequest ( NimBLEClient pClient,
const ble_gap_upd_params *  params 
)
virtual

Called when server requests to update the connection parameters.

Parameters
[in]pClientA pointer to the calling client object.
[in]paramsA pointer to the struct containing the connection parameters requested.
Returns
True to accept the parameters.

◆ onDisconnect()

void NimBLEClientCallbacks::onDisconnect ( NimBLEClient pClient,
int  reason 
)
virtual

Called when disconnected from the server.

Parameters
[in]pClientA pointer to the calling client object.
[in]reasonContains the reason code for the disconnection.

◆ onIdentity()

void NimBLEClientCallbacks::onIdentity ( NimBLEConnInfo connInfo)
virtual

Called when the peer identity address is resolved.

Parameters
[in]connInfoA reference to a NimBLEConnInfo instance with information

◆ onMTUChange()

void NimBLEClientCallbacks::onMTUChange ( NimBLEClient pClient,
uint16_t  MTU 
)
virtual

Called when the connection MTU changes.

Parameters
[in]pClientA pointer to the client that the MTU change is associated with.
[in]MTUThe new MTU value. about the peer connection parameters.

◆ onPassKeyEntry()

void NimBLEClientCallbacks::onPassKeyEntry ( NimBLEConnInfo connInfo)
virtual

Called when server requests a passkey for pairing.

Parameters
[in]connInfoA reference to a NimBLEConnInfo instance containing the peer info.

◆ onPhyUpdate()

void NimBLEClientCallbacks::onPhyUpdate ( NimBLEClient pClient,
uint8_t  txPhy,
uint8_t  rxPhy 
)
virtual

Called when the PHY update procedure is complete.

Parameters
[in]pClientA pointer to the client whose PHY was updated. about the peer connection parameters.
[in]txPhyThe transmit PHY.
[in]rxPhyThe receive PHY. Possible values:
  • BLE_GAP_LE_PHY_1M
  • BLE_GAP_LE_PHY_2M
  • BLE_GAP_LE_PHY_CODED