Pinned to some recent date

Committer:
Simon Cooksey
Date:
Thu Nov 17 16:43:53 2016 +0000
Revision:
0:fb7af294d5d9
Initial commit

Who changed what in which revision?

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