prova invio BLE
Dependents: BLE_HeartRate_IDB04A1
Fork of BLE_API by
ble/CharacteristicDescriptorDiscovery.h@1064:17f8e6339e57, 2016-01-11 (annotated)
- Committer:
- vcoubard
- Date:
- Mon Jan 11 08:51:38 2016 +0000
- Revision:
- 1064:17f8e6339e57
- Parent:
- 1063:187f9929cb60
Synchronized with git rev 933f1348
Author: Vincent Coubard
Add documentation for CharacteristicDescriptorDiscovery
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vcoubard | 1063:187f9929cb60 | 1 | /* mbed Microcontroller Library |
vcoubard | 1063:187f9929cb60 | 2 | * Copyright (c) 2006-2015 ARM Limited |
vcoubard | 1063:187f9929cb60 | 3 | * |
vcoubard | 1063:187f9929cb60 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
vcoubard | 1063:187f9929cb60 | 5 | * you may not use this file except in compliance with the License. |
vcoubard | 1063:187f9929cb60 | 6 | * You may obtain a copy of the License at |
vcoubard | 1063:187f9929cb60 | 7 | * |
vcoubard | 1063:187f9929cb60 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
vcoubard | 1063:187f9929cb60 | 9 | * |
vcoubard | 1063:187f9929cb60 | 10 | * Unless required by applicable law or agreed to in writing, software |
vcoubard | 1063:187f9929cb60 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
vcoubard | 1063:187f9929cb60 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
vcoubard | 1063:187f9929cb60 | 13 | * See the License for the specific language governing permissions and |
vcoubard | 1063:187f9929cb60 | 14 | * limitations under the License. |
vcoubard | 1063:187f9929cb60 | 15 | */ |
vcoubard | 1063:187f9929cb60 | 16 | |
vcoubard | 1063:187f9929cb60 | 17 | #ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ |
vcoubard | 1063:187f9929cb60 | 18 | #define __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ |
vcoubard | 1063:187f9929cb60 | 19 | |
vcoubard | 1063:187f9929cb60 | 20 | #include "FunctionPointerWithContext.h" |
vcoubard | 1063:187f9929cb60 | 21 | |
vcoubard | 1064:17f8e6339e57 | 22 | class DiscoveredCharacteristic; // forward declaration |
vcoubard | 1064:17f8e6339e57 | 23 | class DiscoveredCharacteristicDescriptor; // forward declaration |
vcoubard | 1063:187f9929cb60 | 24 | |
vcoubard | 1064:17f8e6339e57 | 25 | /** |
vcoubard | 1064:17f8e6339e57 | 26 | * @brief Contain all definitions of callbacks and callbacks parameters types |
vcoubard | 1064:17f8e6339e57 | 27 | * related to characteristic descriptor discovery. |
vcoubard | 1064:17f8e6339e57 | 28 | * |
vcoubard | 1064:17f8e6339e57 | 29 | * @details This class act like a namespace for characteristic descriptor discovery |
vcoubard | 1064:17f8e6339e57 | 30 | * types. It act like ServiceDiscovery by providing callbacks and callbacks |
vcoubard | 1064:17f8e6339e57 | 31 | * parameters types related to the characteristic descriptor discovery process but |
vcoubard | 1064:17f8e6339e57 | 32 | * contrary to ServiceDiscovery class, it does not force the porter to use a |
vcoubard | 1064:17f8e6339e57 | 33 | * specific interface for the characteristic descriptor discovery process. |
vcoubard | 1064:17f8e6339e57 | 34 | */ |
vcoubard | 1063:187f9929cb60 | 35 | class CharacteristicDescriptorDiscovery { |
vcoubard | 1063:187f9929cb60 | 36 | public: |
vcoubard | 1064:17f8e6339e57 | 37 | /** |
vcoubard | 1064:17f8e6339e57 | 38 | * @brief Parameter type of CharacteristicDescriptorDiscovery::DiscoveryCallback_t. |
vcoubard | 1064:17f8e6339e57 | 39 | * @detail Every time a characteristic descriptor has been discovered, the callback |
vcoubard | 1064:17f8e6339e57 | 40 | * registered for the discovery operation through GattClient::discoverCharacteristicDescriptors |
vcoubard | 1064:17f8e6339e57 | 41 | * or DiscoveredCharacteristic::discoverDescriptors will be called with this parameter. |
vcoubard | 1064:17f8e6339e57 | 42 | * |
vcoubard | 1063:187f9929cb60 | 43 | */ |
vcoubard | 1063:187f9929cb60 | 44 | struct DiscoveryCallbackParams_t { |
vcoubard | 1064:17f8e6339e57 | 45 | /** |
vcoubard | 1064:17f8e6339e57 | 46 | * The characteristic owning the DiscoveredCharacteristicDescriptor |
vcoubard | 1064:17f8e6339e57 | 47 | */ |
vcoubard | 1063:187f9929cb60 | 48 | const DiscoveredCharacteristic& characteristic; |
vcoubard | 1064:17f8e6339e57 | 49 | |
vcoubard | 1064:17f8e6339e57 | 50 | /** |
vcoubard | 1064:17f8e6339e57 | 51 | * The characteristic descriptor discovered |
vcoubard | 1064:17f8e6339e57 | 52 | */ |
vcoubard | 1063:187f9929cb60 | 53 | const DiscoveredCharacteristicDescriptor& descriptor; |
vcoubard | 1063:187f9929cb60 | 54 | }; |
vcoubard | 1063:187f9929cb60 | 55 | |
vcoubard | 1064:17f8e6339e57 | 56 | /** |
vcoubard | 1064:17f8e6339e57 | 57 | * @brief Parameter type of CharacteristicDescriptorDiscovery::TerminationCallback_t. |
vcoubard | 1064:17f8e6339e57 | 58 | * @details Once a characteristic descriptor discovery process terminate, the termination |
vcoubard | 1064:17f8e6339e57 | 59 | * callback registered for the discovery operation through |
vcoubard | 1064:17f8e6339e57 | 60 | * GattClient::discoverCharacteristicDescriptors or DiscoveredCharacteristic::discoverDescriptors |
vcoubard | 1064:17f8e6339e57 | 61 | * will be called with this parameter. |
vcoubard | 1064:17f8e6339e57 | 62 | */ |
vcoubard | 1064:17f8e6339e57 | 63 | struct TerminationCallbackParams_t { |
vcoubard | 1064:17f8e6339e57 | 64 | /** |
vcoubard | 1064:17f8e6339e57 | 65 | * The characteristic for which the descriptors has been discovered |
vcoubard | 1064:17f8e6339e57 | 66 | */ |
vcoubard | 1063:187f9929cb60 | 67 | const DiscoveredCharacteristic& characteristic; |
vcoubard | 1064:17f8e6339e57 | 68 | |
vcoubard | 1064:17f8e6339e57 | 69 | /** |
vcoubard | 1064:17f8e6339e57 | 70 | * status of the discovery operation |
vcoubard | 1064:17f8e6339e57 | 71 | */ |
vcoubard | 1063:187f9929cb60 | 72 | ble_error_t status; |
vcoubard | 1063:187f9929cb60 | 73 | }; |
vcoubard | 1063:187f9929cb60 | 74 | |
vcoubard | 1063:187f9929cb60 | 75 | /** |
vcoubard | 1064:17f8e6339e57 | 76 | * @brief Callback type for when a matching characteristic descriptor is found during |
vcoubard | 1064:17f8e6339e57 | 77 | * characteristic descriptor discovery. |
vcoubard | 1064:17f8e6339e57 | 78 | * |
vcoubard | 1064:17f8e6339e57 | 79 | * @param param A pointer to a DiscoveryCallbackParams_t object which will remain |
vcoubard | 1064:17f8e6339e57 | 80 | * valid for the lifetime of the callback. Memory for this object is owned by |
vcoubard | 1064:17f8e6339e57 | 81 | * the BLE_API eventing framework. The application can safely make a persistent |
vcoubard | 1064:17f8e6339e57 | 82 | * shallow-copy of this object in order to work with the service beyond the |
vcoubard | 1063:187f9929cb60 | 83 | * callback. |
vcoubard | 1063:187f9929cb60 | 84 | */ |
vcoubard | 1063:187f9929cb60 | 85 | typedef FunctionPointerWithContext<const DiscoveryCallbackParams_t*> DiscoveryCallback_t; |
vcoubard | 1063:187f9929cb60 | 86 | |
vcoubard | 1063:187f9929cb60 | 87 | /** |
vcoubard | 1064:17f8e6339e57 | 88 | * @brief Callback type for when characteristic descriptor discovery terminates. |
vcoubard | 1064:17f8e6339e57 | 89 | * |
vcoubard | 1064:17f8e6339e57 | 90 | * @param param A pointer to a TerminationCallbackParams_t object which will remain |
vcoubard | 1064:17f8e6339e57 | 91 | * valid for the lifetime of the callback. Memory for this object is owned by |
vcoubard | 1064:17f8e6339e57 | 92 | * the BLE_API eventing framework. The application can safely make a persistent |
vcoubard | 1064:17f8e6339e57 | 93 | * shallow-copy of this object in order to work with the service beyond the |
vcoubard | 1064:17f8e6339e57 | 94 | * callback. |
vcoubard | 1063:187f9929cb60 | 95 | */ |
vcoubard | 1063:187f9929cb60 | 96 | typedef FunctionPointerWithContext<const TerminationCallbackParams_t*> TerminationCallback_t; |
vcoubard | 1063:187f9929cb60 | 97 | }; |
vcoubard | 1063:187f9929cb60 | 98 | |
vcoubard | 1063:187f9929cb60 | 99 | #endif // ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ |