jgh

Dependents:   Migration

Fork of BLE_API by Bluetooth Low Energy

Committer:
vcoubard
Date:
Mon Jan 11 08:51:43 2016 +0000
Revision:
1077:98d37e26903c
Synchronized with git rev 4dda9bf1
Author: Vincent Coubard
Fix function names:
- isCharacteristicDescriptorsDiscoveryActive => isCharacteristicDescriptorDiscoveryActive
- terminateCharacteristicDescriptorsDiscovery =>terminateCharacteristicDescriptorDiscovery

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 1077:98d37e26903c 1 /* mbed Microcontroller Library
vcoubard 1077:98d37e26903c 2 * Copyright (c) 2006-2013 ARM Limited
vcoubard 1077:98d37e26903c 3 *
vcoubard 1077:98d37e26903c 4 * Licensed under the Apache License, Version 2.0 (the "License");
vcoubard 1077:98d37e26903c 5 * you may not use this file except in compliance with the License.
vcoubard 1077:98d37e26903c 6 * You may obtain a copy of the License at
vcoubard 1077:98d37e26903c 7 *
vcoubard 1077:98d37e26903c 8 * http://www.apache.org/licenses/LICENSE-2.0
vcoubard 1077:98d37e26903c 9 *
vcoubard 1077:98d37e26903c 10 * Unless required by applicable law or agreed to in writing, software
vcoubard 1077:98d37e26903c 11 * distributed under the License is distributed on an "AS IS" BASIS,
vcoubard 1077:98d37e26903c 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
vcoubard 1077:98d37e26903c 13 * See the License for the specific language governing permissions and
vcoubard 1077:98d37e26903c 14 * limitations under the License.
vcoubard 1077:98d37e26903c 15 */
vcoubard 1077:98d37e26903c 16
vcoubard 1077:98d37e26903c 17 #ifndef __DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__
vcoubard 1077:98d37e26903c 18 #define __DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__
vcoubard 1077:98d37e26903c 19
vcoubard 1077:98d37e26903c 20 #include "UUID.h"
vcoubard 1077:98d37e26903c 21 #include "Gap.h"
vcoubard 1077:98d37e26903c 22 #include "GattAttribute.h"
vcoubard 1077:98d37e26903c 23 #include "GattClient.h"
vcoubard 1077:98d37e26903c 24 #include "CharacteristicDescriptorDiscovery.h"
vcoubard 1077:98d37e26903c 25
vcoubard 1077:98d37e26903c 26 /**
vcoubard 1077:98d37e26903c 27 * @brief Representation of a descriptor discovered during a GattClient
vcoubard 1077:98d37e26903c 28 * discovery procedure (see GattClient::discoverCharacteristicDescriptors or
vcoubard 1077:98d37e26903c 29 * DiscoveredCharacteristic::discoverDescriptors ).
vcoubard 1077:98d37e26903c 30 *
vcoubard 1077:98d37e26903c 31 * @detail Provide detailed informations about a discovered characteristic descriptor
vcoubard 1077:98d37e26903c 32 * like:
vcoubard 1077:98d37e26903c 33 * - Its UUID (see #getUUID).
vcoubard 1077:98d37e26903c 34 * - Its handle (see #getAttributeHandle)
vcoubard 1077:98d37e26903c 35 * Basic read (see GattClient::read) and write (see GattClient::write) procedure from
vcoubard 1077:98d37e26903c 36 * GattClient can be used access the value of the descriptor.
vcoubard 1077:98d37e26903c 37 *
vcoubard 1077:98d37e26903c 38 * @todo read member function
vcoubard 1077:98d37e26903c 39 * @todo write member function
vcoubard 1077:98d37e26903c 40 * @todo enumeration of standard descriptors
vcoubard 1077:98d37e26903c 41 */
vcoubard 1077:98d37e26903c 42 class DiscoveredCharacteristicDescriptor {
vcoubard 1077:98d37e26903c 43
vcoubard 1077:98d37e26903c 44 public:
vcoubard 1077:98d37e26903c 45
vcoubard 1077:98d37e26903c 46 /**
vcoubard 1077:98d37e26903c 47 * @brief construct a new instance of a DiscoveredCharacteristicDescriptor
vcoubard 1077:98d37e26903c 48 *
vcoubard 1077:98d37e26903c 49 * @param client The client from where the descriptor has been discovered
vcoubard 1077:98d37e26903c 50 * @param connectionHandle The connection handle on which the descriptor has
vcoubard 1077:98d37e26903c 51 * been discovered
vcoubard 1077:98d37e26903c 52 * @param attributeHandle The handle of the attribute containing this descriptor
vcoubard 1077:98d37e26903c 53 * @param uuid The UUID of the descriptor
vcoubard 1077:98d37e26903c 54 */
vcoubard 1077:98d37e26903c 55 DiscoveredCharacteristicDescriptor(
vcoubard 1077:98d37e26903c 56 GattClient* client, Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const UUID& uuid) :
vcoubard 1077:98d37e26903c 57 _client(client), _connectionHandle(connectionHandle), _uuid(uuid), _gattHandle(attributeHandle) {
vcoubard 1077:98d37e26903c 58
vcoubard 1077:98d37e26903c 59 }
vcoubard 1077:98d37e26903c 60
vcoubard 1077:98d37e26903c 61 /**
vcoubard 1077:98d37e26903c 62 * @brief Return the GattClient which can operate on this descriptor.
vcoubard 1077:98d37e26903c 63 * @return The GattClient which can operate on this descriptor.
vcoubard 1077:98d37e26903c 64 */
vcoubard 1077:98d37e26903c 65 GattClient* getGattClient() {
vcoubard 1077:98d37e26903c 66 return _client;
vcoubard 1077:98d37e26903c 67 }
vcoubard 1077:98d37e26903c 68
vcoubard 1077:98d37e26903c 69 /**
vcoubard 1077:98d37e26903c 70 * @brief Return the GattClient which can operate on this descriptor.
vcoubard 1077:98d37e26903c 71 * @return The GattClient which can operate on this descriptor.
vcoubard 1077:98d37e26903c 72 */
vcoubard 1077:98d37e26903c 73 const GattClient* getGattClient() const {
vcoubard 1077:98d37e26903c 74 return _client;
vcoubard 1077:98d37e26903c 75 }
vcoubard 1077:98d37e26903c 76
vcoubard 1077:98d37e26903c 77 /**
vcoubard 1077:98d37e26903c 78 * @brief Return the connection handle to the GattServer which contain
vcoubard 1077:98d37e26903c 79 * this descriptor.
vcoubard 1077:98d37e26903c 80 * @return the connection handle to the GattServer which contain
vcoubard 1077:98d37e26903c 81 * this descriptor.
vcoubard 1077:98d37e26903c 82 */
vcoubard 1077:98d37e26903c 83 Gap::Handle_t getConnectionHandle() const {
vcoubard 1077:98d37e26903c 84 return _connectionHandle;
vcoubard 1077:98d37e26903c 85 }
vcoubard 1077:98d37e26903c 86
vcoubard 1077:98d37e26903c 87 /**
vcoubard 1077:98d37e26903c 88 * @brief Return the UUID of this descriptor
vcoubard 1077:98d37e26903c 89 * @return the UUID of this descriptor
vcoubard 1077:98d37e26903c 90 */
vcoubard 1077:98d37e26903c 91 const UUID& getUUID(void) const {
vcoubard 1077:98d37e26903c 92 return _uuid;
vcoubard 1077:98d37e26903c 93 }
vcoubard 1077:98d37e26903c 94
vcoubard 1077:98d37e26903c 95 /**
vcoubard 1077:98d37e26903c 96 * @brief Return the attribute handle to use to access to this descriptor
vcoubard 1077:98d37e26903c 97 * on the gatt server.
vcoubard 1077:98d37e26903c 98 * @return The attribute handle of the descriptor
vcoubard 1077:98d37e26903c 99 */
vcoubard 1077:98d37e26903c 100 GattAttribute::Handle_t getAttributeHandle() const {
vcoubard 1077:98d37e26903c 101 return _gattHandle;
vcoubard 1077:98d37e26903c 102 }
vcoubard 1077:98d37e26903c 103
vcoubard 1077:98d37e26903c 104 private:
vcoubard 1077:98d37e26903c 105 GattClient *_client;
vcoubard 1077:98d37e26903c 106 Gap::Handle_t _connectionHandle;
vcoubard 1077:98d37e26903c 107 UUID _uuid;
vcoubard 1077:98d37e26903c 108 GattAttribute::Handle_t _gattHandle;
vcoubard 1077:98d37e26903c 109 };
vcoubard 1077:98d37e26903c 110
vcoubard 1077:98d37e26903c 111 #endif /*__DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__*/