High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
common/BLEDeviceInstanceBase.h@662:25a8bce7f2e5, 2015-06-19 (annotated)
- Committer:
- rgrover1
- Date:
- Fri Jun 19 15:53:00 2015 +0100
- Revision:
- 662:25a8bce7f2e5
- Parent:
- 661:f1c5136ca57c
- Child:
- 667:875aecb84719
Synchronized with git rev 33e1d6f9
Author: Rohit Grover
minor reordering of APIs in BLEDeviceInstanceBase
Who changed what in which revision?
User | Revision | Line number | New 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 | 662:25a8bce7f2e5 | 27 | virtual ble_error_t init(void) = 0; |
rgrover1 | 662:25a8bce7f2e5 | 28 | virtual ble_error_t shutdown(void) = 0; |
rgrover1 | 662:25a8bce7f2e5 | 29 | virtual ble_error_t reset(void) = 0; |
rgrover1 | 567:e4b38e43de7c | 30 | virtual const char *getVersion(void) = 0; |
rgrover1 | 567:e4b38e43de7c | 31 | virtual Gap& getGap() = 0; |
rgrover1 | 567:e4b38e43de7c | 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__ |