Hello,
I want to use USB HID and set up a feature report to send some configuration data. Is there any example to guide how to do it?
Tks
Hello,
I want to use USB HID and set up a feature report to send some configuration data. Is there any example to guide how to do it?
Tks
Hi Vinh,
The followings are the UBS HID examples in our SDK. You could start with them.
Thank you.
I was using SDK v15.3. Look like I need to upgrade to sdk v16.0.0 to use it.
Hi,
There are also these two examples in SDK v15.3. You could check usbd_hid_composite/ usbd_hid_generic under <nRF5_SDK_15.3.0>\examples\peripheral
-Amanda
I want to use a Windows API ( HID_GetFeature ) to get a feature report on my device. It returns 0.
How can I fill the report feature buffer in nRF code? Which API to fill value for the feature buffer?
/** * @brief USB HID instance. */ typedef struct { app_usbd_hid_subclass_desc_t const ** const p_subclass_desc; //!< HID subclass descriptors array. size_t subclass_desc_count; //!< HID subclass descriptors count. app_usbd_hid_subclass_t subclass_boot; //!< Boot device (see HID definition). app_usbd_hid_protocol_t protocol; //!< HID protocol (see HID definition). app_usbd_hid_report_buffer_t * p_rep_buffer_in; //!< Report buffer IN. app_usbd_hid_report_buffer_t const * p_rep_buffer_out; //!< Report buffer OUT (only one instance). app_usbd_hid_report_buffer_t const * p_rep_buffer_feature; //!< Report buffer FEATURE. app_usbd_hid_methods_t const * p_hid_methods; //!< Hid interface methods. app_usbd_hid_user_ev_handler_t user_event_handler; //!< User event handler. uint8_t * p_ep_interval; //!< Endpoint intervals. } app_usbd_hid_inst_t;
Please see USB HID class/app_usbd_hid_rep_buff_feature_get() in app_usbd_hid.c.
-Amanda
Hi Amanda,
I can't see this API in nRF SDK v15.3.
When I call HID_GetFeature on Windows API, I want my nRF device to send feature report to PC. How can I build up this?
app_usbd_hid_rep_buff_feature_get() to get the feature report on nRF device when my application on PC call HID_SetFeature, doest it correct?
How to set up a value for the feature report on nRF device? Which API to do this?
How to set up a value for the feature report on nRF device? Which API to do this?
I am checking with the developer. I will be back as soon as I have anything.
-Amanda H.
Hi,
Sorry to make the misunderstand. The Feature report is only supported by SDK16.
Handling feature reports has been added to the SDK16. It is implemented similarly to output reports, i.e. it can be modified by the host using SET_REPORT and GET_REPORT requests. To modify it on the device side, you can use:
app_usbd_hid_report_buffer_t const * p_feature = app_usbd_hid_rep_buff_feature_get(p_hinst);
p_feature->p_buff[0] = 0x12;
p_feature->p_buff[1] = 0x34;
p_feature->p_buff[2] = 0x56;
-Amanda H.