High level Bluetooth Low Energy API and radio abstraction layer

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Fri Jun 19 15:52:08 2015 +0100
Revision:
538:fff02872b62f
Parent:
536:04f829bee2e2
Child:
546:9fdf3d960d12
Synchronized with git rev 42aaf6bb
Author: Rohit Grover
add BLE::gattServer()

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 538:fff02872b62f 33 virtual ble_error_t init(void) = 0;
rgrover1 538:fff02872b62f 34 virtual ble_error_t shutdown(void) = 0;
rgrover1 538:fff02872b62f 35 virtual const char *getVersion(void) = 0;
rgrover1 538:fff02872b62f 36 virtual Gap& getGap() = 0;
rgrover1 538:fff02872b62f 37 virtual const Gap& getGap() const = 0;
rgrover1 538:fff02872b62f 38 virtual GattServer& getGattServer() = 0;
rgrover1 538:fff02872b62f 39 virtual const GattServer& getGattServer() const = 0;
rgrover1 538:fff02872b62f 40 virtual GattClient& getGattClient() = 0;
rgrover1 528:8d21604fe31d 41 virtual ble_error_t initializeSecurity(bool enableBonding = true,
rgrover1 528:8d21604fe31d 42 bool requireMITM = true,
rgrover1 528:8d21604fe31d 43 Gap::SecurityIOCapabilities_t iocaps = Gap::IO_CAPS_NONE,
rgrover1 528:8d21604fe31d 44 const Gap::Passkey_t passkey = NULL) = 0;
rgrover1 528:8d21604fe31d 45 virtual void waitForEvent(void) = 0;
rgrover1 528:8d21604fe31d 46 };
rgrover1 528:8d21604fe31d 47
rgrover1 528:8d21604fe31d 48 /**
rgrover1 528:8d21604fe31d 49 * BLE uses composition to hide an interface object encapsulating the
rgrover1 528:8d21604fe31d 50 * backend transport.
rgrover1 528:8d21604fe31d 51 *
rgrover1 528:8d21604fe31d 52 * The following API is used to create the singleton interface object. An
rgrover1 528:8d21604fe31d 53 * implementation for this function must be provided by the device-specific
rgrover1 528:8d21604fe31d 54 * library, otherwise there will be a linker error.
rgrover1 528:8d21604fe31d 55 */
rgrover1 528:8d21604fe31d 56 extern BLEInstanceBase *createBLEInstance(void);
rgrover1 528:8d21604fe31d 57
rgrover1 528:8d21604fe31d 58 #endif // ifndef __BLE_DEVICE_INSTANCE_BASE__