Joshua Slater / BLE_API2

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Jun 19 15:52:01 2015 +0100
Parent:
486:bcb77e15d152
Child:
488:bdba688a550f
Commit message:
Synchronized with git rev ecdb5f51
Author: Rohit Grover
Add comments to explain memory lifetimes for the discovered objects within discovery callbacks.

Changed in this revision

public/ServiceDiscovery.h Show annotated file Show diff for this revision Revisions of this file
--- a/public/ServiceDiscovery.h	Fri Jun 19 15:52:01 2015 +0100
+++ b/public/ServiceDiscovery.h	Fri Jun 19 15:52:01 2015 +0100
@@ -28,8 +28,30 @@
     /*
      * Exposed application callback types.
      */
+
+    /**
+     * Callback type for when a matching Service is found during service-
+     * discovery. The receiving function is passed in a pointer to a
+     * DiscoveredService 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 void (*ServiceCallback_t)(const DiscoveredService *);
+
+    /**
+     * Callback type for when a matching Characteristic is found during service-
+     * discovery. The receiving function is passed in a pointer to a
+     * DiscoveredCharacteristic 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 (*CharacteristicCallback_t)(const DiscoveredCharacteristic *);
+
+    /**
+     * Callback type for when serviceDiscovery terminates.
+     */
     typedef void (*TerminationCallback_t)(Gap::Handle_t connectionHandle);
 
 public: