fork BLE_API to add update adv payload API

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Thu Jul 02 09:06:11 2015 +0100
Revision:
714:a6130aaa0fd9
Parent:
567:e4b38e43de7c
Child:
634:c351328ff134
Synchronized with git rev 7e8977d8
Author: Rohit Grover
Release 0.3.8
=============

This is a minor set of enhancements before we yotta-ize BLE_API.

Enhancements
~~~~~~~~~~~~

* Minor rework for class UUID; added a default and copy constructor; and a != operator.

* Added copy constructor and accessors for GapAdvertisingParams.

* GapScanningParams:: remove unnecessary checks for SCAN_TIMEOUT_MAX.

* Add a comment header block to explain why BLEDevice::init() may not be safe
to call from global static context.

* Introduce GattAttribute::INVALID_HANDLE.

* Replace some deprecated uses of Gap::address_t with Gap::Address_t.

Bugfixes
~~~~~~~~

* None.

Who changed what in which revision?

UserRevisionLine numberNew 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 567:e4b38e43de7c 27 virtual const char *getVersion(void) = 0;
rgrover1 567:e4b38e43de7c 28 virtual Gap& getGap() = 0;
rgrover1 567:e4b38e43de7c 29 virtual GattServer& getGattServer() = 0;
rgrover1 567:e4b38e43de7c 30 virtual ble_error_t init(void) = 0;
rgrover1 567:e4b38e43de7c 31 virtual ble_error_t shutdown(void) = 0;
rgrover1 567:e4b38e43de7c 32 virtual ble_error_t reset(void) = 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 ble_error_t setTxPower(int8_t txPower) = 0;
rgrover1 567:e4b38e43de7c 38 virtual void getPermittedTxPowerValues(const int8_t **, size_t *) = 0;
rgrover1 567:e4b38e43de7c 39 virtual void waitForEvent(void) = 0;
rgrover1 567:e4b38e43de7c 40 };
rgrover1 567:e4b38e43de7c 41
rgrover1 567:e4b38e43de7c 42 /**
rgrover1 567:e4b38e43de7c 43 * BLEDevice uses composition to hide an interface object encapsulating the
rgrover1 567:e4b38e43de7c 44 * backend transport.
rgrover1 567:e4b38e43de7c 45 *
rgrover1 567:e4b38e43de7c 46 * The following API is used to create the singleton interface object. An
rgrover1 567:e4b38e43de7c 47 * implementation for this function must be provided by the device-specific
rgrover1 567:e4b38e43de7c 48 * library, otherwise there will be a linker error.
rgrover1 567:e4b38e43de7c 49 */
rgrover1 567:e4b38e43de7c 50 extern BLEDeviceInstanceBase *createBLEDeviceInstance(void);
rgrover1 567:e4b38e43de7c 51
rgrover1 567:e4b38e43de7c 52 #endif // ifndef __BLE_DEVICE_INSTANCE_BASE__