High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
common/BLEDeviceInstanceBase.h@527:493185cebc03, 2015-06-19 (annotated)
- Committer:
- rgrover1
- Date:
- Fri Jun 19 15:52:07 2015 +0100
- Revision:
- 527:493185cebc03
- Parent:
- 526:caa67c3187a0
Synchronized with git rev 532535b1
Author: Rohit Grover
Merge branch 'gattClient' into develop
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rohit Grover |
111:189ff241dae1 | 1 | /* mbed Microcontroller Library |
Rohit Grover |
111:189ff241dae1 | 2 | * Copyright (c) 2006-2013 ARM Limited |
Rohit Grover |
111:189ff241dae1 | 3 | * |
Rohit Grover |
111:189ff241dae1 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Rohit Grover |
111:189ff241dae1 | 5 | * you may not use this file except in compliance with the License. |
Rohit Grover |
111:189ff241dae1 | 6 | * You may obtain a copy of the License at |
Rohit Grover |
111:189ff241dae1 | 7 | * |
Rohit Grover |
111:189ff241dae1 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Rohit Grover |
111:189ff241dae1 | 9 | * |
Rohit Grover |
111:189ff241dae1 | 10 | * Unless required by applicable law or agreed to in writing, software |
Rohit Grover |
111:189ff241dae1 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Rohit Grover |
111:189ff241dae1 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Rohit Grover |
111:189ff241dae1 | 13 | * See the License for the specific language governing permissions and |
Rohit Grover |
111:189ff241dae1 | 14 | * limitations under the License. |
Rohit Grover |
111:189ff241dae1 | 15 | */ |
Rohit Grover |
111:189ff241dae1 | 16 | |
Rohit Grover |
111:189ff241dae1 | 17 | #ifndef __BLE_DEVICE_INSTANCE_BASE__ |
Rohit Grover |
111:189ff241dae1 | 18 | #define __BLE_DEVICE_INSTANCE_BASE__ |
Rohit Grover |
111:189ff241dae1 | 19 | |
rgrover1 | 527:493185cebc03 | 20 | #include "Gap.h" |
rgrover1 | 527:493185cebc03 | 21 | |
rgrover1 | 527:493185cebc03 | 22 | /* forward declarations */ |
rgrover1 | 527:493185cebc03 | 23 | class GattServer; |
rgrover1 | 527:493185cebc03 | 24 | class GattClient; |
rgrover1 | 527:493185cebc03 | 25 | |
Rohit Grover |
111:189ff241dae1 | 26 | /** |
Rohit Grover |
111:189ff241dae1 | 27 | * The interface for the transport object to be created by the target library's |
Rohit Grover |
111:189ff241dae1 | 28 | * createBLEDeviceInstance(). |
Rohit Grover |
111:189ff241dae1 | 29 | */ |
Rohit Grover |
111:189ff241dae1 | 30 | class BLEDeviceInstanceBase |
Rohit Grover |
111:189ff241dae1 | 31 | { |
Rohit Grover |
111:189ff241dae1 | 32 | public: |
rgrover1 | 526:caa67c3187a0 | 33 | virtual ble_error_t init(void) = 0; |
rgrover1 | 526:caa67c3187a0 | 34 | virtual ble_error_t shutdown(void) = 0; |
rgrover1 | 526:caa67c3187a0 | 35 | virtual ble_error_t reset(void) = 0; |
rgrover1 | 524:6e97ab392e2a | 36 | virtual const char *getVersion(void) = 0; |
rgrover1 | 524:6e97ab392e2a | 37 | virtual Gap& getGap() = 0; |
rgrover1 | 524:6e97ab392e2a | 38 | virtual GattServer& getGattServer() = 0; |
rgrover1 | 527:493185cebc03 | 39 | virtual GattClient& getGattClient() = 0; |
rgrover1 | 357:d4bb5d2b837a | 40 | virtual ble_error_t initializeSecurity(bool enableBonding = true, |
rgrover1 | 357:d4bb5d2b837a | 41 | bool requireMITM = true, |
rgrover1 | 357:d4bb5d2b837a | 42 | Gap::SecurityIOCapabilities_t iocaps = Gap::IO_CAPS_NONE, |
rgrover1 | 357:d4bb5d2b837a | 43 | const Gap::Passkey_t passkey = NULL) = 0; |
Rohit Grover |
111:189ff241dae1 | 44 | virtual void waitForEvent(void) = 0; |
Rohit Grover |
111:189ff241dae1 | 45 | }; |
Rohit Grover |
111:189ff241dae1 | 46 | |
Rohit Grover |
111:189ff241dae1 | 47 | /** |
Rohit Grover |
111:189ff241dae1 | 48 | * BLEDevice uses composition to hide an interface object encapsulating the |
Rohit Grover |
111:189ff241dae1 | 49 | * backend transport. |
Rohit Grover |
111:189ff241dae1 | 50 | * |
Rohit Grover |
111:189ff241dae1 | 51 | * The following API is used to create the singleton interface object. An |
Rohit Grover |
111:189ff241dae1 | 52 | * implementation for this function must be provided by the device-specific |
Rohit Grover |
111:189ff241dae1 | 53 | * library, otherwise there will be a linker error. |
Rohit Grover |
111:189ff241dae1 | 54 | */ |
Rohit Grover |
111:189ff241dae1 | 55 | extern BLEDeviceInstanceBase *createBLEDeviceInstance(void); |
Rohit Grover |
111:189ff241dae1 | 56 | |
rgrover1 | 230:2c414d3240a8 | 57 | #endif // ifndef __BLE_DEVICE_INSTANCE_BASE__ |