File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,21 @@ BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) {
115
115
}
116
116
117
117
118
+ /* *
119
+ * @brief Returns the amount of services registered to this server
120
+ * @return The amount of registered services
121
+ */
122
+ int BLEServer::getServiceCount () {
123
+ int count = 0 ;
124
+ if (m_serviceMap.getFirst () == nullptr ) return 0 ;
125
+ while (m_serviceMap.getNext () != nullptr ){
126
+ count++;
127
+ }
128
+
129
+ return count;
130
+ }
131
+
132
+
118
133
/* *
119
134
* @brief Retrieve the advertising object that can be used to advertise the existence of the server.
120
135
*
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class BLEServiceMap {
43
43
BLEService* getFirst ();
44
44
BLEService* getNext ();
45
45
void removeService (BLEService* service);
46
+ int getServiceCount ();
46
47
47
48
private:
48
49
std::map<uint16_t , BLEService*> m_handleMap;
You can’t perform that action at this time.
0 commit comments