Skip to content

Commit e3252da

Browse files
committed
BLE: Improve ServiceDiscovery.h documentation.
1 parent a03192f commit e3252da

File tree

1 file changed

+53
-22
lines changed

1 file changed

+53
-22
lines changed

features/FEATURE_BLE/ble/ServiceDiscovery.h

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef __SERVICE_DISOVERY_H__
18-
#define __SERVICE_DISOVERY_H__
17+
#ifndef MBED_BLE_SERVICE_DISOVERY_H__
18+
#define MBED_BLE_SERVICE_DISOVERY_H__
1919

2020
#include "UUID.h"
2121
#include "Gap.h"
@@ -24,34 +24,59 @@
2424
class DiscoveredService;
2525
class DiscoveredCharacteristic;
2626

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+
*/
2745
class ServiceDiscovery {
2846
public:
29-
/*
30-
* Exposed application callback types.
31-
*/
32-
3347
/**
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.
4056
*/
41-
typedef FunctionPointerWithContext<const DiscoveredService *> ServiceCallback_t;
57+
typedef FunctionPointerWithContext<const DiscoveredService *>
58+
ServiceCallback_t;
4259

4360
/**
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.
5070
*/
51-
typedef FunctionPointerWithContext<const DiscoveredCharacteristic *> CharacteristicCallback_t;
71+
typedef FunctionPointerWithContext<const DiscoveredCharacteristic *>
72+
CharacteristicCallback_t;
5273

5374
/**
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.
5580
*/
5681
typedef FunctionPointerWithContext<Gap::Handle_t> TerminationCallback_t;
5782

@@ -180,4 +205,10 @@ class ServiceDiscovery {
180205
CharacteristicCallback_t characteristicCallback;
181206
};
182207

183-
#endif /* ifndef __SERVICE_DISOVERY_H__ */
208+
/**
209+
* @}
210+
* @}
211+
* @}
212+
*/
213+
214+
#endif /* ifndef MBED_BLE_SERVICE_DISOVERY_H__ */

0 commit comments

Comments
 (0)