在linux下,我这样做的:
代码: 全选
$ bluetoothctl
代码: 全选
[bluetooth]# help
Available commands:
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available 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
scan <on/off> Scan for devices
info <dev> Device information
pair <dev> Pair with device
trust <dev> Trust device
remove <dev> Remove device
connect <dev> Connect device
disconnect <dev> Disconnect device
version Display version
quit Quit program
[bluetooth]# list
Controller 00:09:DD:40:2D:05 SANDOVAL-ARCH [default]
[bluetooth]# show
Controller 00:09:DD:40:2D:05
Name: SANDOVAL-ARCH
Alias: SANDOVAL-ARCH
Class: 0x000000
Powered: no
Discoverable: no
Pairable: no
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0507
Discovering: no
代码: 全选
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller 00:09:DD:40:2D:05 Powered: yes
[CHG] Controller 00:09:DD:40:2D:05 Class: 0x000104
[bluetooth]# pairable on
Changing pairable on succeeded
[CHG] Controller 00:09:DD:40:2D:05 Pairable: yes
[CHG] Controller 00:09:DD:40:2D:05 PairableTimeout: 0x000000
代码: 全选
[bluetooth]# scan on
[NEW] Device 57:D3:98:08:AE:7D DRC-BTN40
[CHG] Device 57:D3:98:08:AE:7D UUIDs has unsupported type
[bluetooth]# pair 57:D3:98:08:AE:7D
Attempting to pair with 57:D3:98:08:AE:7D
[CHG] Device 57:D3:98:08:AE:7D Connected: yes
Pairing successful
[CHG] Device 57:D3:98:08:AE:7D UUIDs has unsupported type
[CHG] Device 57:D3:98:08:AE:7D Paired: yes
[CHG] Device 57:D3:98:08:AE:7D Connected: no
If I manually connect my device:
代码: 全选
[bluetooth]# connect 57:D3:98:08:AE:7D
Attempting to connect to 57:D3:98:08:AE:7D
[CHG] Device 57:D3:98:08:AE:7D Connected: yes
Connection successful
[CHG] Device 57:D3:98:08:AE:7D Connected: no
I think use only this "bluetoothctl" can solve this problem. Any guys know how to solve this ?
Thanks.