首页 > 解决方案 > 如何从 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

你有什么解决办法吗?

标签: clinuxubuntubluetoothbluetooth-lowenergy

解决方案


推荐阅读