sa
Fork of nRF51822 by
TARGET_MCU_NRF51822/source/nRF5xGattClient.cpp@639:fdeb2820ef26, 2016-12-29 (annotated)
- Committer:
- nakamae
- Date:
- Thu Dec 29 07:05:48 2016 +0000
- Revision:
- 639:fdeb2820ef26
- Parent:
- 638:c90ae1400bf2
new;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vincent Coubard |
638:c90ae1400bf2 | 1 | /* mbed Microcontroller Library |
Vincent Coubard |
638:c90ae1400bf2 | 2 | * Copyright (c) 2006-2013 ARM Limited |
Vincent Coubard |
638:c90ae1400bf2 | 3 | * |
Vincent Coubard |
638:c90ae1400bf2 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Vincent Coubard |
638:c90ae1400bf2 | 5 | * you may not use this file except in compliance with the License. |
Vincent Coubard |
638:c90ae1400bf2 | 6 | * You may obtain a copy of the License at |
Vincent Coubard |
638:c90ae1400bf2 | 7 | * |
Vincent Coubard |
638:c90ae1400bf2 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Vincent Coubard |
638:c90ae1400bf2 | 9 | * |
Vincent Coubard |
638:c90ae1400bf2 | 10 | * Unless required by applicable law or agreed to in writing, software |
Vincent Coubard |
638:c90ae1400bf2 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Vincent Coubard |
638:c90ae1400bf2 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Vincent Coubard |
638:c90ae1400bf2 | 13 | * See the License for the specific language governing permissions and |
Vincent Coubard |
638:c90ae1400bf2 | 14 | * limitations under the License. |
Vincent Coubard |
638:c90ae1400bf2 | 15 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 16 | |
Vincent Coubard |
638:c90ae1400bf2 | 17 | #include "nRF5xGattClient.h" |
Vincent Coubard |
638:c90ae1400bf2 | 18 | |
Vincent Coubard |
638:c90ae1400bf2 | 19 | #if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110) |
Vincent Coubard |
638:c90ae1400bf2 | 20 | ble_error_t |
Vincent Coubard |
638:c90ae1400bf2 | 21 | nRF5xGattClient::launchServiceDiscovery(Gap::Handle_t connectionHandle, |
Vincent Coubard |
638:c90ae1400bf2 | 22 | ServiceDiscovery::ServiceCallback_t sc, |
Vincent Coubard |
638:c90ae1400bf2 | 23 | ServiceDiscovery::CharacteristicCallback_t cc, |
Vincent Coubard |
638:c90ae1400bf2 | 24 | const UUID &matchingServiceUUIDIn, |
Vincent Coubard |
638:c90ae1400bf2 | 25 | const UUID &matchingCharacteristicUUIDIn) |
Vincent Coubard |
638:c90ae1400bf2 | 26 | { |
Vincent Coubard |
638:c90ae1400bf2 | 27 | return _discovery.launch(connectionHandle, sc, cc, matchingServiceUUIDIn, matchingCharacteristicUUIDIn); |
Vincent Coubard |
638:c90ae1400bf2 | 28 | } |
Vincent Coubard |
638:c90ae1400bf2 | 29 | |
Vincent Coubard |
638:c90ae1400bf2 | 30 | ble_error_t nRF5xGattClient::discoverCharacteristicDescriptors( |
Vincent Coubard |
638:c90ae1400bf2 | 31 | const DiscoveredCharacteristic& characteristic, |
Vincent Coubard |
638:c90ae1400bf2 | 32 | const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, |
Vincent Coubard |
638:c90ae1400bf2 | 33 | const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback) |
Vincent Coubard |
638:c90ae1400bf2 | 34 | { |
Vincent Coubard |
638:c90ae1400bf2 | 35 | return _characteristicDescriptorDiscoverer.launch( |
Vincent Coubard |
638:c90ae1400bf2 | 36 | characteristic, |
Vincent Coubard |
638:c90ae1400bf2 | 37 | discoveryCallback, |
Vincent Coubard |
638:c90ae1400bf2 | 38 | terminationCallback |
Vincent Coubard |
638:c90ae1400bf2 | 39 | ); |
Vincent Coubard |
638:c90ae1400bf2 | 40 | } |
Vincent Coubard |
638:c90ae1400bf2 | 41 | |
Vincent Coubard |
638:c90ae1400bf2 | 42 | bool nRF5xGattClient::isCharacteristicDescriptorsDiscoveryActive(const DiscoveredCharacteristic& characteristic) const { |
Vincent Coubard |
638:c90ae1400bf2 | 43 | return _characteristicDescriptorDiscoverer.isActive(characteristic); |
Vincent Coubard |
638:c90ae1400bf2 | 44 | } |
Vincent Coubard |
638:c90ae1400bf2 | 45 | |
Vincent Coubard |
638:c90ae1400bf2 | 46 | void nRF5xGattClient::terminateCharacteristicDescriptorsDiscovery(const DiscoveredCharacteristic& characteristic) { |
Vincent Coubard |
638:c90ae1400bf2 | 47 | return _characteristicDescriptorDiscoverer.requestTerminate(characteristic); |
Vincent Coubard |
638:c90ae1400bf2 | 48 | } |
Vincent Coubard |
638:c90ae1400bf2 | 49 | |
Vincent Coubard |
638:c90ae1400bf2 | 50 | #endif |