High level Bluetooth Low Energy API and radio abstraction layer

Dependents:   BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate BLE_ANCS_SDAPI_IRC ... more

Overview

The BLE_API is a high level abstraction for using Bluetooth Low Energy on multiple platforms. For details and examples using the BLE_API please see the BLE_API Summary Page. Or click on the API Documentation tab above.

Supported Services

Supported services can be found in the BLE_API/services folder.

Files at this revision

API Documentation at this revision

Comitter:
vcoubard
Date:
Mon Jan 11 08:51:37 2016 +0000
Parent:
1062:a3fd424b73ca
Child:
1064:17f8e6339e57
Commit message:
Synchronized with git rev a7b7118b
Author: Vincent Coubard
Merge branch 'develop' of https://github.com/ARMmbed/ble into descriptorDiscovery

Changed in this revision

ble/CharacteristicDescriptorDiscovery.h Show annotated file Show diff for this revision Revisions of this file
ble/DiscoveredCharacteristic.h Show annotated file Show diff for this revision Revisions of this file
ble/DiscoveredCharacteristicDescriptor.h Show annotated file Show diff for this revision Revisions of this file
ble/Gap.h Show annotated file Show diff for this revision Revisions of this file
ble/GattClient.h Show annotated file Show diff for this revision Revisions of this file
ble/GattServer.h Show annotated file Show diff for this revision Revisions of this file
ble/SecurityManager.h Show annotated file Show diff for this revision Revisions of this file
ble/ServiceDiscovery.h Show annotated file Show diff for this revision Revisions of this file
source/DiscoveredCharacteristic.cpp Show annotated file Show diff for this revision Revisions of this file
source/Gap.cpp Show diff for this revision Revisions of this file
source/GattClient.cpp Show diff for this revision Revisions of this file
source/GattServer.cpp Show diff for this revision Revisions of this file
source/SecurityManager.cpp Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ble/CharacteristicDescriptorDiscovery.h	Mon Jan 11 08:51:37 2016 +0000
@@ -0,0 +1,57 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__
+#define __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__
+
+#include "FunctionPointerWithContext.h"
+
+class DiscoveredCharacteristic;
+class DiscoveredCharacteristicDescriptor;
+
+class CharacteristicDescriptorDiscovery {
+public:
+    /*
+     * Exposed application callback types.
+     */
+    struct DiscoveryCallbackParams_t {
+        const DiscoveredCharacteristic& characteristic;
+        const DiscoveredCharacteristicDescriptor& descriptor;
+    };
+
+    struct TerminationCallbackParams_t { 
+        const DiscoveredCharacteristic& characteristic;
+        ble_error_t status;
+    };
+
+    /**
+     * Callback type for when a matching characteristic descriptor is found during 
+     * characteristic descriptor discovery. The receiving function is passed in a 
+     * pointer to a DiscoveryCallbackParams_t object which will remain 
+     * valid for the lifetime of the callback. Memory for this object is owned by 
+     * the BLE_API eventing framework. The application can safely make a persistent 
+     * shallow-copy of this object in order to work with the service beyond the 
+     * callback.
+     */
+    typedef FunctionPointerWithContext<const DiscoveryCallbackParams_t*> DiscoveryCallback_t;
+
+    /**
+     * Callback type for when characteristic descriptor discovery terminates.
+     */
+    typedef FunctionPointerWithContext<const TerminationCallbackParams_t*> TerminationCallback_t;
+};
+
+#endif // ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__
\ No newline at end of file
--- a/ble/DiscoveredCharacteristic.h	Mon Jan 11 08:51:37 2016 +0000
+++ b/ble/DiscoveredCharacteristic.h	Mon Jan 11 08:51:37 2016 +0000
@@ -21,6 +21,9 @@
 #include "Gap.h"
 #include "GattAttribute.h"
 #include "GattClient.h"
+#include "CharacteristicDescriptorDiscovery.h"
+#include "ble/DiscoveredCharacteristicDescriptor.h"
+
 
 /**
  * Structure for holding information about the service and the characteristics
@@ -46,31 +49,26 @@
         bool indicate(void)        const {return _indicate;       }
         bool authSignedWrite(void) const {return _authSignedWrite;}
 
+        friend bool operator==(Properties_t rhs, Properties_t lhs) {
+            return rhs._broadcast == lhs._broadcast &&
+                   rhs._read == lhs._read &&
+                   rhs._writeWoResp == lhs._writeWoResp &&
+                   rhs._write == lhs._write &&
+                   rhs._notify == lhs._notify &&
+                   rhs._indicate == lhs._indicate &&
+                   rhs._authSignedWrite == lhs._authSignedWrite;
+        }
+
+        friend bool operator!=(Properties_t rhs, Properties_t lhs) { 
+            return !(rhs == lhs);
+        }
+
     private:
         operator uint8_t()  const; /* Disallow implicit conversion into an integer. */
         operator unsigned() const; /* Disallow implicit conversion into an integer. */
     };
 
     /**
-     * Structure for holding information about the service and the characteristics
-     * found during the discovery process.
-     */
-    struct DiscoveredDescriptor {
-        GattAttribute::Handle_t handle; /**< Descriptor Handle. */
-        UUID                    uuid;   /**< Descriptor UUID. */
-    };
-
-    /**
-     * Callback type for when a characteristic descriptor is found during descriptor-
-     * discovery. The receiving function is passed in a pointer to a
-     * DiscoveredDescriptor object which will remain valid for the lifetime
-     * of the callback. Memory for this object is owned by the BLE_API eventing
-     * framework. The application can safely make a persistent shallow-copy of
-     * this object in order to work with the characteristic beyond the callback.
-     */
-    typedef void (*DescriptorCallback_t)(const DiscoveredDescriptor *);
-
-    /**
      * Initiate (or continue) a read for the value attribute, optionally at a
      * given offset. If the characteristic or descriptor to be read is longer
      * than ATT_MTU - 1, this function must be called multiple times with
@@ -110,13 +108,13 @@
     /**
      * Initiate a GATT Characteristic Descriptor Discovery procedure for descriptors within this characteristic.
      *
-     * @param  callback
-     * @param  matchingUUID
-     *           Filter for descriptors. Defaults to wildcard which will discover all descriptors.
+     * @param onCharacteristicDiscovered This callback will be called every time a descriptor is discovered
+     * @param onTermination This callback will be called when the discovery process is over.
      *
      * @return  BLE_ERROR_NONE if descriptor discovery is launched successfully; else an appropriate error.
      */
-    ble_error_t discoverDescriptors(DescriptorCallback_t callback, const UUID &matchingUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) const;
+    ble_error_t discoverDescriptors(const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& onCharacteristicDiscovered, 
+                                    const CharacteristicDescriptorDiscovery::TerminationCallback_t& onTermination) const;
 
     /**
      * Perform a write procedure.
@@ -155,19 +153,56 @@
         return props;
     }
 
-    const GattAttribute::Handle_t& getDeclHandle(void) const {
+    GattAttribute::Handle_t getDeclHandle(void) const {
         return declHandle;
     }
-    const GattAttribute::Handle_t& getValueHandle(void) const {
+
+    GattAttribute::Handle_t getValueHandle(void) const {
         return valueHandle;
     }
 
+    GattAttribute::Handle_t getLastHandle(void) const {
+        return lastHandle;
+    }
+
+    void setLastHandle(GattAttribute::Handle_t last) { 
+        lastHandle = last;
+    }
+
+    GattClient* getGattClient() { 
+        return gattc;
+    }
+
+    const GattClient* getGattClient() const { 
+        return gattc;
+    }
+
+    Gap::Handle_t getConnectionHandle() const {
+        return connHandle;
+    }
+
+    friend bool operator==(const DiscoveredCharacteristic& rhs, const DiscoveredCharacteristic& lhs) {
+        return rhs.gattc == lhs.gattc && 
+               rhs.uuid == lhs.uuid &&
+               rhs.props == lhs.props &&
+               rhs.declHandle == lhs.declHandle &&
+               rhs.valueHandle == lhs.valueHandle &&
+               rhs.lastHandle == lhs.lastHandle &&
+               rhs.connHandle == lhs.connHandle;
+    }
+
+    friend bool operator !=(const DiscoveredCharacteristic& rhs, const DiscoveredCharacteristic& lhs) {
+        return !(rhs == lhs);
+    }
+
 public:
     DiscoveredCharacteristic() : gattc(NULL),
                                  uuid(UUID::ShortUUIDBytes_t(0)),
                                  props(),
                                  declHandle(GattAttribute::INVALID_HANDLE),
-                                 valueHandle(GattAttribute::INVALID_HANDLE) {
+                                 valueHandle(GattAttribute::INVALID_HANDLE),
+                                 lastHandle(GattAttribute::INVALID_HANDLE),
+                                 connHandle() {
         /* empty */
     }
 
@@ -179,6 +214,7 @@
     Properties_t             props;
     GattAttribute::Handle_t  declHandle;
     GattAttribute::Handle_t  valueHandle;
+    GattAttribute::Handle_t  lastHandle;
 
     Gap::Handle_t            connHandle;
 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ble/DiscoveredCharacteristicDescriptor.h	Mon Jan 11 08:51:37 2016 +0000
@@ -0,0 +1,66 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__
+#define __DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__
+
+#include "UUID.h"
+#include "Gap.h"
+#include "GattAttribute.h"
+#include "GattClient.h"
+#include "CharacteristicDescriptorDiscovery.h"
+
+
+/**
+ * 
+ */
+class DiscoveredCharacteristicDescriptor {
+
+public:
+    DiscoveredCharacteristicDescriptor(
+        GattClient* client, Gap::Handle_t connectionHandle,  GattAttribute::Handle_t gattHandle, const UUID& uuid) : 
+        _client(client), _connectionHandle(connectionHandle), _uuid(uuid), _gattHandle(gattHandle) {
+
+    }
+
+    GattClient* client() { 
+        return _client;
+    }
+
+    const GattClient* client() const { 
+        return _client;
+    }
+
+    Gap::Handle_t connectionHandle() const {
+        return _connectionHandle;
+    }
+
+    const UUID& uuid(void) const {
+        return _uuid;
+    }
+
+    GattAttribute::Handle_t gattHandle() const {
+        return _gattHandle;
+    }
+
+private:
+    GattClient  *_client;
+    Gap::Handle_t _connectionHandle;
+    UUID _uuid;
+    GattAttribute::Handle_t _gattHandle;
+};
+
+#endif /*__DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__*/
\ No newline at end of file
--- a/ble/Gap.h	Mon Jan 11 08:51:37 2016 +0000
+++ b/ble/Gap.h	Mon Jan 11 08:51:37 2016 +0000
@@ -984,54 +984,6 @@
     }
 
 protected:
-    /**
-     * Clear all Gap state of the associated object.
-     *
-     * This function is meant to be overridden in the platform-specific
-     * sub-class. Nevertheless, the sub-class is only expected to clean up its
-     * state and not the data held in Gap members. This shall be achieved by a
-     * call to Gap::cleanup() from the sub-class' cleanup() implementation.
-     *
-     * @return BLE_ERROR_NONE on success.
-     *
-     * @note: Currently a call to cleanup() does not reset the advertising and
-     * scan parameters to default values.
-     */
-    virtual ble_error_t cleanup(void) {
-        /* Clear Gap state */
-        state.advertising = 0;
-        state.connected = 0;
-
-        /* Clear scanning state */
-        scanningActive = false;
-
-        /* Clear advertising and scanning data */
-        _advPayload.clear();
-        _scanResponse.clear();
-
-        return BLE_ERROR_NONE;
-    }
-
-public:
-    /**
-     * Clear all Gap state of the object pointed to by gapInstance.
-     *
-     * This function is meant to be called by the overridden BLE::shutdown()
-     * in the platform-specific sub-class.
-     *
-     * @return BLE_ERROR_NONE on success.
-     *
-     * @note: If gapInstance is NULL then it is assumed that Gap has not been
-     * instantiated and a call to Gap::shutdown() will succeed.
-     */
-    static ble_error_t shutdown(void) {
-        if (gapInstance) {
-            return gapInstance->cleanup();
-        }
-        return BLE_ERROR_NONE;
-    }
-
-protected:
     Gap() :
         _advParams(),
         _advPayload(),
@@ -1100,10 +1052,6 @@
     bool                             scanningActive;
 
 protected:
-    static Gap *gapInstance;    /**< Pointer to the Gap object instance.
-                                 *   If NULL, then Gap has not been initialized. */
-
-protected:
     TimeoutEventCallbackChain_t       timeoutCallbackChain;
     RadioNotificationEventCallback_t  radioNotificationCallback;
     AdvertisementReportCallback_t     onAdvertisementReport;
--- a/ble/GattClient.h	Mon Jan 11 08:51:37 2016 +0000
+++ b/ble/GattClient.h	Mon Jan 11 08:51:37 2016 +0000
@@ -20,6 +20,7 @@
 #include "Gap.h"
 #include "GattAttribute.h"
 #include "ServiceDiscovery.h"
+#include "CharacteristicDescriptorDiscovery.h"
 
 #include "GattCallbackParamTypes.h"
 
@@ -305,6 +306,53 @@
     }
 
     /**
+     * @brief launch discovery of descriptors for a given characteristic
+     * @details This function will discover all descriptors available for a 
+     * specific characteristic. 
+     * 
+     * @param characteristic The characteristic targeted by this discovery
+     * @param callback This is the application callback for each descriptors 
+     * found. 
+     * @note service discovery may still be active when the callback is issued; 
+     * calling asynchronous BLE-stack APIs from within this application callback 
+     * might cause the stack to abort the discovery. If this becomes an issue, 
+     * it may be better to make local copy of the DiscoveredCharacteristicDescriptor 
+     * and wait for characteristic descriptor discovery to terminate before 
+     * operating on the descriptor.
+     * 
+     * @return 
+     *   BLE_ERROR_NONE if characteristic descriptor discovery is launched 
+     *   successfully; else an appropriate error.
+     */
+    virtual ble_error_t discoverCharacteristicDescriptors(
+        const DiscoveredCharacteristic& characteristic,
+        const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback,
+        const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback) {
+        (void) characteristic;
+        (void) discoveryCallback;
+        (void) terminationCallback;
+        return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
+    }
+
+    /**
+     * Is characteristic descriptor discovery currently active?
+     */
+    virtual bool isCharacteristicDescriptorsDiscoveryActive(const DiscoveredCharacteristic& characteristic) const 
+     {
+        (void) characteristic;
+        return false; /* Requesting action from porter(s): override this API if this capability is supported. */
+    }
+
+    /**
+     * Terminate an ongoing characteristic descriptor discovery. This should result 
+     * in an invocation of the TerminationCallback if characteristic descriptor discovery is active.
+     */
+    virtual void terminateCharacteristicDescriptorsDiscovery(const DiscoveredCharacteristic& characteristic) {
+        /* Requesting action from porter(s): override this API if this capability is supported. */
+        (void) characteristic;
+    }
+
+    /**
      * Set up a callback for when the GATT client receives an update event
      * corresponding to a change in the value of a characteristic on the remote
      * GATT server.
@@ -326,46 +374,6 @@
     }
 
 protected:
-    /**
-     * Clear all GattClient state of the associated object.
-     *
-     * This function is meant to be overridden in the platform-specific
-     * sub-class. Nevertheless, the sub-class is only expected to clean up its
-     * state and not the data held in GattClient members. This shall be achieved
-     * by a call to GattClient::cleanup() from the sub-class' cleanup()
-     * implementation.
-     *
-     * @return BLE_ERROR_NONE on success.
-     */
-    virtual ble_error_t cleanup(void) {
-        onDataReadCallbackChain.clear();
-        onDataWriteCallbackChain.clear();
-        onHVXCallbackChain.clear();
-
-        return BLE_ERROR_NONE;
-    }
-
-public:
-    /**
-     * Clear all GattClient state of the object pointed to by
-     * gattClientInstance.
-     *
-     * This function is meant to be called by the overridden BLE::shutdown()
-     * in the platform-specific sub-class.
-     *
-     * @return BLE_ERROR_NONE on success.
-     *
-     * @note: If gattClientInstance is NULL then it is assumed that Gap has not
-     * been instantiated and a call to GattClient::shutdown() will succeed.
-     */
-    static ble_error_t shutdown(void) {
-        if (gattClientInstance) {
-            return gattClientInstance->cleanup();
-        }
-        return BLE_ERROR_NONE;
-    }
-
-protected:
     GattClient() {
         /* Empty */
     }
@@ -391,10 +399,6 @@
     WriteCallbackChain_t onDataWriteCallbackChain;
     HVXCallbackChain_t   onHVXCallbackChain;
 
-protected:
-    static GattClient *gattClientInstance;      /**< Pointer to the GattClient object instance.
-                                                 *   If NULL, then GattClient has not been initialized. */
-
 private:
     /* Disallow copy and assignment. */
     GattClient(const GattClient &);
--- a/ble/GattServer.h	Mon Jan 11 08:51:37 2016 +0000
+++ b/ble/GattServer.h	Mon Jan 11 08:51:37 2016 +0000
@@ -397,59 +397,9 @@
     }
 
 protected:
-    /**
-     * Clear all GattServer state of the associated object.
-     *
-     * This function is meant to be overridden in the platform-specific
-     * sub-class. Nevertheless, the sub-class is only expected to clean up its
-     * state and not the data held in GattServer members. This shall be achieved
-     * by a call to GattServer::cleanup() from the sub-class' cleanup()
-     * implementation.
-     *
-     * @return BLE_ERROR_NONE on success.
-     */
-    virtual ble_error_t cleanup(void) {
-        serviceCount = 0;
-        characteristicCount = 0;
-
-        dataSentCallChain.clear();
-        dataWrittenCallChain.clear();
-        dataReadCallChain.clear();
-        updatesEnabledCallback = NULL;
-        updatesDisabledCallback = NULL;
-        confirmationReceivedCallback = NULL;
-
-        return BLE_ERROR_NONE;
-    }
-
-public:
-    /**
-     * Clear all GattServer state of the object pointed to by
-     * gattServerInstance.
-     *
-     * This function is meant to be called by the overridden BLE::shutdown()
-     * in the platform-specific sub-class.
-     *
-     * @return BLE_ERROR_NONE on success.
-     *
-     * @note: If gattServerInstance is NULL then it is assumed that Gap has not
-     * been instantiated and a call to GattServer::shutdown() will succeed.
-     */
-    static ble_error_t shutdown(void) {
-        if (gattServerInstance) {
-            return gattServerInstance->cleanup();
-        }
-        return BLE_ERROR_NONE;
-    }
-
-protected:
     uint8_t serviceCount;
     uint8_t characteristicCount;
 
-protected:
-    static GattServer *gattServerInstance;      /**< Pointer to the GattServer object instance.
-                                                 *   If NULL, then GattServer has not been initialized. */
-
 private:
     DataSentCallbackChain_t    dataSentCallChain;
     DataWrittenCallbackChain_t dataWrittenCallChain;
--- a/ble/SecurityManager.h	Mon Jan 11 08:51:37 2016 +0000
+++ b/ble/SecurityManager.h	Mon Jan 11 08:51:37 2016 +0000
@@ -232,53 +232,6 @@
     }
 
 protected:
-    /**
-     * Clear all SecurityManager state of the associated object.
-     *
-     * This function is meant to be overridden in the platform-specific
-     * sub-class. Nevertheless, the sub-class is only expected to clean up its
-     * state and not the data held in SecurityManager members. This shall be
-     * achieved by a call to SecurityManager::cleanup() from the sub-class'
-     * cleanup() implementation.
-     *
-     * @return BLE_ERROR_NONE on success.
-     */
-    virtual ble_error_t cleanup(void) {
-        securitySetupInitiatedCallback = NULL;
-        securitySetupCompletedCallback = NULL;
-        linkSecuredCallback = NULL;
-        securityContextStoredCallback = NULL;
-        passkeyDisplayCallback = NULL;
-
-        return BLE_ERROR_NONE;
-    }
-
-public:
-    /**
-     * Clear all SecurityManager state of the object pointed to by
-     * securityManagerInstance.
-     *
-     * This function is meant to be called by the overridden BLE::shutdown()
-     * in the platform-specific sub-class.
-     *
-     * @return BLE_ERROR_NONE on success.
-     *
-     * @note: If securityManagerInstance is NULL then it is assumed that Gap has
-     * not been instantiated and a call to SecurityManager::shutdown() will
-     * succeed.
-     */
-    static ble_error_t shutdown(void) {
-        if (securityManagerInstance) {
-            return securityManagerInstance->cleanup();
-        }
-        return BLE_ERROR_NONE;
-    }
-
-protected:
-    static SecurityManager *securityManagerInstance;    /**< Pointer to the SecurityManager object instance.
-                                                         *   If NULL, then SecurityManager has not been initialized. */
-
-protected:
     SecuritySetupInitiatedCallback_t securitySetupInitiatedCallback;
     SecuritySetupCompletedCallback_t securitySetupCompletedCallback;
     LinkSecuredCallback_t            linkSecuredCallback;
--- a/ble/ServiceDiscovery.h	Mon Jan 11 08:51:37 2016 +0000
+++ b/ble/ServiceDiscovery.h	Mon Jan 11 08:51:37 2016 +0000
@@ -132,27 +132,6 @@
      */
     virtual void        onTermination(TerminationCallback_t callback) = 0;
 
-    /**
-     * Clear all ServiceDiscovery state of the associated object.
-     *
-     * This function is meant to be overridden in the platform-specific
-     * sub-class. Nevertheless, the sub-class is only expected to clean up its
-     * state and not the data held in ServiceDiscovery members. This shall be
-     * achieved by a call to ServiceDiscovery::cleanup() from the sub-class'
-     * cleanup() implementation.
-     *
-     * @return BLE_ERROR_NONE on success.
-     */
-    virtual ble_error_t cleanup(void) {
-        connHandle = 0;
-        matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN);
-        serviceCallback = NULL;
-        matchingCharacteristicUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN);
-        characteristicCallback = NULL;
-
-        return BLE_ERROR_NONE;
-    }
-
 protected:
     Gap::Handle_t            connHandle; /**< Connection handle as provided by the SoftDevice. */
     UUID                     matchingServiceUUID;
--- a/source/DiscoveredCharacteristic.cpp	Mon Jan 11 08:51:37 2016 +0000
+++ b/source/DiscoveredCharacteristic.cpp	Mon Jan 11 08:51:37 2016 +0000
@@ -151,8 +151,17 @@
     return error;
 }
 
-ble_error_t
-DiscoveredCharacteristic::discoverDescriptors(DescriptorCallback_t callback, const UUID &matchingUUID) const
-{
-    return BLE_ERROR_NOT_IMPLEMENTED; /* TODO: this needs to be filled in. */
+ble_error_t DiscoveredCharacteristic::discoverDescriptors(
+    const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& onCharacteristicDiscovered, 
+    const CharacteristicDescriptorDiscovery::TerminationCallback_t& onTermination) const {
+
+    if(!gattc) {
+        return BLE_ERROR_INVALID_STATE;
+    }
+
+    ble_error_t err = gattc->discoverCharacteristicDescriptors(
+        *this, onCharacteristicDiscovered, onTermination
+    );
+
+    return err;
 }
\ No newline at end of file
--- a/source/Gap.cpp	Mon Jan 11 08:51:37 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/* mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ble/Gap.h"
-
-Gap *Gap::gapInstance = NULL;
\ No newline at end of file
--- a/source/GattClient.cpp	Mon Jan 11 08:51:37 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/* mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ble/GattClient.h"
-
-GattClient *GattClient::gattClientInstance = NULL;
\ No newline at end of file
--- a/source/GattServer.cpp	Mon Jan 11 08:51:37 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/* mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ble/GattServer.h"
-
-GattServer *GattServer::gattServerInstance = NULL;
\ No newline at end of file
--- a/source/SecurityManager.cpp	Mon Jan 11 08:51:37 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/* mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ble/SecurityManager.h"
-
-SecurityManager *SecurityManager::securityManagerInstance = NULL;
\ No newline at end of file