@@ -221,6 +221,45 @@ esp_err_t esp_hidd_dev_event_handler_register(esp_hidd_dev_t *dev, esp_event_han
221221 */
222222esp_err_t esp_hidd_dev_event_handler_unregister (esp_hidd_dev_t * dev , esp_event_handler_t callback , esp_hidd_event_t event );
223223
224+ /**
225+ * @brief Connection information structure for querying connections
226+ */
227+ typedef struct {
228+ uint16_t conn_id ; /*!< Connection ID */
229+ uint8_t remote_bda [6 ]; /*!< Remote device address */
230+ } esp_hidd_conn_info_t ;
231+
232+ /**
233+ * @brief Set the active connection for unicast mode
234+ * @param dev : pointer to the device
235+ * @param conn_id : connection ID to set as active (sends to this connection only)
236+ *
237+ * @return: ESP_OK on success, ESP_ERR_NOT_FOUND if connection not found
238+ * @note: This disables broadcast mode automatically
239+ */
240+ esp_err_t esp_hidd_dev_set_active_conn (esp_hidd_dev_t * dev , uint16_t conn_id );
241+
242+ /**
243+ * @brief Query all active connections
244+ * @param dev : pointer to the device
245+ * @param conn_list : pointer to array to store connection info
246+ * @param max_count : maximum number of connections that can be stored
247+ * @param[out] count : actual number of connections returned
248+ *
249+ * @return: ESP_OK on success
250+ */
251+ esp_err_t esp_hidd_dev_get_connections (esp_hidd_dev_t * dev , esp_hidd_conn_info_t * conn_list , size_t max_count , size_t * count );
252+
253+ /**
254+ * @brief Enable or disable broadcast mode
255+ * @param dev : pointer to the device
256+ * @param enable : true to broadcast to all connections, false for unicast to active connection
257+ *
258+ * @return: ESP_OK on success
259+ * @note: In broadcast mode, all connected devices receive the events
260+ */
261+ esp_err_t esp_hidd_dev_set_broadcast_mode (esp_hidd_dev_t * dev , bool enable );
262+
224263#ifdef __cplusplus
225264}
226265#endif
0 commit comments