VNG board

Fork of BLE_API by Bluetooth Low Energy

Committer:
rgrover1
Date:
Fri Dec 12 15:52:48 2014 +0000
Revision:
254:fb2a891a0d98
Parent:
122:4b68a819ab4f
Synchronized with git rev c7d406c2
Author: Rohit Grover
ServiceDataPayload can have a maximum of 18 bytes of URIData.

fixes #6

Who changed what in which revision?

UserRevisionLine numberNew 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 }