High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Fri Jun 19 15:53:01 2015 +0100
Revision:
669:7179b4a5aa7d
Parent:
667:875aecb84719
Child:
670:5e4aecd9af5b
Synchronized with git rev 9bcd7433
Author: Rohit Grover
Rename BLEDevice as BLE. Retain an alias to BLEDevice for the sake of compatibility with old code.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 567:e4b38e43de7c 1 /* mbed Microcontroller Library
rgrover1 567:e4b38e43de7c 2 * Copyright (c) 2006-2013 ARM Limited
rgrover1 567:e4b38e43de7c 3 *
rgrover1 567:e4b38e43de7c 4 * Licensed under the Apache License, Version 2.0 (the "License");
rgrover1 567:e4b38e43de7c 5 * you may not use this file except in compliance with the License.
rgrover1 567:e4b38e43de7c 6 * You may obtain a copy of the License at
rgrover1 567:e4b38e43de7c 7 *
rgrover1 567:e4b38e43de7c 8 * http://www.apache.org/licenses/LICENSE-2.0
rgrover1 567:e4b38e43de7c 9 *
rgrover1 567:e4b38e43de7c 10 * Unless required by applicable law or agreed to in writing, software
rgrover1 567:e4b38e43de7c 11 * distributed under the License is distributed on an "AS IS" BASIS,
rgrover1 567:e4b38e43de7c 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rgrover1 567:e4b38e43de7c 13 * See the License for the specific language governing permissions and
rgrover1 567:e4b38e43de7c 14 * limitations under the License.
rgrover1 567:e4b38e43de7c 15 */
rgrover1 567:e4b38e43de7c 16
rgrover1 567:e4b38e43de7c 17 #ifndef __BLE_DEVICE_INSTANCE_BASE__
rgrover1 567:e4b38e43de7c 18 #define __BLE_DEVICE_INSTANCE_BASE__
rgrover1 567:e4b38e43de7c 19
rgrover1 567:e4b38e43de7c 20 /**
rgrover1 567:e4b38e43de7c 21 * The interface for the transport object to be created by the target library's
rgrover1 567:e4b38e43de7c 22 * createBLEDeviceInstance().
rgrover1 567:e4b38e43de7c 23 */
rgrover1 567:e4b38e43de7c 24 class BLEDeviceInstanceBase
rgrover1 567:e4b38e43de7c 25 {
rgrover1 567:e4b38e43de7c 26 public:
rgrover1 669:7179b4a5aa7d 27 virtual ble_error_t init(void) = 0;
rgrover1 669:7179b4a5aa7d 28 virtual ble_error_t shutdown(void) = 0;
rgrover1 669:7179b4a5aa7d 29 virtual ble_error_t reset(void) = 0;
rgrover1 667:875aecb84719 30 virtual const char *getVersion(void) = 0;
rgrover1 667:875aecb84719 31 virtual Gap& getGap() = 0;
rgrover1 667:875aecb84719 32 virtual GattServer& getGattServer() = 0;
rgrover1 567:e4b38e43de7c 33 virtual ble_error_t initializeSecurity(bool enableBonding = true,
rgrover1 567:e4b38e43de7c 34 bool requireMITM = true,
rgrover1 567:e4b38e43de7c 35 Gap::SecurityIOCapabilities_t iocaps = Gap::IO_CAPS_NONE,
rgrover1 567:e4b38e43de7c 36 const Gap::Passkey_t passkey = NULL) = 0;
rgrover1 567:e4b38e43de7c 37 virtual void waitForEvent(void) = 0;
rgrover1 567:e4b38e43de7c 38 };
rgrover1 567:e4b38e43de7c 39
rgrover1 567:e4b38e43de7c 40 /**
rgrover1 567:e4b38e43de7c 41 * BLEDevice uses composition to hide an interface object encapsulating the
rgrover1 567:e4b38e43de7c 42 * backend transport.
rgrover1 567:e4b38e43de7c 43 *
rgrover1 567:e4b38e43de7c 44 * The following API is used to create the singleton interface object. An
rgrover1 567:e4b38e43de7c 45 * implementation for this function must be provided by the device-specific
rgrover1 567:e4b38e43de7c 46 * library, otherwise there will be a linker error.
rgrover1 567:e4b38e43de7c 47 */
rgrover1 567:e4b38e43de7c 48 extern BLEDeviceInstanceBase *createBLEDeviceInstance(void);
rgrover1 567:e4b38e43de7c 49
rgrover1 567:e4b38e43de7c 50 #endif // ifndef __BLE_DEVICE_INSTANCE_BASE__