自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release 而非 aosp-main 建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
  
         
       
     
  
  
  
    
  
  
  
    
    
      
    
    
      
      透過集合功能整理內容
    
    
      
      你可以依據偏好儲存及分類內容。
    
  
  
    
  
  
  
  
    
  
  
    
    
    
  
  bthf_interface_t 結構體參考資料
 
  
   #include <
   
    bt_hf.h
   
   >
  
 
 
  
   | 
    
    | 
  
  
   | 
    size_t 
    | 
   
    
     size
    
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     init
    
    )(
    
     bthf_callbacks_t
    
    *callbacks, int max_hf_clients)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     connect
    
    )(bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     disconnect
    
    )(bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     connect_audio
    
    )(bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     disconnect_audio
    
    )(bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     start_voice_recognition
    
    )(bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     stop_voice_recognition
    
    )(bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     volume_control
    
    )(
    
     bthf_volume_type_t
    
    type, int volume, bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     device_status_notification
    
    )(
    
     bthf_network_state_t
    
    ntk_state,
    
     bthf_service_type_t
    
    svc_type, int signal, int batt_chg)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     cops_response
    
    )(const char *cops, bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     cind_response
    
    )(int svc, int num_active, int num_held,
    
     bthf_call_state_t
    
    call_setup_state, int signal, int roam, int batt_chg, bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     formatted_at_response
    
    )(const char *rsp, bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     at_response
    
    )(
    
     bthf_at_response_t
    
    response_code, int error_code, bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     clcc_response
    
    )(int index,
    
     bthf_call_direction_t
    
    dir,
    
     bthf_call_state_t
    
    state,
    
     bthf_call_mode_t
    
    mode,
    
     bthf_call_mpty_type_t
    
    mpty, const char *number,
    
     bthf_call_addrtype_t
    
    type, bt_bdaddr_t *bd_addr)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     phone_state_change
    
    )(int num_active, int num_held,
    
     bthf_call_state_t
    
    call_setup_state, const char *number,
    
     bthf_call_addrtype_t
    
    type)
    | 
  
  
   | 
     
    | 
  
  
   | 
    void(* 
    | 
   
    
     cleanup
    
    )(void)
    | 
  
  
   | 
     
    | 
  
  
   | 
    
     bt_status_t
    
    (* 
    | 
   
    
     configure_wbs
    
    )(bt_bdaddr_t *bd_addr,
    
     bthf_wbs_config_t
    
    config)
    | 
  
  
   | 
     
    | 
  
 
 
 
 
 
  
   代表標準 BT-HF 介面。
  
   定義位於檔案 
    bt_hf.h
    的第 
    223
    行。
  
 
 
 
 
 
 
 
  
   
    
     | 
      
       bt_status_t
      
      (* cind_response)(int svc, int num_active, int num_held,
      
       bthf_call_state_t
      
      call_setup_state, int signal, int roam, int batt_chg, bt_bdaddr_t *bd_addr)
      | 
    
   
   
  
  
 
 
 
  
  
   
    回應 CLCC 指令可針對每個呼叫索引重複呼叫,呼叫索引為 0 的情況會視為空值結束 (完成回應)
   
   
    定義位於檔案 
     bt_hf.h 的 
     277
     行。
    
   
  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
   
    
     | 
      
       bt_status_t
      
      (* cops_response)(const char *cops, bt_bdaddr_t *bd_addr)
      | 
    
   
   
  
  
 
 
 
 
 
 
 
 
 
 
 
 
  
   
    
     | 
      
       bt_status_t
      
      (* formatted_at_response)(const char *rsp, bt_bdaddr_t *bd_addr)
      | 
    
   
   
  
   
    預先格式化的 AT 回應,通常用於回應不明的 AT 指令
   
    定義位於檔案 
     bt_hf.h
     的第 
     265
     行。
   
  
 
 
 
 
 
 
  
  
   
    通知通話狀態變更。每次更新都會通知
   
    - 
     有效/保留/響鈴通話數量
 
    - 
     call_state:表示觸發此訊息的狀態變更。這會採用 BtHfCallState 的其中一個值
    
 
    - 
     號碼和類型:僅適用於來電和等候中的通話
    
 
   
   
    定義位於檔案 
     bt_hf.h 的 
     289
     行。
    
   
  
 
 
 
 
 
 
  
   
    
     | 
      
       bt_status_t
      
      (* start_voice_recognition)(bt_bdaddr_t *bd_addr)
      | 
    
   
   
  
  
 
 
 
  
   
    
     | 
      
       bt_status_t
      
      (* stop_voice_recognition)(bt_bdaddr_t *bd_addr)
      | 
    
   
   
  
  
 
 
 
 
這個結構體的說明文件是由下列檔案產生:
 
  - 
   hardware/libhardware/include/hardware/
   
    bt_hf.h
   
  
 
 
 
 
  
  
  
 
  
    
    
      
       
    
    
  
  
  這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
  上次更新時間:2025-07-27 (世界標準時間)。
  
  
  
    
      [null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[]]