usb: hid: Add status_cb to hid ops

Adding status callback allows to control report sending only when i.e.
device is connected or configured.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2018-09-19 14:46:54 +03:00 committed by Anas Nashif
commit 3288da9c0b
2 changed files with 32 additions and 27 deletions

View file

@ -54,6 +54,7 @@ struct usb_hid_descriptor {
typedef int (*hid_cb_t)(struct usb_setup_packet *setup, s32_t *len,
u8_t **data);
typedef void (*hid_int_ready_callback)(void);
typedef void (*status_cb_t)(enum usb_dc_status_code status, u8_t *param);
struct hid_ops {
hid_cb_t get_report;
@ -72,6 +73,7 @@ struct hid_ops {
#ifdef CONFIG_ENABLE_HID_INT_OUT_EP
hid_int_ready_callback int_out_ready;
#endif
status_cb_t status_cb;
};
/* HID Report Definitions */