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 11 #include "cras_bt_device.h" 12 13 /* Hands-free Audio Gateway feature bits, listed in according 14 * to their order in the bitmap defined in HFP spec. 15 */ 16 /* Call waiting and 3-way calling */ 17 #define HFP_THREE_WAY_CALLING 0x0001 18 /* EC and/or NR function */ 19 #define HFP_EC_ANDOR_NR 0x0002 20 /* Voice recognition activation */ 21 #define HFP_VOICE_RECOGNITION 0x0004 22 /* Inband ringtone */ 23 #define HFP_INBAND_RINGTONE 0x0008 24 /* Attach a number to voice tag */ 25 #define HFP_ATTACH_NUMBER_TO_VOICETAG 0x0010 26 /* Ability to reject a call */ 27 #define HFP_REJECT_A_CALL 0x0020 28 /* Enhanced call status */ 29 #define HFP_ENHANCED_CALL_STATUS 0x0040 30 /* Enhanced call control */ 31 #define HFP_ENHANCED_CALL_CONTRO 0x0080 32 /* Extended error result codes */ 33 #define HFP_EXTENDED_ERROR_RESULT_CODES 0x0100 34 /* Codec negotiation */ 35 #define HFP_CODEC_NEGOTIATION 0x0200 36 37 #define HFP_SUPPORTED_FEATURE (HFP_ENHANCED_CALL_STATUS) 38 39 struct hfp_slc_handle; 40 41 /* Adds a profile instance for HFP AG (Hands-Free Profile Audio Gateway). */ 42 int cras_hfp_ag_profile_create(DBusConnection *conn); 43 44 45 /* Adds a profile instance for HSP AG (Headset Profile Audio Gateway). */ 46 int cras_hsp_ag_profile_create(DBusConnection *conn); 47 48 /* Starts the HFP audio gateway for audio input/output. */ 49 int cras_hfp_ag_start(struct cras_bt_device *device); 50 51 /* Suspends all connected audio gateways, used to stop HFP/HSP audio when 52 * an A2DP only device is connected. */ 53 void cras_hfp_ag_suspend(); 54 55 /* Suspends audio gateway associated with given bt device. */ 56 void cras_hfp_ag_suspend_connected_device(struct cras_bt_device *device); 57 58 /* Gets the active SLC handle. Used for HFP qualification. */ 59 struct hfp_slc_handle *cras_hfp_ag_get_active_handle(); 60 61 /* Gets the SLC handle for given cras_bt_device. */ 62 struct hfp_slc_handle *cras_hfp_ag_get_slc(struct cras_bt_device *device); 63 64 #endif /* CRAS_HFP_AG_PROFILE_H_ */ 65