Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
source/nRF5xGattClient.cpp@547:8550af084edc, 2016-01-11 (annotated)
- Committer:
- vcoubard
- Date:
- Mon Jan 11 10:19:05 2016 +0000
- Revision:
- 547:8550af084edc
- Parent:
- 545:d834e6591aee
- Child:
- 548:920e941cbe1e
Synchronized with git rev c778aa8a
Author: Vincent Coubard
Rename characteristic descriptors discovery activity and termination function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vcoubard | 542:1bf9c597f44f | 1 | /* mbed Microcontroller Library |
vcoubard | 542:1bf9c597f44f | 2 | * Copyright (c) 2006-2013 ARM Limited |
vcoubard | 542:1bf9c597f44f | 3 | * |
vcoubard | 542:1bf9c597f44f | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
vcoubard | 542:1bf9c597f44f | 5 | * you may not use this file except in compliance with the License. |
vcoubard | 542:1bf9c597f44f | 6 | * You may obtain a copy of the License at |
vcoubard | 542:1bf9c597f44f | 7 | * |
vcoubard | 542:1bf9c597f44f | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
vcoubard | 542:1bf9c597f44f | 9 | * |
vcoubard | 542:1bf9c597f44f | 10 | * Unless required by applicable law or agreed to in writing, software |
vcoubard | 542:1bf9c597f44f | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
vcoubard | 542:1bf9c597f44f | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
vcoubard | 542:1bf9c597f44f | 13 | * See the License for the specific language governing permissions and |
vcoubard | 542:1bf9c597f44f | 14 | * limitations under the License. |
vcoubard | 542:1bf9c597f44f | 15 | */ |
vcoubard | 542:1bf9c597f44f | 16 | |
vcoubard | 542:1bf9c597f44f | 17 | #include "nRF5xGattClient.h" |
vcoubard | 542:1bf9c597f44f | 18 | |
vcoubard | 542:1bf9c597f44f | 19 | nRF5xGattClient & |
vcoubard | 542:1bf9c597f44f | 20 | nRF5xGattClient::getInstance(void) { |
vcoubard | 542:1bf9c597f44f | 21 | static nRF5xGattClient* nRFGattClientSingleton = NULL; |
vcoubard | 542:1bf9c597f44f | 22 | if (nRFGattClientSingleton == NULL) { |
vcoubard | 542:1bf9c597f44f | 23 | nRFGattClientSingleton = new nRF5xGattClient(); |
vcoubard | 542:1bf9c597f44f | 24 | } |
vcoubard | 542:1bf9c597f44f | 25 | return *nRFGattClientSingleton; |
vcoubard | 542:1bf9c597f44f | 26 | } |
vcoubard | 542:1bf9c597f44f | 27 | |
vcoubard | 542:1bf9c597f44f | 28 | #if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110) |
vcoubard | 542:1bf9c597f44f | 29 | ble_error_t |
vcoubard | 542:1bf9c597f44f | 30 | nRF5xGattClient::launchServiceDiscovery(Gap::Handle_t connectionHandle, |
vcoubard | 542:1bf9c597f44f | 31 | ServiceDiscovery::ServiceCallback_t sc, |
vcoubard | 542:1bf9c597f44f | 32 | ServiceDiscovery::CharacteristicCallback_t cc, |
vcoubard | 542:1bf9c597f44f | 33 | const UUID &matchingServiceUUIDIn, |
vcoubard | 542:1bf9c597f44f | 34 | const UUID &matchingCharacteristicUUIDIn) |
vcoubard | 542:1bf9c597f44f | 35 | { |
vcoubard | 542:1bf9c597f44f | 36 | return discovery.launch(connectionHandle, sc, cc, matchingServiceUUIDIn, matchingCharacteristicUUIDIn); |
vcoubard | 542:1bf9c597f44f | 37 | } |
vcoubard | 542:1bf9c597f44f | 38 | |
vcoubard | 542:1bf9c597f44f | 39 | ble_error_t nRF5xGattClient::discoverCharacteristicDescriptors( |
vcoubard | 542:1bf9c597f44f | 40 | const DiscoveredCharacteristic& characteristic, |
vcoubard | 545:d834e6591aee | 41 | const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, |
vcoubard | 545:d834e6591aee | 42 | const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback) |
vcoubard | 542:1bf9c597f44f | 43 | { |
vcoubard | 542:1bf9c597f44f | 44 | return characteristicDescriptorDiscoverer.launch( |
vcoubard | 542:1bf9c597f44f | 45 | characteristic, |
vcoubard | 542:1bf9c597f44f | 46 | discoveryCallback, |
vcoubard | 542:1bf9c597f44f | 47 | terminationCallback |
vcoubard | 542:1bf9c597f44f | 48 | ); |
vcoubard | 542:1bf9c597f44f | 49 | } |
vcoubard | 542:1bf9c597f44f | 50 | |
vcoubard | 547:8550af084edc | 51 | bool nRF5xGattClient::isCharacteristicDescriptorsDiscoveryActive(const DiscoveredCharacteristic& characteristic) const { |
vcoubard | 542:1bf9c597f44f | 52 | return characteristicDescriptorDiscoverer.isActive(characteristic); |
vcoubard | 542:1bf9c597f44f | 53 | } |
vcoubard | 542:1bf9c597f44f | 54 | |
vcoubard | 547:8550af084edc | 55 | void nRF5xGattClient::terminateCharacteristicDescriptorsDiscovery(const DiscoveredCharacteristic& characteristic) { |
vcoubard | 542:1bf9c597f44f | 56 | return characteristicDescriptorDiscoverer.requestTerminate(characteristic); |
vcoubard | 542:1bf9c597f44f | 57 | } |
vcoubard | 542:1bf9c597f44f | 58 | |
rgrover1 | 430:db7edc9ad0bc | 59 | #endif |