Bike service

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Wed Dec 02 10:29:44 2015 +0000
Revision:
993:4d62b7967c11
Parent:
992:ca834f7ae8ed
Child:
1042:21a86ac7f5b1
Synchronized with git rev 12e27cd4
Author: Rohit Grover
Release 2.1.3
=============

* Improvements to CallChainOfFunctionPointerswithContext:
- add a `detach` function to be able to remove callbacks.
- detach function now return true if a function has been detached and
false otherwise.
- add a function call operator.
- use safe-bool idiom. see : http://www.artima.com/cppsource/safebool.html

* Add SafeBool class which allow to easily declare a safe bool operator in
c++03.

* Improvements to FunctionPointerWithContext:
- fix call propagation
- use safe bool idiom

* Add config file for generating Doxygen.

* Setup for onRadioNotification callback does not call initRadioNotification
anymore.

* GapAdvertisementData now handles replacement and appending of data fields
based on type. Some fields can be replaced with new values, and others
require the payload to be appended.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 716:11b41f651697 1 /* mbed Microcontroller Library
rgrover1 716:11b41f651697 2 * Copyright (c) 2006-2013 ARM Limited
rgrover1 716:11b41f651697 3 *
rgrover1 716:11b41f651697 4 * Licensed under the Apache License, Version 2.0 (the "License");
rgrover1 716:11b41f651697 5 * you may not use this file except in compliance with the License.
rgrover1 716:11b41f651697 6 * You may obtain a copy of the License at
rgrover1 716:11b41f651697 7 *
rgrover1 716:11b41f651697 8 * http://www.apache.org/licenses/LICENSE-2.0
rgrover1 716:11b41f651697 9 *
rgrover1 716:11b41f651697 10 * Unless required by applicable law or agreed to in writing, software
rgrover1 716:11b41f651697 11 * distributed under the License is distributed on an "AS IS" BASIS,
rgrover1 716:11b41f651697 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rgrover1 716:11b41f651697 13 * See the License for the specific language governing permissions and
rgrover1 716:11b41f651697 14 * limitations under the License.
rgrover1 716:11b41f651697 15 */
rgrover1 716:11b41f651697 16
rgrover1 716:11b41f651697 17 #ifndef __BLE_DEVICE_INSTANCE_BASE__
rgrover1 716:11b41f651697 18 #define __BLE_DEVICE_INSTANCE_BASE__
rgrover1 716:11b41f651697 19
rgrover1 716:11b41f651697 20 #include "Gap.h"
rgrover1 892:9e00f683e927 21 #include "ble/SecurityManager.h"
rgrover1 892:9e00f683e927 22 #include "ble/BLE.h"
rgrover1 716:11b41f651697 23
rgrover1 993:4d62b7967c11 24 /* Forward declarations. */
rgrover1 716:11b41f651697 25 class GattServer;
rgrover1 716:11b41f651697 26 class GattClient;
rgrover1 716:11b41f651697 27
rgrover1 716:11b41f651697 28 /**
rgrover1 716:11b41f651697 29 * The interface for the transport object to be created by the target library's
rgrover1 716:11b41f651697 30 * createBLEInstance().
rgrover1 716:11b41f651697 31 */
rgrover1 716:11b41f651697 32 class BLEInstanceBase
rgrover1 716:11b41f651697 33 {
rgrover1 716:11b41f651697 34 public:
rgrover1 892:9e00f683e927 35 virtual ble_error_t init(BLE::InstanceID_t instanceID,
rgrover1 892:9e00f683e927 36 FunctionPointerWithContext<BLE::InitializationCompleteCallbackContext *> initCallback) = 0;
rgrover1 892:9e00f683e927 37 virtual bool hasInitialized(void) const = 0;
rgrover1 892:9e00f683e927 38 virtual ble_error_t shutdown(void) = 0;
rgrover1 892:9e00f683e927 39 virtual const char * getVersion(void) = 0;
rgrover1 892:9e00f683e927 40 virtual Gap& getGap() = 0;
rgrover1 892:9e00f683e927 41 virtual const Gap& getGap() const = 0;
rgrover1 892:9e00f683e927 42 virtual GattServer& getGattServer() = 0;
rgrover1 892:9e00f683e927 43 virtual const GattServer& getGattServer() const = 0;
rgrover1 892:9e00f683e927 44 virtual GattClient& getGattClient() = 0;
rgrover1 892:9e00f683e927 45 virtual SecurityManager& getSecurityManager() = 0;
rgrover1 716:11b41f651697 46 virtual const SecurityManager& getSecurityManager() const = 0;
rgrover1 892:9e00f683e927 47 virtual void waitForEvent(void) = 0;
rgrover1 716:11b41f651697 48 };
rgrover1 716:11b41f651697 49
rgrover1 716:11b41f651697 50 /**
rgrover1 716:11b41f651697 51 * BLE uses composition to hide an interface object encapsulating the
rgrover1 716:11b41f651697 52 * backend transport.
rgrover1 716:11b41f651697 53 *
rgrover1 716:11b41f651697 54 * The following API is used to create the singleton interface object. An
rgrover1 716:11b41f651697 55 * implementation for this function must be provided by the device-specific
rgrover1 716:11b41f651697 56 * library, otherwise there will be a linker error.
rgrover1 716:11b41f651697 57 */
rgrover1 716:11b41f651697 58 extern BLEInstanceBase *createBLEInstance(void);
rgrover1 716:11b41f651697 59
rgrover1 716:11b41f651697 60 #endif // ifndef __BLE_DEVICE_INSTANCE_BASE__