Example for Bluetooth low energy interface

Dependencies:   mbed HC_SR04_Ultrasonic_Library

Committer:
julientiron
Date:
Tue May 19 20:42:25 2015 +0000
Revision:
3:829f081fde15
Parent:
2:b5166e24c7a6
hihi;

Who changed what in which revision?

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