Lightly modified version of the BLE stack, that doesn't bring up a DFUService by default... as we have our own.
Fork of BLE_API by
common/BLEDevice.cpp@145:a7ded9ad83c8, 2014-11-21 (annotated)
- Committer:
- rgrover1
- Date:
- Fri Nov 21 09:23:25 2014 +0000
- Revision:
- 145:a7ded9ad83c8
- Parent:
- 122:4b68a819ab4f
- Child:
- 260:ea7f9f14cc15
Synchronized with git rev 80f44173
Author: Rohit Grover
Release 0.2.4
=============
Features
~~~~~~~~
* Introduce GattServer::initializeGattDatabase(). This populates the GATT
server with added services.
* Add helper funcs: Gap::MSEC_TO_GAP_DURATION_UNITS() to ease setting up of
connection parameters.
* Enhance connectionEventCallback() to take in peer addr information.
* Minor cleanup of a few public API classes and removal of unnecessary header-file includes.
Bugfixes
~~~~~~~~
* Increase GAP_ADV_PARAMS_INTERVAL_MAX to 0x4000. This addresses mbedmicro/BLE_API/issues/2.
Compatibility
~~~~~~~~~~~~~
One new API has been added (GattServer::initializeGattDatabase()) and
Gap::ConnectionEventCallback_t has been extended. Applications depending on
these should be updated.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rohit Grover |
121:035516234a33 | 1 | /* mbed Microcontroller Library |
Rohit Grover |
121:035516234a33 | 2 | * Copyright (c) 2006-2013 ARM Limited |
Rohit Grover |
121:035516234a33 | 3 | * |
Rohit Grover |
121:035516234a33 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Rohit Grover |
121:035516234a33 | 5 | * you may not use this file except in compliance with the License. |
Rohit Grover |
121:035516234a33 | 6 | * You may obtain a copy of the License at |
Rohit Grover |
121:035516234a33 | 7 | * |
Rohit Grover |
121:035516234a33 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Rohit Grover |
121:035516234a33 | 9 | * |
Rohit Grover |
121:035516234a33 | 10 | * Unless required by applicable law or agreed to in writing, software |
Rohit Grover |
121:035516234a33 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Rohit Grover |
121:035516234a33 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Rohit Grover |
121:035516234a33 | 13 | * See the License for the specific language governing permissions and |
Rohit Grover |
121:035516234a33 | 14 | * limitations under the License. |
Rohit Grover |
121:035516234a33 | 15 | */ |
Rohit Grover |
121:035516234a33 | 16 | |
Rohit Grover |
121:035516234a33 | 17 | #include "BLEDevice.h" |
Rohit Grover |
121:035516234a33 | 18 | |
Rohit Grover |
121:035516234a33 | 19 | #if defined(TARGET_OTA_ENABLED) |
Rohit Grover |
121:035516234a33 | 20 | #include "DFUService.h" |
Rohit Grover |
121:035516234a33 | 21 | #endif |
Rohit Grover |
121:035516234a33 | 22 | |
Rohit Grover |
121:035516234a33 | 23 | ble_error_t |
Rohit Grover |
121:035516234a33 | 24 | BLEDevice::init() |
Rohit Grover |
121:035516234a33 | 25 | { |
Rohit Grover |
121:035516234a33 | 26 | ble_error_t err = transport->init(); |
Rohit Grover |
121:035516234a33 | 27 | if (err != BLE_ERROR_NONE) { |
Rohit Grover |
121:035516234a33 | 28 | return err; |
Rohit Grover |
121:035516234a33 | 29 | } |
Rohit Grover |
121:035516234a33 | 30 | |
Rohit Grover |
121:035516234a33 | 31 | /* Platforms enabled for DFU should introduce the DFU Service into |
Rohit Grover |
121:035516234a33 | 32 | * applications automatically. */ |
Rohit Grover |
121:035516234a33 | 33 | #if defined(TARGET_OTA_ENABLED) |
Rohit Grover |
122:4b68a819ab4f | 34 | static DFUService dfu(*this); // defined static so that the object remains alive |
Rohit Grover |
121:035516234a33 | 35 | #endif // TARGET_OTA_ENABLED |
Rohit Grover |
121:035516234a33 | 36 | |
Rohit Grover |
121:035516234a33 | 37 | return BLE_ERROR_NONE; |
Rohit Grover |
121:035516234a33 | 38 | } |