Sentinel
Loading...
Searching...
No Matches
BluetoothClient Class Reference

Class to handle Bluetooth client operations. More...

#include <bluetooth.h>

Inheritance diagram for BluetoothClient:

Public Member Functions

 BluetoothClient ()
 Construct a new Bluetooth Client object.
 
void begin ()
 Initialize the Bluetooth client.
 
void loop ()
 Loop function for the Bluetooth client.
 
uint8_t getHeartRate () const
 Get the heart rate value.
 
void onConnect (NimBLEClient *pClient) override
 Callback function for when the client connects to a device.
 
void onDisconnect (NimBLEClient *pClient, int reason) override
 Callback function for when the client disconnects from a device.
 
void setConnectFlag (const NimBLEAdvertisedDevice *device)
 Set the connect flag for the Bluetooth client.
 

Detailed Description

Class to handle Bluetooth client operations.

Member Function Documentation

◆ begin()

void BluetoothClient::begin ( )

Initialize the Bluetooth client.

This function initializes the Bluetooth client and starts scanning for devices.

◆ getHeartRate()

uint8_t BluetoothClient::getHeartRate ( ) const

Get the heart rate value.

Returns
uint8_t The heart rate value

This function returns the current heart rate value.

◆ loop()

void BluetoothClient::loop ( )

Loop function for the Bluetooth client.

This function checks if a connection is needed and handles the connection process.

◆ onConnect()

void BluetoothClient::onConnect ( NimBLEClient * pClient)
override

Callback function for when the client connects to a device.

Parameters
pClientThe connected client

This function is called when the client successfully connects to a device.

◆ onDisconnect()

void BluetoothClient::onDisconnect ( NimBLEClient * pClient,
int reason )
override

Callback function for when the client disconnects from a device.

Parameters
pClientThe disconnected client
reasonThe reason for disconnection

This function is called when the client disconnects from a device.

◆ setConnectFlag()

void BluetoothClient::setConnectFlag ( const NimBLEAdvertisedDevice * device)

Set the connect flag for the Bluetooth client.

Parameters
deviceThe advertised device to connect to

This function sets the connect flag and stores the advertised device.


The documentation for this class was generated from the following files: