just a fork

Fork of BLE_API by Bluetooth Low Energy

Committer:
vcoubard
Date:
Mon Jan 11 08:51:40 2016 +0000
Revision:
1069:ec5549427b4a
Parent:
1068:704b281b4ba0
Child:
1071:4210304cfbe3
Synchronized with git rev d7700bcc
Author: Vincent Coubard
Improve documentation of DiscoveredCharacteristicDescriptor

Who changed what in which revision?

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