File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -117,9 +117,13 @@ BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) {
117
117
118
118
/* *
119
119
* @brief Returns the amount of services registered to this server
120
+ * @param [in] includeDefaultServices Add the amount of default BluetoothLE services defined by the BLE standard
120
121
* @return The amount of registered services
121
122
*/
122
- int BLEServer::getServiceCount () {
123
+ int BLEServer::getServiceCount (bool includeDefaultServices = false ) {
124
+ if (includeDefaultServices){
125
+ return m_serviceMap.size () + 2 ;
126
+ }
123
127
return m_serviceMap.size ();
124
128
}
125
129
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ class BLEServiceMap {
43
43
BLEService* getFirst ();
44
44
BLEService* getNext ();
45
45
void removeService (BLEService* service);
46
- int getServiceCount ();
47
46
48
47
private:
49
48
std::map<uint16_t , BLEService*> m_handleMap;
@@ -67,6 +66,7 @@ class BLEServer {
67
66
BLEService* getServiceByUUID (const char * uuid);
68
67
BLEService* getServiceByUUID (BLEUUID uuid);
69
68
void removeService (BLEService* service);
69
+ int getServiceCount (bool includeDefaultServices = false );
70
70
71
71
private:
72
72
BLEServer ();
You can’t perform that action at this time.
0 commit comments