@@ -532,6 +532,26 @@ int bt_hids_connected(struct bt_hids *hids_obj, struct bt_conn *conn);
532532 */
533533int bt_hids_disconnected (struct bt_hids * hids_obj , struct bt_conn * conn );
534534
535+ /** @brief Send Input Report, operation complete callback has user data as argument.
536+ *
537+ * @note The function is not thread safe.
538+ * It cannot be called from multiple threads at the same time.
539+ *
540+ * @param hids_obj Pointer to HIDS instance.
541+ * @param conn Pointer to Connection Object.
542+ * @param rep_index Index of report descriptor.
543+ * @param rep Pointer to the report data.
544+ * @param len Length of report data.
545+ * @param cb Notification complete callback (can be NULL).
546+ * @param userdata Argument passed to notificaion complete callback.
547+ *
548+ * @return 0 If the operation was successful. Otherwise, a (negative) error
549+ * code is returned.
550+ */
551+ int bt_hids_inp_rep_send_userdata (struct bt_hids * hids_obj , struct bt_conn * conn ,
552+ uint8_t rep_index , uint8_t const * rep , uint8_t len ,
553+ bt_gatt_complete_func_t cb , void * userdata );
554+
535555/** @brief Send Input Report.
536556 *
537557 * @note The function is not thread safe.
@@ -547,9 +567,12 @@ int bt_hids_disconnected(struct bt_hids *hids_obj, struct bt_conn *conn);
547567 * @return 0 If the operation was successful. Otherwise, a (negative) error
548568 * code is returned.
549569 */
550- int bt_hids_inp_rep_send (struct bt_hids * hids_obj , struct bt_conn * conn ,
551- uint8_t rep_index , uint8_t const * rep , uint8_t len ,
552- bt_gatt_complete_func_t cb );
570+ static inline int bt_hids_inp_rep_send (struct bt_hids * hids_obj , struct bt_conn * conn ,
571+ uint8_t rep_index , uint8_t const * rep , uint8_t len ,
572+ bt_gatt_complete_func_t cb )
573+ {
574+ return bt_hids_inp_rep_send_userdata (hids_obj , conn , rep_index , rep , len , cb , NULL );
575+ }
553576
554577/** @brief Send Boot Mouse Input Report.
555578 *
0 commit comments