High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
GattCharacteristic.cpp
- Committer:
- ktownsend
- Date:
- 2014-01-07
- Revision:
- 23:f19c60478e1b
- Parent:
- 4:50a31ff5f974
- Child:
- 27:4a83843f04b0
File content as of revision 23:f19c60478e1b:
#include <stdio.h> #include <string.h> #include "GattCharacteristic.h" /**************************************************************************/ /*! @brief Creates a new GattCharacteristic using the specified 16-bit UUID, value length, and properties @note The UUID value must be unique in the service and is normally >1 @param[in] id The 16-bit UUID to use for this characteristic @param[in] minLen The min length in bytes of this characteristic's value @param[in] maxLen The max length in bytes of this characteristic's value @param[in] props The 8-bit bit field containing the characteristic's properties @section EXAMPLE @code // UUID = 0x2A19, Min length 2, Max len = 2, Properties = write GattCharacteristic c = GattCharacteristic( 0x2A19, 2, 2, BLE_GATT_CHAR_PROPERTIES_WRITE ); @endcode */ /**************************************************************************/ GattCharacteristic::GattCharacteristic(uint16_t id, uint16_t minLen, uint16_t maxLen, uint8_t props) { uuid = id; memcpy(&properties, &props, 1); lenMin = minLen; lenMax = maxLen; handle = 0; } /**************************************************************************/ /*! Destructor */ /**************************************************************************/ GattCharacteristic::~GattCharacteristic(void) { }