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.
Fork of nRF51822 by
Diff: nRFServiceDiscovery.h
- Revision:
- 333:8eedcd324853
- Parent:
- 332:b054000833d4
diff -r b054000833d4 -r 8eedcd324853 nRFServiceDiscovery.h
--- a/nRFServiceDiscovery.h Fri Jun 19 15:55:32 2015 +0100
+++ b/nRFServiceDiscovery.h Fri Jun 19 15:55:32 2015 +0100
@@ -18,11 +18,14 @@
#define __NRF_SERVICE_DISCOVERY_H__
#include "ServiceDiscovery.h"
+#include "DiscoveredService.h"
#include "nRFDiscoveredCharacteristic.h"
#include "ble.h"
#include "ble_gattc.h"
+class nRF51GattClient; /* forward declaration */
+
class nRFServiceDiscovery : public ServiceDiscovery
{
public:
@@ -34,16 +37,18 @@
static const unsigned BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV = 4; /**< Maximum number of characteristics per service we can retain information for. */
public:
- nRFServiceDiscovery() : serviceIndex(0),
- numServices(0),
- characteristicIndex(0),
- numCharacteristics(0),
- state(INACTIVE),
- services(),
- characteristics(),
- serviceUUIDDiscoveryQueue(this),
- charUUIDDiscoveryQueue(this),
- onTerminationCallback(NULL) {
+ nRFServiceDiscovery(nRF51GattClient *gattcIn) :
+ gattc(gattcIn),
+ serviceIndex(0),
+ numServices(0),
+ characteristicIndex(0),
+ numCharacteristics(0),
+ state(INACTIVE),
+ services(),
+ characteristics(),
+ serviceUUIDDiscoveryQueue(this),
+ charUUIDDiscoveryQueue(this),
+ onTerminationCallback(NULL) {
/* empty */
}
@@ -271,6 +276,9 @@
void progressServiceDiscovery(void);
private:
+ nRF51GattClient *gattc;
+
+private:
uint8_t serviceIndex; /**< Index of the current service being discovered. This is intended for internal use during service discovery.*/
uint8_t numServices; /**< Number of services at the peers GATT database.*/
uint8_t characteristicIndex; /**< Index of the current characteristic being discovered. This is intended for internal use during service discovery.*/
