Bluetooth: Classic: HFP Shell

This document describes how to run the Bluetooth Classic HFP functionality. The hfp command exposes the Bluetooth Classic HFP Shell commands.

There are two sub-commands, hfp hf and hfp ag.

The hfp hf is for Hands-Free Profile (HF) functionality, and the hfp ag is for Audio Gateway (AG) functionality.

Commands

All commands can only be used after the ACL connection has been established except hfp hf reg and hfp ag reg.

The hfp commands:

uart:~$ hfp
hfp - Bluetooth HFP shell commands
Subcommands:
  hf  : HFP HF shell commands
  ag  : HFP AG shell commands

The hfp hf commands:

uart:~$ hfp hf
hf - HFP HF shell commands
Subcommands:
  reg                          : [none]
  connect                      : <channel>
  disconnect                   : [none]
  sco_disconnect               : [none]
  cli                          : <enable/disable>
  vgm                          : <gain>
  vgs                          : <gain>
  operator                     : [none]
  audio_connect                : [none]
  auto_select_codec            : <enable/disable>
  select_codec                 : Codec ID
  set_codecs                   : Codec ID Map
  accept                       : <call index>
  reject                       : <call index>
  terminate                    : <call index>
  hold_incoming                : <call index>
  query_respond_hold_status    : [none]
  number_call                  : <phone number>
  memory_dial                  : <memory location>
  redial                       : [none]
  turn_off_ecnr                : [none]
  call_waiting_notify          : <enable/disable>
  release_all_held             : [none]
  set_udub                     : [none]
  release_active_accept_other  : [none]
  hold_active_accept_other     : [none]
  join_conversation            : [none]
  explicit_call_transfer       : [none]
  release_specified_call       : <call index>
  private_consultation_mode    : <call index>
  voice_recognition            : <activate/deactivate>
  ready_to_accept_audio        : [none]
  request_phone_number         : [none]
  transmit_dtmf_code           : <call index> <code(set 0-9, #,*,A-D)>
  query_subscriber             : [none]
  indicator_status             : <Activate/deactivate AG indicators bitmap>
  enhanced_safety              : <enable/disable>
  battery                      : <level>

The hfp ag commands:

uart:~$ hfp ag
ag - HFP AG shell commands
Subcommands:
  reg                     : [none]
  connect                 : <channel>
  disconnect              : [none]
  sco_disconnect          : [none]
  ongoing_calls           : <yes or no>
  set_ongoing_calls       : <number> <type> <status> <dir> [all]
  remote_incoming         : <number>
  hold_incoming           : <number>
  remote_reject           : <call index>
  remote_accept           : <call index>
  remote_terminate        : <call index>
  remote_ringing          : <call index>
  outgoing                : <number>
  reject                  : <call index>
  accept                  : <call index>
  hold                    : <call index>
  retrieve                : <call index>
  terminate               : <call index>
  vgm                     : <gain>
  vgs                     : <gain>
  operator                : <mode> <operator>
  audio_connect           : <codec id>
  inband_ringtone         : <enable/disable>
  explicit_call_transfer  : [none]
  voice_recognition       : <activate/deactivate>
  vre_state               : <[R-ready][S-send][P-processing]>
  vre_text                : <[R-ready][S-send][P-processing]> <id> <type>
                            <operation> <text string>
  subscriber              : <empty/notempty>
  signal_strength         : <signal strength>
  roaming_status          : <roaming status>
  battery_level           : <battery level>
  service_availability    : <yes/no>
  hf_indicator            : <indicator> <enable/disable>

HFP AG SLC

The hfp ag subcommand provides functionality for HFP AG in Bluetooth Classic.

  1. Register HFP AG:

uart:~$ hfp ag reg
  1. Connect to HFP HF:

uart:~$ hfp ag connect 1
  1. Connection is established with the HF device:

Security changed: XX:XX:XX:XX:XX:XX level 2
AG received codec id bit map 2
AG connected
AG received vgm 0
AG received vgs 0
  1. Disconnect from HFP HF:

uart:~$ hfp ag disconnect
  1. Connection is broken:

AG disconnected

HFP HF SLC

The hfp hf subcommand provides functionality for HFP HF in Bluetooth Classic.

  1. Register HFP HF:

uart:~$ hfp hf reg
  1. Connect to HFP AG:

uart:~$ hfp hf connect 2
  1. Connection is established with the AG device:

Security changed: XX:XX:XX:XX:XX:XX level 2
HF service 0
HF signal 0
HF roam 0
HF battery 0
HF ring: in-band
HF connected
  1. Disconnect from HFP HF:

uart:~$ hfp hf disconnect
  1. Connection is broken:

HF disconnected

Call outgoing

Place a call with the Phone number supplied by the AG:

uart:~$ hfp ag outgoing 123456
AG outgoing call 0x20007690, number 123456
AG SCO connected 0x20005248
AG SCO info:
  SCO handle 0x0008
  SCO air mode 2
  SCO link type 2
uart:~$ hfp ag remote_ringing 0
AG call 0x20007690 start ringing mode 1
uart:~$ hfp ag remote_accept 0
AG call 0x20007690 accept

Place a call with the Phone number supplied by the HF:

uart:~$
AG number call
AG outgoing call 0x20007690, number 123456789
AG SCO connected 0x20005248
AG SCO info:
  SCO handle 0x0008
  SCO air mode 2
  SCO link type 2
uart:~$ hfp ag remote_ringing 0
AG call 0x20007690 start ringing mode 1
uart:~$ hfp ag remote_accept 0
AG call 0x20007690 accept

Call incoming

Answer incoming call from the AG:

uart:~$ hfp ag remote_incoming 123456
AG incoming call 0x20007690, number 123456
AG call 0x20007690 start ringing mode 1
AG SCO connected 0x20005248
AG SCO info:
  SCO handle 0x0008
  SCO air mode 2
  SCO link type 2
uart:~$ hfp ag accept 0
AG call 0x20007690 accept

Answer incoming call from the HF:

uart:~$ hfp ag remote_incoming 123456
AG incoming call 0x20007690, number 123456
AG codec negotiation result 0
AG call 0x20007690 start ringing mode 1
AG SCO connected 0x20005248
AG SCO info:
  SCO handle 0x0008
  SCO air mode 2
  SCO link type 2
AG call 0x20007690 accept

Call termination

After the call (outgoing or incoming) is accepted, it can be terminated from either the AG (Audio Gateway) or HF (Hands-Free) side.

Terminate a call process from the AG:

uart:~$ hfp ag terminate 0
AG call 0x20007690 terminate
AG SCO disconnected 0x20005248 (reason 22)

Terminate a call process from the HF:

AG call 0x20007690 terminate
AG SCO disconnected 0x20005248 (reason 22)

Terminate a call process from the remote:

uart:~$ hfp ag remote_terminate 0
AG call 0x20007690 terminate
AG SCO disconnected 0x20005248 (reason 22)