|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -#ifndef __SERVICE_DISOVERY_H__ |
18 |
| -#define __SERVICE_DISOVERY_H__ |
| 17 | +#ifndef MBED_BLE_SERVICE_DISOVERY_H__ |
| 18 | +#define MBED_BLE_SERVICE_DISOVERY_H__ |
19 | 19 |
|
20 | 20 | #include "UUID.h"
|
21 | 21 | #include "Gap.h"
|
|
24 | 24 | class DiscoveredService;
|
25 | 25 | class DiscoveredCharacteristic;
|
26 | 26 |
|
| 27 | +/** |
| 28 | + * @addtogroup ble |
| 29 | + * @{ |
| 30 | + * @addtogroup gatt |
| 31 | + * @{ |
| 32 | + * @addtogroup client |
| 33 | + * @{ |
| 34 | + */ |
| 35 | + |
| 36 | +/** |
| 37 | + * Host callback types needed by the service discovery procedure. |
| 38 | + * |
| 39 | + * This class is also an interface which may be used in vendor port to model |
| 40 | + * the service discovery process. This interface shall not be used in user code. |
| 41 | + * |
| 42 | + * @important Implementing this interface is not a requirement for the |
| 43 | + * implementation of the service discover process. |
| 44 | + */ |
27 | 45 | class ServiceDiscovery {
|
28 | 46 | public:
|
29 |
| - /* |
30 |
| - * Exposed application callback types. |
31 |
| - */ |
32 |
| - |
33 | 47 | /**
|
34 |
| - * Callback type for when a matching service is found during service- |
35 |
| - * discovery. The receiving function is passed in a pointer to a |
36 |
| - * DiscoveredService object, which will remain valid for the lifetime of the |
37 |
| - * callback. Memory for this object is owned by the BLE_API eventing |
38 |
| - * framework. The application can safely make a persistent shallow-copy of |
39 |
| - * this object to work with the service beyond the callback. |
| 48 | + * Service discovered event handler. |
| 49 | + * |
| 50 | + * The callback shall accepts a pointer to a DiscoveredService as parameter. |
| 51 | + * |
| 52 | + * @important The argument passed to the callback may not persist after the |
| 53 | + * callback invocation therefore the callbacks must make a shallow copy |
| 54 | + * of the DiscoveredService passed as parameter to access its value beyond |
| 55 | + * the callback scope. |
40 | 56 | */
|
41 |
| - typedef FunctionPointerWithContext<const DiscoveredService *> ServiceCallback_t; |
| 57 | + typedef FunctionPointerWithContext<const DiscoveredService *> |
| 58 | + ServiceCallback_t; |
42 | 59 |
|
43 | 60 | /**
|
44 |
| - * Callback type for when a matching characteristic is found during service- |
45 |
| - * discovery. The receiving function is passed in a pointer to a |
46 |
| - * DiscoveredCharacteristic object, which will remain valid for the lifetime |
47 |
| - * of the callback. Memory for this object is owned by the BLE_API eventing |
48 |
| - * framework. The application can safely make a persistent shallow-copy of |
49 |
| - * this object to work with the characteristic beyond the callback. |
| 61 | + * Characteristic discovered event handler. |
| 62 | + * |
| 63 | + * The callback shall accepts a pointer to a DiscoveredCharacteristic as |
| 64 | + * parameter. |
| 65 | + * |
| 66 | + * @important The argument passed to the callback may not persist after the |
| 67 | + * callback invocation therefore the callbacks must make a shallow copy |
| 68 | + * of the DiscoveredCharacteristic passed as parameter to access its value |
| 69 | + * beyond the callback scope. |
50 | 70 | */
|
51 |
| - typedef FunctionPointerWithContext<const DiscoveredCharacteristic *> CharacteristicCallback_t; |
| 71 | + typedef FunctionPointerWithContext<const DiscoveredCharacteristic *> |
| 72 | + CharacteristicCallback_t; |
52 | 73 |
|
53 | 74 | /**
|
54 |
| - * Callback type for when serviceDiscovery terminates. |
| 75 | + * Service discovery ended event. |
| 76 | + * |
| 77 | + * The callback shall accepts a connection handle as parameter. This |
| 78 | + * parameter is used to identify on which connection the service discovery |
| 79 | + * process ended. |
55 | 80 | */
|
56 | 81 | typedef FunctionPointerWithContext<Gap::Handle_t> TerminationCallback_t;
|
57 | 82 |
|
@@ -180,4 +205,10 @@ class ServiceDiscovery {
|
180 | 205 | CharacteristicCallback_t characteristicCallback;
|
181 | 206 | };
|
182 | 207 |
|
183 |
| -#endif /* ifndef __SERVICE_DISOVERY_H__ */ |
| 208 | +/** |
| 209 | + * @} |
| 210 | + * @} |
| 211 | + * @} |
| 212 | + */ |
| 213 | + |
| 214 | +#endif /* ifndef MBED_BLE_SERVICE_DISOVERY_H__ */ |
0 commit comments