HI all
How to test the hid transmission rate between DK board and PC?
Can you provide an example
Thank you.
HI all
How to test the hid transmission rate between DK board and PC?
Can you provide an example
Thank you.
Hi
Since the level of details in this case is pretty scarce, here are the 3 most common HID sample projects we have available in the nRF Connect SDK:
Let me know if you're struggling to find what you're looking for.
Best regards,
Simon
Hi Simon
I'm working on SDK nRF5_SDK_17.1.0_ddde560, my project is hid(no mouse or keyboard)+nus
Reference examples are as follows:
nRF5_SDK_17.1.0_ddde560\examples\peripheral\usbd_ble_uart
nRF5_SDK_17.1.0_ddde560\examples\peripheral\usbd_hid_generic
#define APP_USBD_HID_GENERIC_REPORT_DSC() { \
0x06, 0x0A, 0xFF, /* Usage Page (Vendor-Defined 11) */ \
0x09, 0x01, /* Usage (Vendor-Defined 11) */ \
0xA1, 0x01, /* Collection (Application) */ \
0x85, 0x02, /* REPORT_ID (mouse) */ \
0x09, 0x02, /* Usage (Vendor-Defined 1) */ \
0x75, 0x08, /* Report Size (8) */ \
0x95, 0x0b, /* Report Count (20) */ \
0x15, 0x00, /* Usage Minimum (0) */ \
0x26, 0xFF, 0x00, /* Usage Maximum (255) */ \
0x81, 0x02, /* Output (Data,Var,Abs) */ \
0x09, 0x03, /* Usage (Vendor-Defined 3) */ \
0x75, 0x08, /* Report Size (8) */ \
0x95, 0x20, /* Report Count (32) */ \
0x15, 0x00, /* Logical Minimum (0) */ \
0x26, 0xFF, 0x00, /* Logical Maximum (255) */ \
0x91, 0x02, /* input (Data,Var,Abs) */ \
0xC0 /* END_COLLECTION */ \
}
APP_USBD_HID_GENERIC_SUBCLASS_REPORT_DESC(generic_desc, APP_USBD_HID_GENERIC_REPORT_DSC());
static const app_usbd_hid_subclass_desc_t * generic_reps[] = {&generic_desc};
/*lint -save -e26 -e64 -e123 -e505 -e651*/
/**
* @brief Global HID generic instance
*/
/*lint -restore*/
APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_generic,
HID_GENERIC_INTERFACE,
hid_user_ev_handler,
GENERIC_ENDPOINT_LIST(),
generic_reps,
GENERIC_REPORT_IN_QUEUE_SIZE,
GENERIC_REPORT_OUT_MAXSIZE,
GENERIC_REPORT_FEATURE_MAXSIZE,
APP_USBD_HID_SUBCLASS_NONE,
APP_USBD_HID_PROTO_GENERIC);
Now I have another problem: when I want to send data to the dK through Bluetooth on my phone, I find that the Nus handle received the data, but when I call the app_usbd_hid_generic_in_report_set, it always returns a failure. I debugged and found that after I inserted the USB, about 2 seconds later, a suspend occurred,
<info>app: APP_ USBD_ EVT_ DRV_ SUSPEND
I am stuck in this place now and I hope you can help me,thank you.
Best regards,
HuangTao
Hi Simon
I'm working on SDK nRF5_SDK_17.1.0_ddde560, my project is hid(no mouse or keyboard)+nus
Reference examples are as follows:
nRF5_SDK_17.1.0_ddde560\examples\peripheral\usbd_ble_uart
nRF5_SDK_17.1.0_ddde560\examples\peripheral\usbd_hid_generic
#define APP_USBD_HID_GENERIC_REPORT_DSC() { \
0x06, 0x0A, 0xFF, /* Usage Page (Vendor-Defined 11) */ \
0x09, 0x01, /* Usage (Vendor-Defined 11) */ \
0xA1, 0x01, /* Collection (Application) */ \
0x85, 0x02, /* REPORT_ID (mouse) */ \
0x09, 0x02, /* Usage (Vendor-Defined 1) */ \
0x75, 0x08, /* Report Size (8) */ \
0x95, 0x0b, /* Report Count (20) */ \
0x15, 0x00, /* Usage Minimum (0) */ \
0x26, 0xFF, 0x00, /* Usage Maximum (255) */ \
0x81, 0x02, /* Output (Data,Var,Abs) */ \
0x09, 0x03, /* Usage (Vendor-Defined 3) */ \
0x75, 0x08, /* Report Size (8) */ \
0x95, 0x20, /* Report Count (32) */ \
0x15, 0x00, /* Logical Minimum (0) */ \
0x26, 0xFF, 0x00, /* Logical Maximum (255) */ \
0x91, 0x02, /* input (Data,Var,Abs) */ \
0xC0 /* END_COLLECTION */ \
}
APP_USBD_HID_GENERIC_SUBCLASS_REPORT_DESC(generic_desc, APP_USBD_HID_GENERIC_REPORT_DSC());
static const app_usbd_hid_subclass_desc_t * generic_reps[] = {&generic_desc};
/*lint -save -e26 -e64 -e123 -e505 -e651*/
/**
* @brief Global HID generic instance
*/
/*lint -restore*/
APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_generic,
HID_GENERIC_INTERFACE,
hid_user_ev_handler,
GENERIC_ENDPOINT_LIST(),
generic_reps,
GENERIC_REPORT_IN_QUEUE_SIZE,
GENERIC_REPORT_OUT_MAXSIZE,
GENERIC_REPORT_FEATURE_MAXSIZE,
APP_USBD_HID_SUBCLASS_NONE,
APP_USBD_HID_PROTO_GENERIC);
Now I have another problem: when I want to send data to the dK through Bluetooth on my phone, I find that the Nus handle received the data, but when I call the app_usbd_hid_generic_in_report_set, it always returns a failure. I debugged and found that after I inserted the USB, about 2 seconds later, a suspend occurred,
<info>app: APP_ USBD_ EVT_ DRV_ SUSPEND
I am stuck in this place now and I hope you can help me,thank you.
Best regards,
HuangTao