Updated

Fork of BLE_API by Bluetooth Low Energy

Revision:
1042:21a86ac7f5b1
Parent:
1029:a5d0fec3b17c
Child:
1048:efb29faf12fc
--- a/ble/GattAttribute.h	Thu Dec 10 09:15:05 2015 +0000
+++ b/ble/GattAttribute.h	Mon Jan 11 08:51:25 2016 +0000
@@ -27,18 +27,16 @@
 public:
     /**
      *  @brief  Creates a new GattAttribute using the specified
-     *          UUID, value length, and inital value.
+     *          UUID, value length, and inital value
      *
      *  @param[in]  uuid
-     *              The UUID to use for this attribute.
+     *              The UUID to use for this attribute
      *  @param[in]  valuePtr
      *              The memory holding the initial value.
-     *  @param[in]  len
-     *              The length in bytes of this attribute's value.
+     *  @param[in]  initialLen
+     *              The min length in bytes of this attribute's value
      *  @param[in]  maxLen
-     *              The max length in bytes of this attribute's value.
-     *  @param[in]  hasVariableLen
-     *              Whether the attribute's value length changes overtime.
+     *              The max length in bytes of this attribute's value
      *
      *  @section EXAMPLE
      *
@@ -49,31 +47,31 @@
      *
      *  @endcode
      */
-    GattAttribute(const UUID &uuid, uint8_t *valuePtr = NULL, uint16_t len = 0, uint16_t maxLen = 0, bool hasVariableLen = true) :
-        _uuid(uuid), _valuePtr(valuePtr), _lenMax(maxLen), _len(len), _hasVariableLen(hasVariableLen), _handle() {
-        /* Empty */
+    GattAttribute(const UUID &uuid, uint8_t *valuePtr = NULL, uint16_t initialLen = 0, uint16_t maxLen = 0) :
+        _uuid(uuid), _valuePtr(valuePtr), _initialLen(initialLen), _lenMax(maxLen), _len(initialLen), _handle() {
+        /* empty */
     }
 
 public:
-    Handle_t    getHandle(void)         const {return _handle;        }
-    const UUID &getUUID(void)           const {return _uuid;          }
-    uint16_t    getLength(void)         const {return _len;           }
-    uint16_t    getMaxLength(void)      const {return _lenMax;        }
-    uint16_t   *getLengthPtr(void)            {return &_len;          }
-    void        setHandle(Handle_t id)        {_handle = id;          }
-    uint8_t    *getValuePtr(void)             {return _valuePtr;      }
-    bool        hasVariableLength(void) const {return _hasVariableLen;}
+    Handle_t    getHandle(void)        const {return _handle;    }
+    const UUID &getUUID(void)          const {return _uuid;      }
+    uint16_t    getLength(void)        const {return _len;       }
+    uint16_t    getInitialLength(void) const {return _initialLen;}
+    uint16_t    getMaxLength(void)     const {return _lenMax;    }
+    uint16_t   *getLengthPtr(void)           {return &_len;      }
+    void        setHandle(Handle_t id)       {_handle = id;      }
+    uint8_t    *getValuePtr(void)            {return _valuePtr;  }
 
 private:
-    UUID      _uuid;           /* Characteristic UUID. */
+    UUID      _uuid;        /* Characteristic UUID */
     uint8_t  *_valuePtr;
-    uint16_t  _lenMax;         /* Maximum length of the value. */
-    uint16_t  _len;            /* Current length of the value. */
-    bool      _hasVariableLen;
+    uint16_t  _initialLen;  /* Initial length of the value */
+    uint16_t  _lenMax;      /* Maximum length of the value */
+    uint16_t  _len;         /* Current length of the value */
     Handle_t  _handle;
 
 private:
-    /* Disallow copy and assignment. */
+    /* disallow copy and assignment */
     GattAttribute(const GattAttribute &);
     GattAttribute& operator=(const GattAttribute &);
 };