bluez-hfp manual

medium

Image Types:
basesdk-amd64 / sdk-amd64 / target-armhf-internal / target-amd64
Image Deployment:
APT
Type:
functional

Description

Test Hands Free Profile (HFP) BlueZ feature.


Resources

  • A Bluetooth adapter (if you have two plugged, please remove one to avoid confusion)
  • A Bluetooth-enabled phone with a SIM card able to make and receive calls.

Pre Conditions

  1. Ensure Rootfs is remounted as read/write.
  2. $ sudo mount -o remount,rw /
  3. Install dependencies
  4. $ sudo apt install chaiwala-tests python-dialog dialog python3-gi python3-dbus
  5. Restart the system to restore the filesystem state to read-only before running the test.
  6. $ sudo reboot
  7. Please note that connman disables bluetooth by default on a fresh image.
  8. Enable device:
  9. $ connmanctl enable bluetooth
  10. When running the test on SabreLite boards using the headphone jack to check the audio output, PulseAudio needs to be configured to route it accordingly as it defaults to the HDMI output:
  11. $ pacmd set-default-sink alsa_output.platform-sound.stereo-fallback
    $ pacmd set-sink-port alsa_output.platform-sound.stereo-fallback analog-output-headphones
  12. After reboot ensure that headphones will not be muted:
  13. $ pacmd set-sink-mute alsa_output.platform-sound.stereo-fallback false

Execution Steps

  1. Execute the test suite:
  2. $ DISPLAY=:0 /usr/lib/chaiwala-tests/bluez/bluez-hfp

Expected

If FAILED is displayed, one of the test has failed. The output should be similar to that:

TEST STARTED: Pairing Initiatior

| Confiming passkey 805647 (/org/bluez/803/hci0/dev_78_47_1D_B3_6E_80)

TEST FINISHED: Pairing Initiatior : PASSED

TEST STARTED: Pairing Responder

| In the phone start pairing with BlueZ (00:1B:DC:0F:35:06).

| Device created /org/bluez/803/hci0/dev_78_47_1D_B3_6E_80

TEST FINISHED: Pairable Responder : PASSED

| Profiles supported:

         *  HFP AG

TEST STARTED: HFP AG

Type the phone number to call:*144

Press ENTER to hangup the call:

| Did you hear the call (y/n)

y

From a second phone call the phone connected to oFono.

 Once the phone starts ring press ENTER to anwser:

Press ENTER to hangup the call:

| Did you hear the call (y/n)

y

TEST FINISHED: HFP AG : PASSED

Notes

  • There are some options to run the command.
  • The -i select which hci device to use(e.g.: hci0). One can find the hci device name by running 'hciconfig' and looking at the available devices in its outputs.
  • The -d select which device you want to pair with, skipping discovery procedure. One can find the phone's Bluetooth address by putting the phone in discoverable mode and using "scan on" command from bluetoothctl.
  • The -s skip pairing because the device is already paired. -d must be present when using this.
  • Example:
  • $ /usr/lib/chaiwala-tests/bluez/bluez-hfp -i hci0 -d A0:F4:19:8E:D9:AF -s