Skip to main content

chan_mobile

Set Up Bluetooth on Linux

以 Gempro Wireless VoIP Gateway 為例

Install packages

# For RedHat
yum install bluez bluez-tools

# For Debian/Ubuntu
apt-get install bluetooth bluez

Service bluetooth

# For RedHat
systemctl restart bluetooth
systemctl status bluetooth

Pair the BT devices

藍芽裝置的配對密碼,請先確認 Gempro Gateway 上的設定。

bluetoothctl

[bluetooth]# 
Controller 00:1A:7D:DA:71:13
	Name: freepbx.sangoma.local
	Alias: freepbx.sangoma.local
	Class: 0x000104
	Powered: no
	Discoverable: no
	Pairable: no
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v1D6Bp0246d052C
	Discovering: no

[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]# devices
Device 00:19:5D:3E:01:77 GP-712-1
Device 00:19:5D:24:C6:98 GP-712-2

[bluetooth]# pair 00:19:5D:3E:01:77
...
...
[agent] Enter PIN code: 0003
[CHG] Device 00:19:5D:3E:01:77 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 00:19:5D:3E:01:77 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 00:19:5D:3E:01:77 ServicesResolved: yes
[CHG] Device 00:19:5D:3E:01:77 Paired: yes
Pairing successful

[bluetooth]# 
[bluetooth]# paired-devices
Device 00:19:5D:3E:01:77 GP-712-1

bluetoothctl (optional)
Available commands:
    list
    show [ctrl]
    select <ctrl>
    devices
    paired-devices
    system-alias
    connect <address>
    disconnect
    remove <address>
    power <on/off>
    mode <mode>
    agent <on/off/capability/timeout>
    default-agent
    scan <on/off>
    pairable <on/off>
    pair <address>
    discoverable <on/off>
    info <address>
    menu <command>
    quit