Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Diff: GattCharacteristic.cpp
- Revision:
- 2:ffc5216bd2cc
- Child:
- 4:50a31ff5f974
diff -r fd3ec64b2345 -r ffc5216bd2cc GattCharacteristic.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/GattCharacteristic.cpp Tue Dec 10 07:32:12 2013 +0000
@@ -0,0 +1,48 @@
+#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, 0x08 );
+
+ @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;
+}
+
+/**************************************************************************/
+/*!
+ Destructor
+*/
+/**************************************************************************/
+GattCharacteristic::~GattCharacteristic(void)
+{
+}
