Mbed OS Reference
Loading...
Searching...
No Matches
gatt/CharacteristicDescriptorDiscovery.h
1/* mbed Microcontroller Library
2 * Copyright (c) 2006-2020 ARM Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef MBED_CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__
20#define MBED_CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__
21
23
24class DiscoveredCharacteristic; // forward declaration
25class DiscoveredCharacteristicDescriptor; // forward declaration
26
27/**
28 * @addtogroup ble
29 * @{
30 * @addtogroup gatt
31 * @{
32 */
33
34/**
35 * Definitions of events and event handlers that the characteristic descriptor
36 * discovery procedure uses.
37 *
38 * This class acts like a namespace for characteristic descriptor discovery
39 * types. Like ServiceDiscovery, it provides callbacks and callbacks parameters
40 * types related to the characteristic descriptor discovery process, but contrary
41 * to the ServiceDiscovery class, it does not force the porter to use a specific
42 * interface for the characteristic descriptor discovery process.
43 */
45public:
46 /**
47 * Characteristic descriptor discovered event.
48 *
49 * When a characteristic descriptor has been discovered, the callback
50 * registered for the discovery operation through
51 * GattClient::discoverCharacteristicDescriptors or
52 * DiscoveredCharacteristic::discoverDescriptors is called with an instance
53 * of this type.
54 *
55 * The values reported to the user are the descriptor discovered and the
56 * characteristic owning that descriptor.
57 *
58 * @see GattClient::discoverCharacteristicDescriptors
59 * DiscoveredCharacteristic::discoverDescriptors
60 */
62 /**
63 * Characteristic owning the descriptor discovered.
64 */
66
67 /**
68 * Characteristic descriptor discovered.
69 */
71 };
72
73 /**
74 * Characteristic descriptor discovery ended event.
75 *
76 * When the characteristic descriptor discovery process ends, the
77 * termination callback registered for the discovery operation through
78 * GattClient::discoverCharacteristicDescriptors or
79 * DiscoveredCharacteristic::discoverDescriptors will be called with an
80 * instance of this type.
81 *
82 * @see GattClient::discoverCharacteristicDescriptors
83 * DiscoveredCharacteristic::discoverDescriptors
84 */
86 /**
87 * Characteristic for which descriptors has been discovered.
88 */
90
91 /**
92 * Status of the discovery operation.
93 */
95
96 /**
97 * Error code associated with the status if any.
98 */
99 uint8_t error_code;
100 };
101
102 /**
103 * Characteristic descriptor discovered event handler.
104 *
105 * As a parameter, it expects a pointer to a DiscoveryCallbackParams_t instance.
106 *
107 * @note The object passed in parameter will remain valid for the lifetime
108 * of the callback. The BLE_API eventing framework owns memory for this
109 * object. The application can safely make a persistent shallow-copy of
110 * this object to work with the service beyond the callback.
111 *
112 * @see DiscoveryCallbackParams_t
113 * GattClient::discoverCharacteristicDescriptors
114 * DiscoveredCharacteristic::discoverDescriptors
115 */
118
119 /**
120 * Handler of Characteristic descriptor discovery ended event.
121 *
122 * As a parameter, it expects a pointer to a TerminationCallbackParams_t instance.
123 *
124 * @note The object passed in parameter will remain valid for the lifetime
125 * of the callback. The BLE_API eventing framework owns the memory for this
126 * object. The application can safely make a persistent shallow-copy of
127 * this object to work with the service beyond the callback.
128 *
129 * @see TerminationCallbackParams_t
130 * GattClient::discoverCharacteristicDescriptors
131 * DiscoveredCharacteristic::discoverDescriptors
132 */
135};
136
137/**
138 * @}
139 * @}
140 */
141
142#endif // ifndef MBED_CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__
Definitions of events and event handlers that the characteristic descriptor discovery procedure uses.
FunctionPointerWithContext< const TerminationCallbackParams_t * > TerminationCallback_t
Handler of Characteristic descriptor discovery ended event.
FunctionPointerWithContext< const DiscoveryCallbackParams_t * > DiscoveryCallback_t
Characteristic descriptor discovered event handler.
Representation of a characteristic descriptor discovered.
Representation of a characteristic discovered.
Function like object adapter over freestanding and member functions.
ble_error_t
Error codes for the BLE API.
const DiscoveredCharacteristic & characteristic
Characteristic owning the descriptor discovered.
const DiscoveredCharacteristicDescriptor & descriptor
Characteristic descriptor discovered.
const DiscoveredCharacteristic & characteristic
Characteristic for which descriptors has been discovered.