Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate writable_gatt ... more
Diff: btle/btle_discovery.h
- Revision:
- 299:19064275c0e0
- Parent:
- 295:5566c7b83bb5
- Child:
- 301:59e7404a4ea3
--- a/btle/btle_discovery.h Fri Jun 19 15:55:28 2015 +0100
+++ b/btle/btle_discovery.h Fri Jun 19 15:55:28 2015 +0100
@@ -128,17 +128,24 @@
serviceIndices[index] = INVALID_SERVICE_INDEX;
}
}
- void append(int serviceIndex) {
+ void enqueue(int serviceIndex) {
serviceIndices[numIndices++] = serviceIndex;
}
unsigned getFirst(void) const {
return serviceIndices[0];
}
- void removeFirst(void) {
+ int dequeue(void) {
+ if (numIndices == 0) {
+ return INVALID_SERVICE_INDEX;
+ }
+
+ unsigned valueToReturn = serviceIndices[0];
numIndices--;
- for (unsigned index = 0; index < numIndices; index++) {
- serviceIndices[index] = serviceIndices[index + 1];
+ for (unsigned i = 0; i < numIndices; i++) {
+ serviceIndices[i] = serviceIndices[i + 1];
}
+
+ return valueToReturn;
}
size_t getCount(void) const {
return numIndices;

