ESP_IOT v2.5
IOT ESP Coding
BLEServerNetworking.h File Reference
#include "../../Defines.h"
Include dependency graph for BLEServerNetworking.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BLE_SERVER_CALLBACK_ONREAD   0
 
#define BLE_SERVER_CALLBACK_ONWRITE   1
 
#define BLE_SERVER_CALLBACK_STATUS_MESSAGE   2
 used to send a string message back (which might be sent to MQTT for example) More...
 
#define BLE_SERVER_MAX_CALLBACKS   3
 

Functions

void setup_BLEServerNetworking (char *serviceName, char *deviceName, char *serviceUUID, char *characteristicUUID)
 the 'setup' for this module BLEServerNetworking. Here the service name is added (and potentially more later) More...
 
void loop_BLEServerNetworking ()
 the 'setup' for this module BLEServerNetworking. Here the service name is added (and potentially more later) More...
 
void setBLEServerDeviceName (char *deviceName)
 sets the device name More...
 
void sendBLEMessageACKMessage ()
 send something over bluetooth, this right now is 0x01 More...
 
char * getServiceName_BLEServerNetworking ()
 retrieve the service name (PTFEEDER, PTFeeder:Name, PTClicker:Name, etc) More...
 

Macro Definition Documentation

◆ BLE_SERVER_CALLBACK_ONREAD

#define BLE_SERVER_CALLBACK_ONREAD   0

Definition at line 25 of file BLEServerNetworking.h.

◆ BLE_SERVER_CALLBACK_ONWRITE

#define BLE_SERVER_CALLBACK_ONWRITE   1

Definition at line 26 of file BLEServerNetworking.h.

◆ BLE_SERVER_CALLBACK_STATUS_MESSAGE

#define BLE_SERVER_CALLBACK_STATUS_MESSAGE   2

used to send a string message back (which might be sent to MQTT for example)

Definition at line 28 of file BLEServerNetworking.h.

◆ BLE_SERVER_MAX_CALLBACKS

#define BLE_SERVER_MAX_CALLBACKS   3

Definition at line 29 of file BLEServerNetworking.h.

Function Documentation

◆ getServiceName_BLEServerNetworking()

char * getServiceName_BLEServerNetworking ( )

retrieve the service name (PTFEEDER, PTFeeder:Name, PTClicker:Name, etc)

Definition at line 36 of file BLEServerNetworking.cpp.

Here is the caller graph for this function:

◆ loop_BLEServerNetworking()

void loop_BLEServerNetworking ( )

the 'setup' for this module BLEServerNetworking. Here the service name is added (and potentially more later)

the 'setup' for this module BLEServerNetworking. Here the service name is added (and potentially more later)

Definition at line 327 of file BLEServerNetworking.cpp.

Here is the caller graph for this function:

◆ sendBLEMessageACKMessage()

void sendBLEMessageACKMessage ( )

send something over bluetooth, this right now is 0x01

send something over bluetooth, this right now is 0x01

Definition at line 590 of file BLEServerNetworking.cpp.

Here is the caller graph for this function:

◆ setBLEServerDeviceName()

void setBLEServerDeviceName ( char *  deviceName)

sets the device name

NOT CALLED... sets the device name in the advertising

Definition at line 43 of file BLEServerNetworking.cpp.

◆ setup_BLEServerNetworking()

void setup_BLEServerNetworking ( char *  serviceName,
char *  deviceName,
char *  serviceUUID,
char *  characteristicUUID 
)

the 'setup' for this module BLEServerNetworking. Here the service name is added (and potentially more later)

defines the operations on BLE Server Networking BLEServerNetworking is the "server" side of the BLE interface

currently not using the option, just doing it...

sets device name

Optional: set the transmit power, default is 3db

+9db

Set the IO capabilities of the device, each option will trigger a different pairing method. BLE_HS_IO_DISPLAY_ONLY - Passkey pairing BLE_HS_IO_DISPLAY_YESNO - Numeric comparison pairing BLE_HS_IO_NO_INPUT_OUTPUT - DEFAULT setting - just works pairing

2 different ways to set security - both calls achieve the same result. no bonding, no man in the middle protection, secure connections.

These are the default values, only shown here for demonstration.

Require a secure connection for read and write access

2904 descriptors are a special case, when createDescriptor is called with 0x2904 a NimBLE2904 class is created with the correct properties and sizes. However we must cast the returned reference to the correct type as the method only returns a pointer to the base NimBLEDescriptor class.

Note a 0x2902 descriptor MUST NOT be created as NimBLE will create one automatically if notification or indication properties are assigned to a characteristic.

Custom descriptor: Arguments are UUID, Properties, max length in bytes of the value

Start the services when finished creating all Characteristics and Descriptors

Add the services to the advertisment data

If your device is battery powered you may consider setting scan response to false as it will extend battery life at the expense of less data sent.

setName shows up ad LocalName in Punchthrough Scanner, but

Definition at line 355 of file BLEServerNetworking.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: