prova invio BLE

Dependents:   BLE_HeartRate_IDB04A1

Fork of BLE_API by Bluetooth Low Energy

Committer:
vcoubard
Date:
Mon Jan 11 08:51:26 2016 +0000
Revision:
1045:b9d15970040f
Parent:
1043:18094711b012
Synchronized with git rev 62a1c4a9
Author: Vincent Coubard
Improve Characteristic descriptor discovery:

- all member of
CharacteristicDescriptorDiscovery::DiscoveryCallbackParams_t are now
const by default
- CharacteristicDescriptorDiscovery::TerminationCallbackParams_t now
accept a status parameter which indicate if the operation ends properly
or not
- Remove DiscoveredCharacteristicDescriptor declaration from
DiscoveredCharacteristic.h file
- Add comparison operation to DiscoveredCharacteristic::Properties_t type
- Add lastHandle member to DiscoveredCharacteristic
- Add equality operator to DiscoveredCharacteristic
- make FunctionPointerWithContext call operation const, so that it mirror
std::function and allow to call this kind of objects to be called when
they are passed by const reference
- Add primitive operations to GattClient for dicovering characteristic
descriptors
- Fullfil DiscoveredCharacteristic::discoverDescriptors function
implementation

Who changed what in which revision?

UserRevisionLine numberNew 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 1045:b9d15970040f 31 const DiscoveredCharacteristic& characteristic;
vcoubard 1045:b9d15970040f 32 const DiscoveredCharacteristicDescriptor& descriptor;
vcoubard 1043:18094711b012 33 };
vcoubard 1043:18094711b012 34
vcoubard 1043:18094711b012 35 struct TerminationCallbackParams_t {
vcoubard 1045:b9d15970040f 36 const DiscoveredCharacteristic& characteristic;
vcoubard 1045:b9d15970040f 37 ble_error_t status;
vcoubard 1043:18094711b012 38 };
vcoubard 1043:18094711b012 39
vcoubard 1043:18094711b012 40 /**
vcoubard 1043:18094711b012 41 * Callback type for when a matching characteristic descriptor is found during
vcoubard 1043:18094711b012 42 * characteristic descriptor discovery. The receiving function is passed in a
vcoubard 1045:b9d15970040f 43 * pointer to a DiscoveryCallbackParams_t object which will remain
vcoubard 1043:18094711b012 44 * valid for the lifetime of the callback. Memory for this object is owned by
vcoubard 1043:18094711b012 45 * the BLE_API eventing framework. The application can safely make a persistent
vcoubard 1043:18094711b012 46 * shallow-copy of this object in order to work with the service beyond the
vcoubard 1043:18094711b012 47 * callback.
vcoubard 1043:18094711b012 48 */
vcoubard 1045:b9d15970040f 49 typedef FunctionPointerWithContext<const DiscoveryCallbackParams_t*> DiscoveryCallback_t;
vcoubard 1043:18094711b012 50
vcoubard 1043:18094711b012 51 /**
vcoubard 1043:18094711b012 52 * Callback type for when characteristic descriptor discovery terminates.
vcoubard 1043:18094711b012 53 */
vcoubard 1043:18094711b012 54 typedef FunctionPointerWithContext<const TerminationCallbackParams_t*> TerminationCallback_t;
vcoubard 1043:18094711b012 55 };
vcoubard 1043:18094711b012 56
vcoubard 1043:18094711b012 57 #endif // ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__