![]() |
SDK
23.9.2
For IoT System Software Development
|
The model of a BLE server. More...
#include <BLEServer.hpp>
Public Member Functions | |
| uint32_t | getConnectedCount () |
| Return the number of connected clients. More... | |
| BLEService * | createService (const char *uuid) |
| Create a BLE Service. More... | |
| BLEService * | createService (BLEUUID uuid, uint32_t numHandles=15, uint8_t inst_id=0) |
| Create a BLE Service. More... | |
| BLEAdvertising * | getAdvertising () |
| Retrieve the advertising object that can be used to advertise the existence of the server. More... | |
| void | setCallbacks (BLEServerCallbacks *pCallbacks) |
| Set the server callbacks. More... | |
| void | startAdvertising () |
| void | removeService (BLEService *service) |
| BLEService * | getServiceByUUID (const char *uuid) |
| Get a BLE Service by its UUID. More... | |
| BLEService * | getServiceByUUID (BLEUUID uuid) |
| Get a BLE Service by its UUID. More... | |
| bool | connect (BLEAddress address) |
| void | disconnect (uint16_t connId) |
| void | updateConnParams (BLEAddress &remote_bda, uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout) |
Public Attributes | |
| uint16_t | m_appId |
The model of a BLE server.
| BLEService * BLEServer::createService | ( | BLEUUID | uuid, |
| uint32_t | numHandles = 15, |
||
| uint8_t | inst_id = 0 |
||
| ) |
Create a BLE Service.
With a BLE server, we can host one or more services. Invoking this function causes the creation of a definition of a new service. Every service must have a unique UUID.
| [in] | uuid | The UUID of the new service. |
| [in] | numHandles | The maximum number of handles associated with this service. |
| [in] | inst_id | With multiple services with the same UUID we need to provide inst_id value different for each service. |
| BLEService * BLEServer::createService | ( | const char * | uuid | ) |
Create a BLE Service.
With a BLE server, we can host one or more services. Invoking this function causes the creation of a definition of a new service. Every service must have a unique UUID.
| [in] | uuid | The UUID of the new service. |
| BLEAdvertising * BLEServer::getAdvertising | ( | ) |
| uint32_t BLEServer::getConnectedCount | ( | ) |
| BLEService * BLEServer::getServiceByUUID | ( | BLEUUID | uuid | ) |
Get a BLE Service by its UUID.
| [in] | uuid | The UUID of the new service. |
| BLEService * BLEServer::getServiceByUUID | ( | const char * | uuid | ) |
Get a BLE Service by its UUID.
| [in] | uuid | The UUID of the new service. |
| void BLEServer::setCallbacks | ( | BLEServerCallbacks * | pCallbacks | ) |
Set the server callbacks.
As a BLE server operates, it will generate server level events such as a new client connecting or a previous client disconnecting. This function can be called to register a callback handler that will be invoked when these events are detected.
| [in] | pCallbacks | The callbacks to be invoked. |
1.8.17