Wang Xinglu / BLE_API

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Committer:
Rohit Grover
Date:
Wed May 28 16:52:09 2014 +0100
Revision:
51:0329477be5e2
Parent:
34:da2ea8cd6216
Child:
52:62b9d3b7a689
use initializer list in the constructor for GattCharacteristic

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 27:4a83843f04b0 1 /* mbed Microcontroller Library
ktownsend 27:4a83843f04b0 2 * Copyright (c) 2006-2013 ARM Limited
ktownsend 27:4a83843f04b0 3 *
ktownsend 27:4a83843f04b0 4 * Licensed under the Apache License, Version 2.0 (the "License");
ktownsend 27:4a83843f04b0 5 * you may not use this file except in compliance with the License.
ktownsend 27:4a83843f04b0 6 * You may obtain a copy of the License at
ktownsend 27:4a83843f04b0 7 *
ktownsend 27:4a83843f04b0 8 * http://www.apache.org/licenses/LICENSE-2.0
ktownsend 27:4a83843f04b0 9 *
ktownsend 27:4a83843f04b0 10 * Unless required by applicable law or agreed to in writing, software
ktownsend 27:4a83843f04b0 11 * distributed under the License is distributed on an "AS IS" BASIS,
ktownsend 27:4a83843f04b0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ktownsend 27:4a83843f04b0 13 * See the License for the specific language governing permissions and
ktownsend 27:4a83843f04b0 14 * limitations under the License.
ktownsend 27:4a83843f04b0 15 */
Rohit Grover 34:da2ea8cd6216 16
ktownsend 2:ffc5216bd2cc 17 #include <stdio.h>
ktownsend 2:ffc5216bd2cc 18 #include <string.h>
ktownsend 2:ffc5216bd2cc 19
ktownsend 2:ffc5216bd2cc 20 #include "GattCharacteristic.h"
ktownsend 2:ffc5216bd2cc 21
ktownsend 2:ffc5216bd2cc 22 /**************************************************************************/
ktownsend 2:ffc5216bd2cc 23 /*!
ktownsend 2:ffc5216bd2cc 24 @brief Creates a new GattCharacteristic using the specified 16-bit
ktownsend 2:ffc5216bd2cc 25 UUID, value length, and properties
Rohit Grover 34:da2ea8cd6216 26
ktownsend 2:ffc5216bd2cc 27 @note The UUID value must be unique in the service and is normally >1
ktownsend 2:ffc5216bd2cc 28
ktownsend 2:ffc5216bd2cc 29 @param[in] id
ktownsend 2:ffc5216bd2cc 30 The 16-bit UUID to use for this characteristic
ktownsend 2:ffc5216bd2cc 31 @param[in] minLen
ktownsend 2:ffc5216bd2cc 32 The min length in bytes of this characteristic's value
ktownsend 2:ffc5216bd2cc 33 @param[in] maxLen
ktownsend 2:ffc5216bd2cc 34 The max length in bytes of this characteristic's value
ktownsend 2:ffc5216bd2cc 35 @param[in] props
ktownsend 2:ffc5216bd2cc 36 The 8-bit bit field containing the characteristic's
ktownsend 2:ffc5216bd2cc 37 properties
ktownsend 2:ffc5216bd2cc 38
ktownsend 2:ffc5216bd2cc 39 @section EXAMPLE
ktownsend 2:ffc5216bd2cc 40
ktownsend 2:ffc5216bd2cc 41 @code
ktownsend 2:ffc5216bd2cc 42
ktownsend 2:ffc5216bd2cc 43 // UUID = 0x2A19, Min length 2, Max len = 2, Properties = write
ktownsend 4:50a31ff5f974 44 GattCharacteristic c = GattCharacteristic( 0x2A19, 2, 2, BLE_GATT_CHAR_PROPERTIES_WRITE );
Rohit Grover 34:da2ea8cd6216 45
ktownsend 2:ffc5216bd2cc 46 @endcode
ktownsend 2:ffc5216bd2cc 47 */
ktownsend 2:ffc5216bd2cc 48 /**************************************************************************/
Rohit Grover 34:da2ea8cd6216 49 GattCharacteristic::GattCharacteristic(uint16_t id,
Rohit Grover 34:da2ea8cd6216 50 uint16_t minLen,
Rohit Grover 34:da2ea8cd6216 51 uint16_t maxLen,
Rohit Grover 51:0329477be5e2 52 uint8_t props) :
Rohit Grover 51:0329477be5e2 53 uuid(id),
Rohit Grover 51:0329477be5e2 54 lenMin(minLen),
Rohit Grover 51:0329477be5e2 55 lenMax(maxLen),
Rohit Grover 51:0329477be5e2 56 handle(),
Rohit Grover 51:0329477be5e2 57 properties(props)
ktownsend 2:ffc5216bd2cc 58 {
Rohit Grover 51:0329477be5e2 59 /* empty */
ktownsend 2:ffc5216bd2cc 60 }
ktownsend 2:ffc5216bd2cc 61
ktownsend 2:ffc5216bd2cc 62 /**************************************************************************/
ktownsend 2:ffc5216bd2cc 63 /*!
ktownsend 2:ffc5216bd2cc 64 Destructor
ktownsend 2:ffc5216bd2cc 65 */
ktownsend 2:ffc5216bd2cc 66 /**************************************************************************/
ktownsend 2:ffc5216bd2cc 67 GattCharacteristic::~GattCharacteristic(void)
ktownsend 2:ffc5216bd2cc 68 {
ktownsend 2:ffc5216bd2cc 69 }