士鈞 林 / Mbed OS 12_1

Dependencies:   X_NUCLEO_IKS01A2

Committer:
jim_lsj
Date:
Wed Apr 29 10:42:44 2020 +0000
Revision:
0:9c0e0ac79e75
12_1

Who changed what in which revision?

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