linux下管理蓝牙设备 – 编程哪些事
答案:1 悬赏:10
解决时间 2021-03-15 01:25
- 提问者网友:痞子房西
- 2021-03-14 16:50
linux下管理蓝牙设备 – 编程哪些事
最佳答案
- 二级知识专家网友:哭不代表软弱
- 2021-03-14 17:34
不知道为什么,小米的蓝牙鼠标在linux下面安装不是很顺利,系统能够识别出蓝牙鼠标,但是自作多情的识别出了一堆,如图所示:
看着不爽啊,怎么办?祭出bluetoothctl大法,下面是bluetoothctl的执行过程:
$ bluetoothctl
[NEW] Controller A0:C5:89:35:05:CE mibuntu [default]
[NEW] Device FE:8F:AC:55:93:48 MiMouse
[NEW] Device CE:55:BA:B8:65:B9 MiMouse
[NEW] Device EA:36:73:C7:64:C5 MiMouse
[NEW] Device 74:23:44:45:9B:FB 红米手机
[NEW] Device FD:90:32:24:D4:04 MiMouse
[NEW] Device D6:B4:84:9A:05:87 MiMouse
[bluetooth]# help
Available commands:
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
agent <on/off/capability> Enable/disable agent with given capability
default-agent Set agent as the default one
set-scan-filter-uuids [uuid1 uuid2 …] Set scan filter uuids
set-scan-filter-rssi [rssi] Set scan filter rssi, and clears pathloss
set-scan-filter-pathloss [pathloss] Set scan filter pathloss, and clears rssi
set-scan-filter-transport [transport] Set scan filter transport
set-scan-filter-clear Clears discovery filter.
scan <on/off> Scan for devices
info [dev] Device information
pair [dev] Pair with device
trust [dev] Trust device
untrust [dev] Untrust device
block [dev] Block device
unblock [dev] Unblock device
remove <dev> Remove device
connect <dev> Connect device
disconnect [dev] Disconnect device
list-attributes [dev] List attributes
select-attribute <attribute> Select attribute
attribute-info [attribute] Select attribute
read Read attribute value
write <data=[xx xx …]> Write attribute value
notify <on/off> Notify attribute value
register-profile <UUID …> Register profile to connect
unregister-profile Unregister profile
version Display version
quit Quit program
[bluetooth]# remove D6:B4:84:9A:05:87
[DEL] Device D6:B4:84:9A:05:87 MiMouse
Device has been removed
[bluetooth]# remove FD:90:32:24:D4:04
[DEL] Device FD:90:32:24:D4:04 MiMouse
Device has been removed
[bluetooth]# remove EA:36:73:C7:64:C5
[DEL] Device EA:36:73:C7:64:C5 MiMouse
Device has been removed
[bluetooth]# remove CE:55:BA:B8:65:B9
[DEL] Device CE:55:BA:B8:65:B9 MiMouse
Device has been removed
[bluetooth]# devices
Device FE:8F:AC:55:93:48 MiMouse
Device 74:23:44:45:9B:FB 红米手机
全部删除MiMouse设备,然后重新发现和连接即可。
小经验:最好通过bluetoothctl执行trust指令将MiMouse加入信任设备列表,这样配对的时候不需要验证。
看着不爽啊,怎么办?祭出bluetoothctl大法,下面是bluetoothctl的执行过程:
$ bluetoothctl
[NEW] Controller A0:C5:89:35:05:CE mibuntu [default]
[NEW] Device FE:8F:AC:55:93:48 MiMouse
[NEW] Device CE:55:BA:B8:65:B9 MiMouse
[NEW] Device EA:36:73:C7:64:C5 MiMouse
[NEW] Device 74:23:44:45:9B:FB 红米手机
[NEW] Device FD:90:32:24:D4:04 MiMouse
[NEW] Device D6:B4:84:9A:05:87 MiMouse
[bluetooth]# help
Available commands:
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
agent <on/off/capability> Enable/disable agent with given capability
default-agent Set agent as the default one
set-scan-filter-uuids [uuid1 uuid2 …] Set scan filter uuids
set-scan-filter-rssi [rssi] Set scan filter rssi, and clears pathloss
set-scan-filter-pathloss [pathloss] Set scan filter pathloss, and clears rssi
set-scan-filter-transport [transport] Set scan filter transport
set-scan-filter-clear Clears discovery filter.
scan <on/off> Scan for devices
info [dev] Device information
pair [dev] Pair with device
trust [dev] Trust device
untrust [dev] Untrust device
block [dev] Block device
unblock [dev] Unblock device
remove <dev> Remove device
connect <dev> Connect device
disconnect [dev] Disconnect device
list-attributes [dev] List attributes
select-attribute <attribute> Select attribute
attribute-info [attribute] Select attribute
read Read attribute value
write <data=[xx xx …]> Write attribute value
notify <on/off> Notify attribute value
register-profile <UUID …> Register profile to connect
unregister-profile Unregister profile
version Display version
quit Quit program
[bluetooth]# remove D6:B4:84:9A:05:87
[DEL] Device D6:B4:84:9A:05:87 MiMouse
Device has been removed
[bluetooth]# remove FD:90:32:24:D4:04
[DEL] Device FD:90:32:24:D4:04 MiMouse
Device has been removed
[bluetooth]# remove EA:36:73:C7:64:C5
[DEL] Device EA:36:73:C7:64:C5 MiMouse
Device has been removed
[bluetooth]# remove CE:55:BA:B8:65:B9
[DEL] Device CE:55:BA:B8:65:B9 MiMouse
Device has been removed
[bluetooth]# devices
Device FE:8F:AC:55:93:48 MiMouse
Device 74:23:44:45:9B:FB 红米手机
全部删除MiMouse设备,然后重新发现和连接即可。
小经验:最好通过bluetoothctl执行trust指令将MiMouse加入信任设备列表,这样配对的时候不需要验证。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |