8000 More code for #114 · kebot-embedded/esp32-snippets@e2bf94a · GitHub
[go: up one dir, main page]

Skip to content

Commit e2bf94a

Browse files
committed
More code for nkolban#114
1 parent adc3026 commit e2bf94a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cpp_utils/BLEServer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ BLEService* BLEServer::createService(const char* uuid) {
6666
* With a %BLE server, we can host one or more services. Invoking this function causes the creation of a definition
6767
* of a new service. Every service must have a unique UUID.
6868
* @param [in] uuid The UUID of the new service.
69+
* @param [in] numHandles The maximum number of handles associated with this service.
6970
* @return A reference to the new service object.
7071
*/
71-
BLEService* BLEServer::createService(BLEUUID uuid) {
72+
BLEService* BLEServer::createService(BLEUUID uuid, uint32_t numHandles) {
7273
ESP_LOGD(LOG_TAG, ">> createService - %s", uuid.toString().c_str());
7374
m_semaphoreCreateEvt.take("createService");
7475

@@ -80,7 +81,7 @@ BLEService* BLEServer::createService(BLEUUID uuid) {
8081
return nullptr;
8182
}
8283

83-
BLEService* pService = new BLEService(uuid);
84+
BLEService* pService = new BLEService(uuid, numHandles);
8485
m_serviceMap.setByUUID(uuid, pService); // Save a reference to this service being on this server.
8586
pService->executeCreate(this); // Perform the API calls to actually create the service.
8687

cpp_utils/BLEServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class BLEServer {
5353
public:
5454
uint32_t getConnectedCount();
5555
BLEService* createService(const char* uuid);
56-
BLEService* createService(BLEUUID uuid);
56+
BLEService* createService(BLEUUID uuid, uint32_t numHandles=15);
5757
BLEAdvertising* getAdvertising();
5858
void setCallbacks(BLEServerCallbacks *pCallbacks);
5959
void startAdvertising();

0 commit comments

Comments
 (0)
0