Bike service

Fork of BLE_API by Bluetooth Low Energy

Committer:
vcoubard
Date:
Wed Apr 06 19:13:54 2016 +0100
Revision:
1136:22aada733dbd
Child:
1154:6ea3b6a5cdc7
Synchronized with git rev 17e37360
Author: Vincent Coubard
Merge pull request #161 from ARMmbed/develop

merge branch develop (v2.4.0)

Who changed what in which revision?

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