1 /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6 #ifndef CRAS_HFP_AG_PROFILE_H_ 7 #define CRAS_HFP_AG_PROFILE_H_ 8 9 #include <dbus/dbus.h> 10 #include <stdbool.h> 11 12 #include "cras_bt_device.h" 13 #include "cras_hfp_slc.h" 14 15 /* 16 * For service record profile, 'SupportedFearues' attribute bit mapping 17 * for HFP AG. Bits 0 to 4 are identical to the unsolicited result code 18 * of +BRSF command. 19 */ 20 #define FEATURES_AG_THREE_WAY_CALLING 0x0001 21 #define FEATURES_AG_EC_ANDOR_NR 0x0002 22 #define FEATURES_AG_VOICE_RECOGNITION 0x0004 23 #define FEATURES_AG_INBAND_RINGTONE 0x0008 24 #define FEATURES_AG_ATTACH_NUMBER_TO_VOICETAG 0x0010 25 #define FEATURES_AG_WIDE_BAND_SPEECH 0x0020 26 27 struct hfp_slc_handle; 28 29 /* Adds a profile instance for HFP AG (Hands-Free Profile Audio Gateway). */ 30 int cras_hfp_ag_profile_create(DBusConnection *conn); 31 32 /* Adds a profile instance for HSP AG (Headset Profile Audio Gateway). */ 33 int cras_hsp_ag_profile_create(DBusConnection *conn); 34 35 /* Starts the HFP audio gateway for audio input/output. */ 36 int cras_hfp_ag_start(struct cras_bt_device *device); 37 38 /* 39 * Suspends all connected audio gateways except the one associated to device. 40 * Used to stop previously running HFP/HSP audio when a new device is connected. 41 * Args: 42 * device - The device that we want to keep connection while others should 43 * be removed. 44 */ 45 int cras_hfp_ag_remove_conflict(struct cras_bt_device *device); 46 47 /* Suspends audio gateway associated with given bt device. */ 48 void cras_hfp_ag_suspend_connected_device(struct cras_bt_device *device); 49 50 /* Gets the active SLC handle. Used for HFP qualification. */ 51 struct hfp_slc_handle *cras_hfp_ag_get_active_handle(); 52 53 /* Gets the SLC handle for given cras_bt_device. */ 54 struct hfp_slc_handle *cras_hfp_ag_get_slc(struct cras_bt_device *device); 55 56 /* Gets the logger for WBS packet status. */ 57 struct packet_status_logger *cras_hfp_ag_get_wbs_logger(); 58 59 #endif /* CRAS_HFP_AG_PROFILE_H_ */ 60