This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HID问题

Other Parts Discussed in Thread: CC2541

最近调试HID的问题,使用HidEmuKbd例程,把数据发送到iphone和Android,出现如下情况:

我发送小写‘a’时,手机收到的是大写A,

我发送数字1时,手机收到的是!。

协议栈版本是1.4.0.

发送的代码如下:

发送小a:SendHIDReport(0x00,HID_KEYBOARD_A);

发送数字1:SendHIDReport(0x00,HID_KEYBOARD_1);

static void SendHIDReport(uint8 modifier, uint8 keycode )
{
uint8 buf[HID_KEYBOARD_IN_RPT_LEN];

buf[0] = modifier; // Modifier keys
buf[1] = 0; // Reserved
buf[2] = keycode; // Keycode 1
buf[3] = 0; // Keycode 2
buf[4] = 0; // Keycode 3
buf[5] = 0; // Keycode 4
buf[6] = 0; // Keycode 5
buf[7] = 0; // Keycode 6

HidDev_Report( HID_RPT_ID_KEY_IN, HID_REPORT_TYPE_INPUT,
HID_KEYBOARD_IN_RPT_LEN, buf );
}