High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Tue Dec 10 07:32:12 2013 +0000
Revision:
2:ffc5216bd2cc
Child:
4:50a31ff5f974
UART Tests

Who changed what in which revision?

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