[Interest] [QtBluetooth] Pairing two devices

Claudiu Olteanu olteanu.claudiu at ymail.com
Mon Jun 1 15:53:06 CEST 2015


Sorry for the format of the last message. 


I tried to pair the devices from the CLI using bluetoothctl 
tool and I observed that if I try to connect the devices 
without creating an agent first, it fails with the same error.
[bluetooth]# pair 00:12:6F:2A:0B:6E
Attempting to pair with 00:12:6F:2A:0B:6E
[CHG] Device 00:12:6F:2A:0B:6E Connected: yes
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device 00:12:6F:2A:0B:6E Connected: no

If I create an agent first, then it prompts for PIN code.

[bluetooth]# agent KeyboardOnly 
Agent registered
[bluetooth]# default-agent 
Default agent request successful
[CHG] Device 00:12:6F:2A:0B:6E RSSI: -70
[bluetooth]# pair 00:12:6F:2A:0B:6E
Attempting to pair with 00:12:6F:2A:0B:6E
[CHG] Device 00:12:6F:2A:0B:6E Connected: yes
Request PIN code
[agent] Enter PIN code: 0000
[CHG] Device 00:12:6F:2A:0B:6E UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 00:12:6F:2A:0B:6E Paired: yes
Pairing successful
[CHG] Device 00:12:6F:2A:0B:6E Connected: no


The interesting part is that the device stays connected for
a few seconds and then it disconnects. I don't know why.

I hope that you can find this helpful and you can give me 
some suggestions how I can handle this from QtBluetooth API.
Happy hacking,
Claudiu



More information about the Interest mailing list