High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
ble/CharacteristicDescriptorDiscovery.h@1043:18094711b012, 2016-01-11 (annotated)
- Committer:
- vcoubard
- Date:
- Mon Jan 11 08:51:25 2016 +0000
- Revision:
- 1043:18094711b012
- Child:
- 1045:b9d15970040f
Synchronized with git rev 6dd3376c
Author: Vincent Coubard
Add characteristic descriptor discovery API.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vcoubard | 1043:18094711b012 | 1 | /* mbed Microcontroller Library |
vcoubard | 1043:18094711b012 | 2 | * Copyright (c) 2006-2015 ARM Limited |
vcoubard | 1043:18094711b012 | 3 | * |
vcoubard | 1043:18094711b012 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
vcoubard | 1043:18094711b012 | 5 | * you may not use this file except in compliance with the License. |
vcoubard | 1043:18094711b012 | 6 | * You may obtain a copy of the License at |
vcoubard | 1043:18094711b012 | 7 | * |
vcoubard | 1043:18094711b012 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
vcoubard | 1043:18094711b012 | 9 | * |
vcoubard | 1043:18094711b012 | 10 | * Unless required by applicable law or agreed to in writing, software |
vcoubard | 1043:18094711b012 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
vcoubard | 1043:18094711b012 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
vcoubard | 1043:18094711b012 | 13 | * See the License for the specific language governing permissions and |
vcoubard | 1043:18094711b012 | 14 | * limitations under the License. |
vcoubard | 1043:18094711b012 | 15 | */ |
vcoubard | 1043:18094711b012 | 16 | |
vcoubard | 1043:18094711b012 | 17 | #ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ |
vcoubard | 1043:18094711b012 | 18 | #define __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ |
vcoubard | 1043:18094711b012 | 19 | |
vcoubard | 1043:18094711b012 | 20 | #include "FunctionPointerWithContext.h" |
vcoubard | 1043:18094711b012 | 21 | |
vcoubard | 1043:18094711b012 | 22 | class DiscoveredCharacteristic; |
vcoubard | 1043:18094711b012 | 23 | class DiscoveredCharacteristicDescriptor; |
vcoubard | 1043:18094711b012 | 24 | |
vcoubard | 1043:18094711b012 | 25 | class CharacteristicDescriptorDiscovery { |
vcoubard | 1043:18094711b012 | 26 | public: |
vcoubard | 1043:18094711b012 | 27 | /* |
vcoubard | 1043:18094711b012 | 28 | * Exposed application callback types. |
vcoubard | 1043:18094711b012 | 29 | */ |
vcoubard | 1043:18094711b012 | 30 | struct DiscoveryCallbackParams_t { |
vcoubard | 1043:18094711b012 | 31 | DiscoveredCharacteristic& characteristic; |
vcoubard | 1043:18094711b012 | 32 | DiscoveredCharacteristicDescriptor& descriptor; |
vcoubard | 1043:18094711b012 | 33 | }; |
vcoubard | 1043:18094711b012 | 34 | |
vcoubard | 1043:18094711b012 | 35 | struct TerminationCallbackParams_t { |
vcoubard | 1043:18094711b012 | 36 | DiscoveredCharacteristic& characteristic; |
vcoubard | 1043:18094711b012 | 37 | }; |
vcoubard | 1043:18094711b012 | 38 | |
vcoubard | 1043:18094711b012 | 39 | /** |
vcoubard | 1043:18094711b012 | 40 | * Callback type for when a matching characteristic descriptor is found during |
vcoubard | 1043:18094711b012 | 41 | * characteristic descriptor discovery. The receiving function is passed in a |
vcoubard | 1043:18094711b012 | 42 | * pointer to a DiscoveredCharacteristicDescriptor object which will remain |
vcoubard | 1043:18094711b012 | 43 | * valid for the lifetime of the callback. Memory for this object is owned by |
vcoubard | 1043:18094711b012 | 44 | * the BLE_API eventing framework. The application can safely make a persistent |
vcoubard | 1043:18094711b012 | 45 | * shallow-copy of this object in order to work with the service beyond the |
vcoubard | 1043:18094711b012 | 46 | * callback. |
vcoubard | 1043:18094711b012 | 47 | */ |
vcoubard | 1043:18094711b012 | 48 | typedef FunctionPointerWithContext<const DiscoveredCharacteristicDescriptor*> DiscoveryCallback_t; |
vcoubard | 1043:18094711b012 | 49 | |
vcoubard | 1043:18094711b012 | 50 | /** |
vcoubard | 1043:18094711b012 | 51 | * Callback type for when characteristic descriptor discovery terminates. |
vcoubard | 1043:18094711b012 | 52 | */ |
vcoubard | 1043:18094711b012 | 53 | typedef FunctionPointerWithContext<const TerminationCallbackParams_t*> TerminationCallback_t; |
vcoubard | 1043:18094711b012 | 54 | }; |
vcoubard | 1043:18094711b012 | 55 | |
vcoubard | 1043:18094711b012 | 56 | #endif // ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ |