Lancaster University's fork of the mbed BLE API. Lives on github, https://github.com/lancaster-university/BLE_API
Dependents: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Revision 1043:18094711b012, committed 2016-01-11
- Comitter:
- vcoubard
- Date:
- Mon Jan 11 08:51:25 2016 +0000
- Parent:
- 1042:21a86ac7f5b1
- Child:
- 1044:15e4bd5951ac
- Commit message:
- Synchronized with git rev 6dd3376c
Author: Vincent Coubard
Add characteristic descriptor discovery API.
Changed in this revision
ble/CharacteristicDescriptorDiscovery.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ble/CharacteristicDescriptorDiscovery.h Mon Jan 11 08:51:25 2016 +0000 @@ -0,0 +1,56 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2015 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ +#define __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ + +#include "FunctionPointerWithContext.h" + +class DiscoveredCharacteristic; +class DiscoveredCharacteristicDescriptor; + +class CharacteristicDescriptorDiscovery { +public: + /* + * Exposed application callback types. + */ + struct DiscoveryCallbackParams_t { + DiscoveredCharacteristic& characteristic; + DiscoveredCharacteristicDescriptor& descriptor; + }; + + struct TerminationCallbackParams_t { + DiscoveredCharacteristic& characteristic; + }; + + /** + * Callback type for when a matching characteristic descriptor is found during + * characteristic descriptor discovery. The receiving function is passed in a + * pointer to a DiscoveredCharacteristicDescriptor object which will remain + * valid for the lifetime of the callback. Memory for this object is owned by + * the BLE_API eventing framework. The application can safely make a persistent + * shallow-copy of this object in order to work with the service beyond the + * callback. + */ + typedef FunctionPointerWithContext<const DiscoveredCharacteristicDescriptor*> DiscoveryCallback_t; + + /** + * Callback type for when characteristic descriptor discovery terminates. + */ + typedef FunctionPointerWithContext<const TerminationCallbackParams_t*> TerminationCallback_t; +}; + +#endif // ifndef __CHARACTERISTIC_DESCRIPTOR_DISCOVERY_H__ \ No newline at end of file