Skip to main content
To perform HFP client or audio gateway functions, you must first complete the steps in the following procedure.

Prerequisites

  • Enable SSH to access your host device. For instructions, see Sign in using SSH.
  • Place the DUT and the remote device in the Bluetooth vicinity.

Set up the device for HFP functions

  1. Run the SSH in command prompt using the following command:
    ssh root@<device_IP_address>
    
    Example If the IP address of the device is 10.92.160.222, run the following command:
    ssh root@10.92.160.222
    
  2. Connect to the SSH by entering the following password:
    oelinux123
    
  3. Configure the DUT for the HFP client or audio gateway functions, as required.

Configure the DUT for HFP client functions

After the initial device set up for HFP functions, do the following for an HFP client:
  1. Verify the status of ofono service by running the following command in SSH:
    systemctl status ofono
    
  2. Download the Bluetooth configuration file bluetooth.conf from GitHub PipeWire page.
  3. Push the bluetooth.conf file to the device at the /usr/share/wireplumber/wireplumber.conf.d directory.
  4. Open the bluetooth.conf file in a text editor.
  5. Uncomment the bluez5.hfphsp-backend = "native" property. Change its value from "native" to "ofono". The file must appear as follows:
    # bluez5.enable-hw-volume = true
    
    ## HFP/HSP backend (default: native).
    ## Available values: any, none, hsphfpd, ofono, native
    bluez5.hfphsp-backend = "ofono"
    
    ## HFP/HSP native backend modem (default: none).
    
  6. Save the file.
  7. Reload the daemon by running the following command:
    systemctl daemon-reload
    
  8. Restart the WirePlumber service by running the following command:
    systemctl restart wireplumber
    
    After you reload the daemon and restart the WirePlumber service, the changes in the bluetooth.conf configuration file reflect in the system. PipeWire establishes a connection with ofono using DBUS.
  9. Run bluetoothctl by running the following command in SSH:
    bluetoothctl
    
  10. Verify if the UUID of the hands-free-client device appears in the list by running the following command from the bluetoothctl menu:
    show
    
Sample output
[bluetooth]# show
Controller 22:22:9B:2C:79:1E (public)
   Name: qcm6490
   Alias: qcm6490
   Class: 0x002c0000
   Powered: yes
   Discoverable: no
   DiscoverableTimeout: 0x000000b4
   Pairable: yes
   UUID: A/V Remote Control        (e000110e-0000-1000-8000-00805f9b34fb)
   UUID: PnP Information           (e0001200-0000-1000-8000-00805f9b34fb)
   UUID: Audio Source              (e000110a-0000-1000-8000-00805f9b34fb)
   UUID: Audio Sink                (e000110b-0000-1000-8000-00805f9b34fb)
   UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
   UUID: Generic Access Profile    (e0001800-0000-1000-8000-00805f9b34fb)
   UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
   UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
   UUID: Handsfree                 (e000111e-0000-1000-8000-00805f9b34fb)
   Modalias: usb:v1D6Bp0246d0541
   Discovering: no
   Roles: central
   Roles: peripheral
Advertising Features:
   ActiveInstances: 0x00 (0)
   SupportedInstances: 0x10 (16)
   SupportedIncludes: tx-power
   SupportedIncludes: appearance
   SupportedIncludes: local-name
   SupportedSecondaryChannels: 1M
   SupportedSecondaryChannels: 2M
   SupportedSecondaryChannels: Coded
[bluetooth]#
The hands-free audio gateway and headset UUIDs aren’t listed. Only the hands-free client UUID that’s configured from PipeWire appears in the list.
  1. Open the ofono/test menu by running the following command in SSH:
    ls -rt /usr/lib/ofono/test
    
    Build and install the ofono-tests package on your device for the ofono/test application.
Sample output
sh-5.1# ls -rt /usr/lib/ofono/test
unlock-pin                 set-ddr                     hangup-call
test-stk-menu              set-context-property        hangup-all
test-ss-control-cs         set-cbs-topics              hangup-active
test-ss-control-cf         set-call-forwarding         get-tech-preference
test-ss-control-cb         send-vcard                  get-serving-cell-info
test-ss                    send-vcal                   get-operators
test-sms                   send-ussd                   get-icon
test-smart-messaging       send-sms                    enter-pin
test-serving-cell-info     scan-for-operators          enable-throttling
test-push-notification     reset-pin                   enable-modem
test-phonebook             remove-contexts             enable-gprs
test-network-registration  release-and-swap            enable-cbs
test-modem                 release-and-answer          display-icon
test-message-waiting       reject-calls                disable-throttling
test-gnss                  register-operator           disable-modem
test-cbs                   register-auto               disable-gprs
test-call-settings         receive-sms                 disable-call-forwarding
test-call-forwarding       process-context-settings    dial-number
test-call-barring          private-chat                deactivate-context
test-advice-of-charge      online-modem                deactivate-all
swap-calls                 offline-modem               create-multiparty
set-use-sms-reports        monitor-ofono               create-mms-context
set-umts-band              lockdown-modem              create-internet-context
set-tty                    lock-pin                    change-pin
set-tech-preference        list-operators              cdma-set-credentials
set-speaker-volume         list-modems                 cdma-list-call
set-sms-smsc               list-messages               cdma-hangup
set-sms-bearer             list-contexts               cdma-dial-number
set-sms-alphabet           list-calls                  cdma-connman-enable
set-roaming-allowed        list-applications           cdma-connman-disable
set-msisdn                 list-allowed-access-points  cancel-ussd
set-mms-details            initiate-ussd               cancel-sms
set-mic-volume             ims-unregister              backtrace
set-lte-property           ims-register                answer-calls
set-gsm-band               hold-and-answer             activate-context
set-fast-dormancy          hangup-multiparty
For HFP client functions, see Perform Bluetooth HFP client functions.

Configure the DUT for HFP audio gateway functions

After the initial device set up for HFP functions, do the following for an HFP audio gateway:
  1. Run bluetoothctl by running the following command in SSH:
    bluetoothctl
    
  2. Verify if the UUID of the hands-free audio gateway and the headset appear in the list by running the following command from the bluetoothctl menu:
    show
    
    Sample output
    [bluetooth]# show
    Controller 22:22:9B:2C:79:1E (public)
       Name: qcm6490
       Alias: qcm6490
       Class: 0x006c0000
       Powered: yes
       Discoverable: no
       DiscoverableTimeout: 0x000000b4
       Pairable: yes
       UUID: A/V Remote Control        (0000110a-0000-1000-8000-00805f9b34fb)
       UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
       UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
       UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
       UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
       UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
       UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
       UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
       UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
       UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
       UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
       Modalias: usb:v1D6Bp0246d0541
       Discovering: no
       Roles: central
       Roles: peripheral
    Advertising Features:
       ActiveInstances: 0x00 (0)
       SupportedInstances: 0x10 (16)
       SupportedIncludes: tx-power
       SupportedIncludes: appearance
       SupportedIncludes: local-name
       SupportedSecondaryChannels: 1M
       SupportedSecondaryChannels: 2M
       SupportedSecondaryChannels: Coded
    [bluetooth]# |
    
  3. Enable Modified Sub Band Coding (mSBC) codec as the default codec for HFP audio gateway connection as follows: a. Open the bluetooth.conf file using a text editor on the device. b. Uncomment bluez5.enable-msbc = true line in the bluetooth.conf file. c. Save the bluetooth.conf file.
  4. Reload the Bluetooth daemon by running the following command:
    systemctl daemon-reload
    
  5. Restart the WirePlumber service by running the following command:
    systemctl restart wireplumber
    
    The changes in the bluetooth.conf configuration file are applied in the device.
For HFP audio gateway functions, see Perform Bluetooth HFP audio gateway functions.

Next steps

Perform Bluetooth HFP client functions

You can perform HFP client functions using the bluetoothctl menu and ofono/test tools. Bluetooth HFP client functions include connecting or disconnecting to a remote device and managing phone calls over Bluetooth. You can dial a phone number, answer or reject incoming calls, and list active calls using HFP client functions.

Perform Bluetooth HFP audio gateway functions

You can perform HFP audio gateway functions using the bluetoothctl menu and paplay commands. Bluetooth HFP audio gateway functions allow you to connect or disconnect to a remote device and verify audio gateway functionality to ensure proper hands-free operation.