BLE lib
Fork of Nucleo_BLE_API by
common/BLEDeviceInstanceBase.h@4:f1696bf0e6c6, 2015-02-08 (annotated)
- Committer:
- vijaynvr
- Date:
- Sun Feb 08 14:26:05 2015 +0000
- Revision:
- 4:f1696bf0e6c6
- Parent:
- 0:289fd2dae405
working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sjallouli | 0:289fd2dae405 | 1 | /* mbed Microcontroller Library |
sjallouli | 0:289fd2dae405 | 2 | * Copyright (c) 2006-2013 ARM Limited |
sjallouli | 0:289fd2dae405 | 3 | * |
sjallouli | 0:289fd2dae405 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
sjallouli | 0:289fd2dae405 | 5 | * you may not use this file except in compliance with the License. |
sjallouli | 0:289fd2dae405 | 6 | * You may obtain a copy of the License at |
sjallouli | 0:289fd2dae405 | 7 | * |
sjallouli | 0:289fd2dae405 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
sjallouli | 0:289fd2dae405 | 9 | * |
sjallouli | 0:289fd2dae405 | 10 | * Unless required by applicable law or agreed to in writing, software |
sjallouli | 0:289fd2dae405 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
sjallouli | 0:289fd2dae405 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
sjallouli | 0:289fd2dae405 | 13 | * See the License for the specific language governing permissions and |
sjallouli | 0:289fd2dae405 | 14 | * limitations under the License. |
sjallouli | 0:289fd2dae405 | 15 | */ |
sjallouli | 0:289fd2dae405 | 16 | |
sjallouli | 0:289fd2dae405 | 17 | #ifndef __BLE_DEVICE_INSTANCE_BASE__ |
sjallouli | 0:289fd2dae405 | 18 | #define __BLE_DEVICE_INSTANCE_BASE__ |
sjallouli | 0:289fd2dae405 | 19 | |
sjallouli | 0:289fd2dae405 | 20 | /** |
sjallouli | 0:289fd2dae405 | 21 | * The interface for the transport object to be created by the target library's |
sjallouli | 0:289fd2dae405 | 22 | * createBLEDeviceInstance(). |
sjallouli | 0:289fd2dae405 | 23 | */ |
sjallouli | 0:289fd2dae405 | 24 | class BLEDeviceInstanceBase |
sjallouli | 0:289fd2dae405 | 25 | { |
sjallouli | 0:289fd2dae405 | 26 | public: |
sjallouli | 0:289fd2dae405 | 27 | virtual const char *getVersion(void) = 0; |
sjallouli | 0:289fd2dae405 | 28 | virtual Gap& getGap() = 0; |
sjallouli | 0:289fd2dae405 | 29 | virtual GattServer& getGattServer() = 0; |
sjallouli | 0:289fd2dae405 | 30 | virtual ble_error_t init(void) = 0; |
sjallouli | 0:289fd2dae405 | 31 | virtual ble_error_t reset(void) = 0; |
sjallouli | 0:289fd2dae405 | 32 | virtual ble_error_t setTxPower(int8_t txPower) = 0; |
sjallouli | 0:289fd2dae405 | 33 | virtual void waitForEvent(void) = 0; |
sjallouli | 0:289fd2dae405 | 34 | }; |
sjallouli | 0:289fd2dae405 | 35 | |
sjallouli | 0:289fd2dae405 | 36 | /** |
sjallouli | 0:289fd2dae405 | 37 | * BLEDevice uses composition to hide an interface object encapsulating the |
sjallouli | 0:289fd2dae405 | 38 | * backend transport. |
sjallouli | 0:289fd2dae405 | 39 | * |
sjallouli | 0:289fd2dae405 | 40 | * The following API is used to create the singleton interface object. An |
sjallouli | 0:289fd2dae405 | 41 | * implementation for this function must be provided by the device-specific |
sjallouli | 0:289fd2dae405 | 42 | * library, otherwise there will be a linker error. |
sjallouli | 0:289fd2dae405 | 43 | */ |
sjallouli | 0:289fd2dae405 | 44 | extern BLEDeviceInstanceBase *createBLEDeviceInstance(void); |
sjallouli | 0:289fd2dae405 | 45 | |
sjallouli | 0:289fd2dae405 | 46 | #endif // ifndef __BLE_DEVICE_INSTANCE_BASE__ |