python - 我无法使用 cython-hidapi 库看到蓝牙设备 (Joy-Con)

标签 python ubuntu bluetooth libusb hidapi

设备/操作系统:Jetson Nano/Ubuntu 18.04

Python 3

已连接蓝牙适配器。

Joy-Con 已连接,如 UI 中所示: enter image description here

以及当我这样做时:

$ hcitool con
Connections:
    > ACL B8:78:26:19:C1:8C handle 11 state 1 lm MASTER AUTH ENCRYPT

$ bt-device -l
Added devices:
Joy-Con (R) (B8:78:26:19:C1:8C)

我已经安装了https://github.com/trezor/cython-hidapi使用说明从源代码(我在构建期间尝试了 hidraw 和 libusb API。

在这两种情况下,这个简单的代码:

import hid

devices = hid.enumerate(0, 0)
print(devices)

仅打印连接到设备的有线 USB 鼠标和 USB 键盘:

[
{'path': b'0001:0006:00', 'vendor_id': 1118, 'product_id': 203, 'serial_number': '', 'release_number': 256, 'manufacturer_string': '', 'product_string': '', 'usage_page': 0, 'usage': 0, 'interface_number': 0},
{'path': b'0001:0004:00', 'vendor_id': 1008, 'product_id': 36, 'serial_number': '', 'release_number': 304, 'manufacturer_string': '', 'product_string': '', 'usage_page': 0, 'usage': 0, 'interface_number': 0}
]

最佳答案

解决方案是使用 udev rulesThese rules在我的案例中有效。

我最终还使用了不同的 Python 库 https://github.com/apmorton/pyhidapi 。但我确信原来的 cython-hidapi 也可以。

关于python - 我无法使用 cython-hidapi 库看到蓝牙设备 (Joy-Con),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62419920/

相关文章:

c++ - 将 vector 中的 wchar 字符串与其他指定的 wchar 字符串进行比较

java - 如何获取蓝牙配对设备的设备名称?

python - 删除空的嵌套列表 - Python

python - 如何根据pandas数据框中的多列值条件排除行?

python - 名称 'STDOUT' 未定义,但已导入子流程

python Pandas : Transforming dataframe according to a specific column

java - Jenkins 升级问题

linux - 在整个 Linux 文件系统中查找并替换文件/文件夹名称和内容

ubuntu - 我如何设置nginx每次都保持询问身份验证

ios - 如何测试 EADemo 蓝牙应用程序