c - 如何从 Linux 上的远程 BLE 点击器检测按钮按下?
问题描述
我想在类似树莓的 linux 设备上使用使用蓝牙 (BLE) 的罗技答题器,用于特定应用程序。我的目标是能够检测何时按下遥控器上的按钮,然后在我的应用程序代码中使用此信息。一个完美的解决方案是拥有一个包含按钮状态信息的设备文件。
我使用bluetoothctl
. 然后我对如何获取按钮按下的信息一无所知。我尝试使用嗅探蓝牙数据包,hcidump
但这并没有给我任何结果。我也无法弄清楚如何将遥控器链接到设备文件。我有以下关于设备的信息bluetoothctl
:
[Logi R500]# info
Device C3:6F:57:12:7B:01 (random)
Name: Logi R500
Alias: Logi R500
Appearance: 0x03c0
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Battery Service (0000180f-0000-1000-8000-00805f9b34fb)
UUID: Human Interface Device (00001812-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (00010000-0000-1000-8000-011f2000046d)
Modalias: usb:v046DpB505d0008
你有什么解决办法吗?
解决方案
推荐阅读
- c++ - OpenGL中的同步
- javascript - ASP.NET Core API 中的模型绑定始终为空
- javascript - 使用带有样式组件的自定义组件时无法触发函数 onClick
- python - Numpy 数组理解
- java - 在java中获取谷歌存储桶的大小
- python - 在 XLS 或 CSV 文件中写入具有不同颜色的单元格的一部分
- javascript - 使用两个嵌套的 for 结构来记录以下模式。有任何想法吗?
- javascript - 如何模拟手机框架在我的网站上播放视频?
- google-cloud-platform - 如何为在谷歌云平台中创建的实例激活 https
- c - 如何在 Gtk 中组合加速键?