【发布时间】:2020-07-25 18:00:03
【问题描述】:
我正在 NRF52810 上开发 HID 设备。 在IOS上测试HID的工作后发现,连接HID设备时虚拟键盘消失,无法返回给iphone。
在阅读了 HID 的文档后,我没有找到正确的命令。
我找到了一个 BLE 键盘,它有这个键来启用虚拟键盘。测试键盘后,我发现了以下内容: 1) 在 Windows 上,此按钮启动上下文菜单,键码 0x65 2) 在 android 上,此按钮启动上下文菜单 3) 在ios上,隐藏和打开虚拟键盘
我尝试通过我的设备发送此代码 (0x65)。正如预期的那样,在 windows 和 android 上打开了一个上下文菜单。但是,在 ios 上无法识别。键盘未出现,程序将键视为未定义。
有谁知道问题出在哪里?我需要向IOS发送什么代码才能打开虚拟键盘? HID描述符有问题吗?
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x06, // Usage (Keyboard)
0xA1, 0x01, // Collection (Application)
0x85, 0x01, // Report id(1)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x05, // Report Count (5)
0x75, 0x01, // Report Size (1)
0x05, 0x08, // Usage Page (Page# for LEDs)
0x19, 0x01, // Usage Minimum (1)
0x29, 0x05, // Usage Maximum (5)
0x91, 0x02, // Output (Data, Variable, Absolute), Led report
0x95, 0x01, // Report Count (1)
0x75, 0x03, // Report Size (3)
0x91, 0x01, // Output (Data, Variable, Absolute), Led report padding
0x95, 0x04, // Report Count (5)
0x75, 0x08, // Report Size (8)
0x15, 0x00, // Logical Minimum (0)
0x25, 0xFF, // Logical Maximum (255)
0x05, 0x07, // Usage Page (Key codes)
0x19, 0x00, // Usage Minimum (0)
0x29, 0xFF, // Usage Maximum (255)
0x81, 0x00, // Input (Data, Array) Key array(6 bytes)
0xC0, // End Collection (Application)
0x05, 0x01, // Usage Page (Desktop),
0x09, 0x80, // Usage (Generic Desktop),
0xA1, 0x01, // Collection (Application),
0x85, 0x02, // Report id(2)
0x75, 0x01, // Report Size (1)
0x95, 0x08, // Report Count (8)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x09, 0x81, // Usage (System Power Down)
0x09, 0x82, // Usage (System Sleep)
0x09, 0x83, // Usage (System Wake Up)
0x09, 0x84, // Usage (System Context Menu)
0x09, 0x85, // Usage (System Main Menu)
0x09, 0x86, // Usage (System App Menu)
0x09, 0x87, // Usage (System Menu Help)
0x09, 0x88, // Usage (System Menu Exit)
0x81, 0x02, // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)
0xC0, // End Collection,
【问题讨论】:
-
谁能有类似的键盘?您可以尝试找出扫描密钥代码,以确保我提供的所有内容都正确。然后我就可以理解问题出在描述符中了
标签: ios bluetooth-lowenergy hid nrf52