jgh
Fork of BLE_API by
ble/DiscoveredCharacteristicDescriptor.h@1044:15e4bd5951ac, 2016-01-11 (annotated)
- Committer:
- vcoubard
- Date:
- Mon Jan 11 08:51:26 2016 +0000
- Revision:
- 1044:15e4bd5951ac
- Child:
- 1067:350b4b04eeda
Synchronized with git rev c9261773
Author: Vincent Coubard
Improve interface for CharacteristicDescriptorDiscovery:
CharacteristicDescriptorDiscovery::DiscoveryCallback_t take a
DiscoveryCallBackParam instead of just the discovered descriptor
DiscoveredCharacteristicDescriptor is now a plain type.
DiscoveredCharacteristic support operator==
DiscoveredCharacteristic::Properties-t support operator==
DiscoveredCharacteristic now include the last Gatt handle of this
characteristic
FunctionPointer with context call() is now const, in order to mirror
std::function and call a const FunctionPointerWithContext
FunctionPointerWithContext support operator ==
GattClient support basic characteristic descriptor discovery operations
The implementation of DiscoveredCharacteristic::discoverDescriptors is now
fullfiled.
Who changed what in which revision?
User | Revision | Line number | New 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 | 1044:15e4bd5951ac | 27 | /** |
vcoubard | 1044:15e4bd5951ac | 28 | * |
vcoubard | 1044:15e4bd5951ac | 29 | */ |
vcoubard | 1044:15e4bd5951ac | 30 | class DiscoveredCharacteristicDescriptor { |
vcoubard | 1044:15e4bd5951ac | 31 | |
vcoubard | 1044:15e4bd5951ac | 32 | public: |
vcoubard | 1044:15e4bd5951ac | 33 | DiscoveredCharacteristicDescriptor( |
vcoubard | 1044:15e4bd5951ac | 34 | GattClient* client, Gap::Handle_t connectionHandle, GattAttribute::Handle_t gattHandle, const UUID& uuid) : |
vcoubard | 1044:15e4bd5951ac | 35 | _client(client), _connectionHandle(connectionHandle), _uuid(uuid), _gattHandle(gattHandle) { |
vcoubard | 1044:15e4bd5951ac | 36 | |
vcoubard | 1044:15e4bd5951ac | 37 | } |
vcoubard | 1044:15e4bd5951ac | 38 | |
vcoubard | 1044:15e4bd5951ac | 39 | GattClient* client() { |
vcoubard | 1044:15e4bd5951ac | 40 | return _client; |
vcoubard | 1044:15e4bd5951ac | 41 | } |
vcoubard | 1044:15e4bd5951ac | 42 | |
vcoubard | 1044:15e4bd5951ac | 43 | const GattClient* client() const { |
vcoubard | 1044:15e4bd5951ac | 44 | return _client; |
vcoubard | 1044:15e4bd5951ac | 45 | } |
vcoubard | 1044:15e4bd5951ac | 46 | |
vcoubard | 1044:15e4bd5951ac | 47 | Gap::Handle_t connectionHandle() const { |
vcoubard | 1044:15e4bd5951ac | 48 | return _connectionHandle; |
vcoubard | 1044:15e4bd5951ac | 49 | } |
vcoubard | 1044:15e4bd5951ac | 50 | |
vcoubard | 1044:15e4bd5951ac | 51 | const UUID& uuid(void) const { |
vcoubard | 1044:15e4bd5951ac | 52 | return _uuid; |
vcoubard | 1044:15e4bd5951ac | 53 | } |
vcoubard | 1044:15e4bd5951ac | 54 | |
vcoubard | 1044:15e4bd5951ac | 55 | GattAttribute::Handle_t gattHandle() const { |
vcoubard | 1044:15e4bd5951ac | 56 | return _gattHandle; |
vcoubard | 1044:15e4bd5951ac | 57 | } |
vcoubard | 1044:15e4bd5951ac | 58 | |
vcoubard | 1044:15e4bd5951ac | 59 | private: |
vcoubard | 1044:15e4bd5951ac | 60 | GattClient *_client; |
vcoubard | 1044:15e4bd5951ac | 61 | Gap::Handle_t _connectionHandle; |
vcoubard | 1044:15e4bd5951ac | 62 | UUID _uuid; |
vcoubard | 1044:15e4bd5951ac | 63 | GattAttribute::Handle_t _gattHandle; |
vcoubard | 1044:15e4bd5951ac | 64 | }; |
vcoubard | 1044:15e4bd5951ac | 65 | |
vcoubard | 1044:15e4bd5951ac | 66 | #endif /*__DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__*/ |