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
-
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:
-
Connect to the SSH by entering the following password:
-
Configure the DUT for the HFP client or audio gateway functions, as required.
After the initial device set up for HFP functions, do the following for an HFP client:
-
Verify the status of ofono service by running the following command in SSH:
-
Download the Bluetooth configuration file
bluetooth.conf from GitHub PipeWire page.
-
Push the
bluetooth.conf file to the device at the /usr/share/wireplumber/wireplumber.conf.d directory.
-
Open the
bluetooth.conf file in a text editor.
-
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).
-
Save the file.
-
Reload the daemon by running the following command:
-
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.
-
Run
bluetoothctl by running the following command in SSH:
-
Verify if the UUID of the hands-free-client device appears in the list by running the following command from the
bluetoothctl menu:
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.
-
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.
After the initial device set up for HFP functions, do the following for an HFP audio gateway:
-
Run
bluetoothctl by running the following command in SSH:
-
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:
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]# |
-
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.
-
Reload the Bluetooth daemon by running the following command:
-
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
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.
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.