How to select endpoint transfer type in hid keyboard example?
I am using nRF5 v15 with a nRF52832 and Soft Device s132 and the reports keep being sent as a bulk transfer rather than an interrupt, I can't seem to change it.
Cheers, Ash
How to select endpoint transfer type in hid keyboard example?
I am using nRF5 v15 with a nRF52832 and Soft Device s132 and the reports keep being sent as a bulk transfer rather than an interrupt, I can't seem to change it.
Cheers, Ash
Hi,
Why do you believe it's using bulk transfer and not interrupt?
Both mouse and keyboard endpoints are setup with transfertype interrupt. To send mouse reports more frequently you may change:
/**
* @brief Mouse move repeat time in milliseconds
*/
#define CONFIG_MOUSE_MOVE_TIME_MS (1) // Instead of 5ms
Best regards,
Kenneth
GetDescriptor (Configuration) |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
CONFIGURATION |
2 |
0x02 |
00000010 |
||||||
|
59 bytes |
59 |
0x003B |
00000000 |
||||||
|
2 |
2 |
0x02 |
00000010 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
4 |
4 |
0x04 |
00000100 |
||||||
|
Zero |
0 |
0x00 |
00000 |
||||||
|
Supported |
1 |
0x1 |
1 |
||||||
|
Yes |
1 |
0x1 |
1 |
||||||
|
One |
1 |
0x1 |
1 |
||||||
|
500 mA |
250 |
0xFA |
11111010 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
INTERFACE |
4 |
0x04 |
00000100 |
||||||
|
0 |
0 |
0x00 |
00000000 |
||||||
|
0 |
0 |
0x00 |
00000000 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
Human Interface Device (Find out more online) |
3 |
0x03 |
00000011 |
||||||
|
Boot Interface |
1 |
0x01 |
00000001 |
||||||
|
Mouse |
2 |
0x02 |
00000010 |
||||||
|
0 |
0 |
0x00 |
00000000 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
Class: 0x21 |
33 |
0x21 |
00100001 |
||||||
|
7 bytes |
|
|
|
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
7 |
0x07 |
00000111 |
||||||
|
ENDPOINT |
5 |
0x05 |
00000101 |
||||||
|
1 IN |
129 |
0x81 |
10000001 |
||||||
|
Interrupt |
3 |
0x3 |
11 |
||||||
|
Zero |
0 |
0x00 |
000000 |
||||||
|
64 bytes |
64 |
0x0040 |
00000000 |
||||||
|
1 frame (1000 us) |
1 |
0x01 |
00000001 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
INTERFACE |
4 |
0x04 |
00000100 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
0 |
0 |
0x00 |
00000000 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
Human Interface Device (Find out more online) |
3 |
0x03 |
00000011 |
||||||
|
Boot Interface |
1 |
0x01 |
00000001 |
||||||
|
Keyboard |
1 |
0x01 |
00000001 |
||||||
|
0 |
0 |
0x00 |
00000000 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
Class: 0x21 |
33 |
0x21 |
00100001 |
||||||
|
7 bytes |
|
|
|
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
7 |
0x07 |
00000111 |
||||||
|
ENDPOINT |
5 |
0x05 |
00000101 |
||||||
|
2 IN |
130 |
0x82 |
10000010 |
||||||
|
Interrupt |
3 |
0x3 |
11 |
||||||
|
Zero |
0 |
0x00 |
000000 |
||||||
|
64 bytes |
64 |
0x0040 |
00000000 |
||||||
|
1 frame (1000 us) |
1 |
0x01 |
00000001 |
Hi,
Why do you believe it's using bulk transfer and not interrupt?
Both mouse and keyboard endpoints are setup with transfertype interrupt. To send mouse reports more frequently you may change:
/**
* @brief Mouse move repeat time in milliseconds
*/
#define CONFIG_MOUSE_MOVE_TIME_MS (1) // Instead of 5ms
Best regards,
Kenneth
GetDescriptor (Configuration) |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
CONFIGURATION |
2 |
0x02 |
00000010 |
||||||
|
59 bytes |
59 |
0x003B |
00000000 |
||||||
|
2 |
2 |
0x02 |
00000010 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
4 |
4 |
0x04 |
00000100 |
||||||
|
Zero |
0 |
0x00 |
00000 |
||||||
|
Supported |
1 |
0x1 |
1 |
||||||
|
Yes |
1 |
0x1 |
1 |
||||||
|
One |
1 |
0x1 |
1 |
||||||
|
500 mA |
250 |
0xFA |
11111010 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
INTERFACE |
4 |
0x04 |
00000100 |
||||||
|
0 |
0 |
0x00 |
00000000 |
||||||
|
0 |
0 |
0x00 |
00000000 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
Human Interface Device (Find out more online) |
3 |
0x03 |
00000011 |
||||||
|
Boot Interface |
1 |
0x01 |
00000001 |
||||||
|
Mouse |
2 |
0x02 |
00000010 |
||||||
|
0 |
0 |
0x00 |
00000000 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
Class: 0x21 |
33 |
0x21 |
00100001 |
||||||
|
7 bytes |
|
|
|
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
7 |
0x07 |
00000111 |
||||||
|
ENDPOINT |
5 |
0x05 |
00000101 |
||||||
|
1 IN |
129 |
0x81 |
10000001 |
||||||
|
Interrupt |
3 |
0x3 |
11 |
||||||
|
Zero |
0 |
0x00 |
000000 |
||||||
|
64 bytes |
64 |
0x0040 |
00000000 |
||||||
|
1 frame (1000 us) |
1 |
0x01 |
00000001 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
INTERFACE |
4 |
0x04 |
00000100 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
0 |
0 |
0x00 |
00000000 |
||||||
|
1 |
1 |
0x01 |
00000001 |
||||||
|
Human Interface Device (Find out more online) |
3 |
0x03 |
00000011 |
||||||
|
Boot Interface |
1 |
0x01 |
00000001 |
||||||
|
Keyboard |
1 |
0x01 |
00000001 |
||||||
|
0 |
0 |
0x00 |
00000000 |
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
9 |
0x09 |
00001001 |
||||||
|
Class: 0x21 |
33 |
0x21 |
00100001 |
||||||
|
7 bytes |
|
|
|
|
||||||||||
|
Value |
Dec |
Hex |
Bin |
||||||
|
Valid |
7 |
0x07 |
00000111 |
||||||
|
ENDPOINT |
5 |
0x05 |
00000101 |
||||||
|
2 IN |
130 |
0x82 |
10000010 |
||||||
|
Interrupt |
3 |
0x3 |
11 |
||||||
|
Zero |
0 |
0x00 |
000000 |
||||||
|
64 bytes |
64 |
0x0040 |
00000000 |
||||||
|
1 frame (1000 us) |
1 |
0x01 |
00000001 |
I thought it was Bulk because that is what wire shark is reporting, I'm still newish to packet sniffing and aware that they don't / can't always get the results perfectly right. After looking back it seems that wire shark is misreporting it.
Thank you for the tables, where / how did you get them?
Does p_hids contain all of the device and report descriptors?
Where specifically are the device Endpoint descriptors parameters in main.c or ble_hids.c ?
Thank you for your help.
Hi,
This was a dump from the ellisys usb sniffer using the \usbd_hid_composite example from sdk v15.2.
You can refer to the usbd library documentation on usage:
http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lib_usbd.html?cp=4_0_0_3_59
Best regards,
Kenneth
The USBD drives appears to not be supported for nRF52832, how does the keyboard work if the USBD driver isn't supported/used?
I was thinking of nRF52840 yes, the nRF52832 does not have USB.
Best regards,
Kenneth
Ok, Thank you,I think I figured it out.
It looks like the encoded report is in ble_hids.c, functions rep_char_add and rep_map_char_add seem to do most of the heavy lifting and the functions used within them encode and then send the report.
Cheers, Ash.