Updated

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Fri Jun 19 15:52:07 2015 +0100
Revision:
528:8d21604fe31d
Child:
529:ccfae9d8e56e
Synchronized with git rev c89eea7a
Author: Rohit Grover
rename BLEDevice as BLE; BLEDeviceInstanceBase as BLEInstanceBase

Who changed what in which revision?

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