Nano RGB LED mesh

Dependencies:   nrf51-sdk

Dependents:   BLENano_Mesh

Fork of nRF51822 by Nordic Semiconductor

Committer:
rgrover1
Date:
Tue Aug 11 15:14:23 2015 +0100
Revision:
416:5b7d26035f2b
Parent:
415:92bda1851be2
Child:
417:d79a89cccddd
Synchronized with git rev 3eabc779
Author: Jean-Philippe Brucker
Disable GattClient features when using S110 SoftDevice

S110 compatibility is already present, but this patch adds proper handling
of observer/central related features:
* Gap::startScan will return BLE_ERRROR_NOT_IMPLEMENTED (instead of
PARAM_OUT_OF_RANGE)
* nRF5xGattClient uses the default GattClient implementation when S110 is
in use. All if its methods return NOT_IMPLEMENTED.

Example: for an application that acts as both a central and a peripheral,
using S110 will make the ble.gap().startScan() call return
BLE_ERROR_NOT_IMPLEMENTED, and advertisement features will continue
running normally.
In addition, with GCC, this patch will free 344 bytes of RAM and 2504
bytes of flash.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 388:db85a09c27ef 1 /* mbed Microcontroller Library
rgrover1 388:db85a09c27ef 2 * Copyright (c) 2006-2013 ARM Limited
rgrover1 388:db85a09c27ef 3 *
rgrover1 388:db85a09c27ef 4 * Licensed under the Apache License, Version 2.0 (the "License");
rgrover1 388:db85a09c27ef 5 * you may not use this file except in compliance with the License.
rgrover1 388:db85a09c27ef 6 * You may obtain a copy of the License at
rgrover1 388:db85a09c27ef 7 *
rgrover1 388:db85a09c27ef 8 * http://www.apache.org/licenses/LICENSE-2.0
rgrover1 388:db85a09c27ef 9 *
rgrover1 388:db85a09c27ef 10 * Unless required by applicable law or agreed to in writing, software
rgrover1 388:db85a09c27ef 11 * distributed under the License is distributed on an "AS IS" BASIS,
rgrover1 388:db85a09c27ef 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rgrover1 388:db85a09c27ef 13 * See the License for the specific language governing permissions and
rgrover1 388:db85a09c27ef 14 * limitations under the License.
rgrover1 388:db85a09c27ef 15 */
rgrover1 388:db85a09c27ef 16
rgrover1 388:db85a09c27ef 17 #include "nRF5xGattClient.h"
rgrover1 388:db85a09c27ef 18
rgrover1 415:92bda1851be2 19 nRF5xGattClient nRFGattClientSingleton;
rgrover1 415:92bda1851be2 20
rgrover1 388:db85a09c27ef 21 nRF5xGattClient &
rgrover1 388:db85a09c27ef 22 nRF5xGattClient::getInstance(void) {
rgrover1 388:db85a09c27ef 23 return nRFGattClientSingleton;
rgrover1 388:db85a09c27ef 24 }
rgrover1 388:db85a09c27ef 25
rgrover1 416:5b7d26035f2b 26 #if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110)
rgrover1 388:db85a09c27ef 27 ble_error_t
rgrover1 388:db85a09c27ef 28 nRF5xGattClient::launchServiceDiscovery(Gap::Handle_t connectionHandle,
rgrover1 388:db85a09c27ef 29 ServiceDiscovery::ServiceCallback_t sc,
rgrover1 388:db85a09c27ef 30 ServiceDiscovery::CharacteristicCallback_t cc,
rgrover1 388:db85a09c27ef 31 const UUID &matchingServiceUUIDIn,
rgrover1 388:db85a09c27ef 32 const UUID &matchingCharacteristicUUIDIn)
rgrover1 388:db85a09c27ef 33 {
rgrover1 388:db85a09c27ef 34 return discovery.launch(connectionHandle, sc, cc, matchingServiceUUIDIn, matchingCharacteristicUUIDIn);
rgrover1 416:5b7d26035f2b 35 }
rgrover1 416:5b7d26035f2b 36 #endif