DevicePairing

When testing multiple things play into this:

  • the Bluetooth versions the involved devices support
  • the IO capability both devices have

This opens the gate for a lot of test cases. We will concentrate on the more common ones here.

  • Make sure you have discovered the device you will use for pairing in the next steps
  • Register an agent instance with the bluetooth service

[bluetooth]# agent on
Agent registered

NOTE: This will register an agent with the IO capability DisplayYesNo

After this the setup is done and we can proceed with doing the actual pairing.

Local to remote

  • Initiate the pairing with a device of your choice.

NOTE: Depending on the device type you might not be asked to enter/verify a PIN/passkey as BlueZ tries to automatically pair certain device types without any user interaction.

NOTE: The example below pairs with an bluetooth headset which is automatically paired by BlueZ without any further us interaction.

[bluetooth]# pair BC:47:60:F5:4B:5C
Attempting to pair with BC:47:60:F5:4B:5C
[CHG] Device BC:47:60:F5:4B:5C Connected: yes
[CHG] Device BC:47:60:F5:4B:5C UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device BC:47:60:F5:4B:5C UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device BC:47:60:F5:4B:5C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device BC:47:60:F5:4B:5C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device BC:47:60:F5:4B:5C Paired: yes
Pairing successful
[CHG] Device BC:47:60:F5:4B:5C Connected: no
  • Repeat paring with different devices types and verify they get paired successfully

Remote to local

  • Enable bluetooth on another device (PC or phone) and search for the Ubuntu Touch device

[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller 30:30:3A:41:30:3A Discoverable: yes
  • Once the Ubuntu Touch device was found on the remote device initiate the pairing process from there
  • When asked to enter a PIN/passkey or confirm a passkey do so

NOTE: The device might be reported as connected during the pairing process and then disconnected again. This depends on which profiles the remote tries to connect and if we're ready to connect them or not.

[CHG] Device 4C:74:03:64:73:16 Connected: yes
[CHG] Device 4C:74:03:64:73:16 Connected: no
[CHG] Device 4C:74:03:64:73:16 Paired: yes
[CHG] Device 4C:74:03:64:73:16 Connected: yes
[CHG] Device 4C:74:03:64:73:16 Connected: no
  • Verify the device is correctly marked as paired on both sides.

Persistence of connections

  • Make sure the device is at least paired to one remote bluetooth device
  • Reboot the device
  • Verifiy paired device is still listed as paired with bluetoothctl

Process/Merges/TestPlans/bluez/DevicePairing (last edited 2015-09-15 07:48:08 by pD9ED7C14)