@@ -55,11 +55,41 @@ class BLEPeripheralHelper : public BLEHelper {
5555 */
5656 BleStatus addAttribute (BLEAttribute& attribute);
5757
58+ /* *
59+ * @brief Get BLEAttribute by subscribe parameter
60+ *
61+ * @param params Subscribe parameter
62+ *
63+ * @return BLEAttribute * NULL - Not found
64+ * Not NULL - The BLEAttribute object
65+ *
66+ * @note none
67+ */
5868 BLEAttribute *attribute (struct bt_gatt_subscribe_params *params);
69+
70+ /* *
71+ * @brief Get BLEAttribute by characteristic handle
72+ *
73+ * @param handle The characteristic handle
74+ *
75+ * @return BLEAttribute * NULL - Not found
76+ * Not NULL - The BLEAttribute object
77+ *
78+ * @note none
79+ */
5980 BLEAttribute *attribute (uint16_t handle);
6081
6182 /* *
62- * For central to discover the profile
83+ * @brief Discover the BLE peripheral profile for central
84+ *
85+ * @param none
86+ *
87+ * @return none
88+ *
89+ * @note This function only for the central device.
90+ *
91+ * @note The central deivce didn't know the connected BLE's profile.
92+ * Need send discover request to search the attribute in the BLE peripheral
6393 */
6494 void discover ();
6595
@@ -76,13 +106,51 @@ class BLEPeripheralHelper : public BLEHelper {
76106 */
77107 uint8_t discover (const struct bt_gatt_attr *attr);
78108
79- // For peripheral to register the tree
109+ /* *
110+ * @brief For peripheral to register the profile tree
111+ *
112+ * @param none
113+ *
114+ * @return int 0 - success
115+ * other - error code
116+ *
117+ * @note none
118+ */
80119 int registerProfile ();
120+
121+ /* *
122+ * @brief Process the link lost event
123+ *
124+ * @param none
125+ *
126+ * @return none
127+ *
128+ * @note none
129+ */
81130 void linkLost (void );
82131
83- // Get value handle.
84- // 0 is invalid
132+ /* *
133+ * @brief Get the characteristic value handle
134+ *
135+ * @param attr Attribute object
136+ *
137+ * @return uint16_t The value hander of attribute
138+ * 0 is invalid
139+ *
140+ * @note Only for central mode
141+ */
85142 uint16_t valueHandle (BLEAttribute *attr);
143+
144+ /* *
145+ * @brief Get characteristic configuration descriptor value handle
146+ *
147+ * @param attr Attribute object
148+ *
149+ * @return uint16_t The value hander of attribute
150+ * 0 is invalid
151+ *
152+ * @note Only for central mode
153+ */
86154 uint16_t cccdHandle (BLEAttribute *attr);
87155
88156 protected:
0 commit comments