Wang Xinglu / BLE_API

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Wed Dec 04 07:20:24 2013 +0000
Revision:
1:fd3ec64b2345
Parent:
0:ace2e8d3ce79
Added LPC1768 pinout

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 0:ace2e8d3ce79 1 #include <stdio.h>
ktownsend 0:ace2e8d3ce79 2 #include <string.h>
ktownsend 0:ace2e8d3ce79 3
ktownsend 0:ace2e8d3ce79 4 #include "blecharacteristic.h"
ktownsend 0:ace2e8d3ce79 5
ktownsend 0:ace2e8d3ce79 6 /**************************************************************************/
ktownsend 0:ace2e8d3ce79 7 /*!
ktownsend 0:ace2e8d3ce79 8 @brief Creates a new BLECharacteristic using the specified 16-bit
ktownsend 0:ace2e8d3ce79 9 UUID, value length, and properties
ktownsend 0:ace2e8d3ce79 10
ktownsend 0:ace2e8d3ce79 11 @note The UUID value must be unique in the service and is normally >1
ktownsend 0:ace2e8d3ce79 12
ktownsend 0:ace2e8d3ce79 13 @param[in] id
ktownsend 0:ace2e8d3ce79 14 The 16-bit UUID to use for this characteristic
ktownsend 0:ace2e8d3ce79 15 @param[in] minLen
ktownsend 0:ace2e8d3ce79 16 The min length in bytes of this characteristic's value
ktownsend 0:ace2e8d3ce79 17 @param[in] maxLen
ktownsend 0:ace2e8d3ce79 18 The max length in bytes of this characteristic's value
ktownsend 0:ace2e8d3ce79 19 @param[in] props
ktownsend 0:ace2e8d3ce79 20 The 8-bit bit field containing the characteristic's
ktownsend 0:ace2e8d3ce79 21 properties
ktownsend 0:ace2e8d3ce79 22
ktownsend 0:ace2e8d3ce79 23 @section EXAMPLE
ktownsend 0:ace2e8d3ce79 24
ktownsend 0:ace2e8d3ce79 25 @code
ktownsend 0:ace2e8d3ce79 26
ktownsend 0:ace2e8d3ce79 27 // UUID = 0x2A19, Min length 2, Max len = 2, Properties = write
ktownsend 0:ace2e8d3ce79 28 BLECharacteristic c = BLECharacteristic( 0x2A19, 2, 2, 0x08 );
ktownsend 0:ace2e8d3ce79 29
ktownsend 0:ace2e8d3ce79 30 @endcode
ktownsend 0:ace2e8d3ce79 31 */
ktownsend 0:ace2e8d3ce79 32 /**************************************************************************/
ktownsend 0:ace2e8d3ce79 33 BLECharacteristic::BLECharacteristic(uint16_t id, uint16_t minLen, uint16_t maxLen, uint8_t props)
ktownsend 0:ace2e8d3ce79 34 {
ktownsend 0:ace2e8d3ce79 35 uuid = id;
ktownsend 0:ace2e8d3ce79 36 memcpy(&properties, &props, 1);
ktownsend 0:ace2e8d3ce79 37 lenMin = minLen;
ktownsend 0:ace2e8d3ce79 38 lenMax = maxLen;
ktownsend 0:ace2e8d3ce79 39 }
ktownsend 0:ace2e8d3ce79 40
ktownsend 0:ace2e8d3ce79 41 /**************************************************************************/
ktownsend 0:ace2e8d3ce79 42 /*!
ktownsend 0:ace2e8d3ce79 43 Destructor
ktownsend 0:ace2e8d3ce79 44 */
ktownsend 0:ace2e8d3ce79 45 /**************************************************************************/
ktownsend 0:ace2e8d3ce79 46 BLECharacteristic::~BLECharacteristic(void)
ktownsend 0:ace2e8d3ce79 47 {
ktownsend 0:ace2e8d3ce79 48 }