summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanket Agarwal <sanketa@google.com>2016-11-30 01:23:42 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-11-30 01:23:42 +0000
commita76ae0e5112a7972dae65fcb150f5a2fa1cb15de (patch)
tree9fe4fbe9c8721b82d563a22ecd28c040bc24299a
parenta24fcc412f8564f4ae98060724dc338fe51a8398 (diff)
parent2659e44f75af69a431d4578b8f40058824a744e8 (diff)
downloadlibhardware-a76ae0e5112a7972dae65fcb150f5a2fa1cb15de.tar.gz
Merge "Add Bluetooth device address parameter to HF Client APIs"
-rw-r--r--include/hardware/bt_hf_client.h98
1 files changed, 59 insertions, 39 deletions
diff --git a/include/hardware/bt_hf_client.h b/include/hardware/bt_hf_client.h
index 8acf1b2c..b728be3c 100644
--- a/include/hardware/bt_hf_client.h
+++ b/include/hardware/bt_hf_client.h
@@ -167,104 +167,120 @@ typedef enum {
* state will have one of the values from BtHfConnectionState
* peer/chld_features are valid only for BTHF_CLIENT_CONNECTION_STATE_SLC_CONNECTED state
*/
-typedef void (* bthf_client_connection_state_callback)(bthf_client_connection_state_t state,
+typedef void (* bthf_client_connection_state_callback)(const bt_bdaddr_t *bd_addr,
+ bthf_client_connection_state_t state,
unsigned int peer_feat,
- unsigned int chld_feat,
- bt_bdaddr_t *bd_addr);
+ unsigned int chld_feat);
/** Callback for audio connection state change.
* state will have one of the values from BtHfAudioState
*/
-typedef void (* bthf_client_audio_state_callback)(bthf_client_audio_state_t state,
- bt_bdaddr_t *bd_addr);
+typedef void (* bthf_client_audio_state_callback)(const bt_bdaddr_t *bd_addr,
+ bthf_client_audio_state_t state);
/** Callback for VR connection state change.
* state will have one of the values from BtHfVRState
*/
-typedef void (* bthf_client_vr_cmd_callback)(bthf_client_vr_state_t state);
+typedef void (* bthf_client_vr_cmd_callback)(const bt_bdaddr_t *bd_addr, bthf_client_vr_state_t state);
/** Callback for network state change
*/
-typedef void (* bthf_client_network_state_callback) (bthf_client_network_state_t state);
+typedef void (* bthf_client_network_state_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_network_state_t state);
/** Callback for network roaming status change
*/
-typedef void (* bthf_client_network_roaming_callback) (bthf_client_service_type_t type);
+typedef void (* bthf_client_network_roaming_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_service_type_t type);
/** Callback for signal strength indication
*/
-typedef void (* bthf_client_network_signal_callback) (int signal_strength);
+typedef void (* bthf_client_network_signal_callback) (const bt_bdaddr_t *bd_addr,
+ int signal_strength);
/** Callback for battery level indication
*/
-typedef void (* bthf_client_battery_level_callback) (int battery_level);
+typedef void (* bthf_client_battery_level_callback) (const bt_bdaddr_t *bd_addr,
+ int battery_level);
/** Callback for current operator name
*/
-typedef void (* bthf_client_current_operator_callback) (const char *name);
+typedef void (* bthf_client_current_operator_callback) (const bt_bdaddr_t *bd_addr,
+ const char *name);
/** Callback for call indicator
*/
-typedef void (* bthf_client_call_callback) (bthf_client_call_t call);
+typedef void (* bthf_client_call_callback) (const bt_bdaddr_t *bd_addr, bthf_client_call_t call);
/** Callback for callsetup indicator
*/
-typedef void (* bthf_client_callsetup_callback) (bthf_client_callsetup_t callsetup);
+typedef void (* bthf_client_callsetup_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_callsetup_t callsetup);
/** Callback for callheld indicator
*/
-typedef void (* bthf_client_callheld_callback) (bthf_client_callheld_t callheld);
+typedef void (* bthf_client_callheld_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_callheld_t callheld);
/** Callback for response and hold
*/
-typedef void (* bthf_client_resp_and_hold_callback) (bthf_client_resp_and_hold_t resp_and_hold);
+typedef void (* bthf_client_resp_and_hold_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_resp_and_hold_t resp_and_hold);
/** Callback for Calling Line Identification notification
* Will be called only when there is an incoming call and number is provided.
*/
-typedef void (* bthf_client_clip_callback) (const char *number);
+typedef void (* bthf_client_clip_callback) (const bt_bdaddr_t *bd_addr, const char *number);
/**
* Callback for Call Waiting notification
*/
-typedef void (* bthf_client_call_waiting_callback) (const char *number);
+typedef void (* bthf_client_call_waiting_callback) (const bt_bdaddr_t *bd_addr, const char *number);
/**
* Callback for listing current calls. Can be called multiple time.
* If number is unknown NULL is passed.
*/
-typedef void (*bthf_client_current_calls) (int index, bthf_client_call_direction_t dir,
+typedef void (*bthf_client_current_calls) (const bt_bdaddr_t *bd_addr, int index,
+ bthf_client_call_direction_t dir,
bthf_client_call_state_t state,
bthf_client_call_mpty_type_t mpty,
const char *number);
/** Callback for audio volume change
*/
-typedef void (*bthf_client_volume_change_callback) (bthf_client_volume_type_t type, int volume);
+typedef void (*bthf_client_volume_change_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_volume_type_t type,
+ int volume);
/** Callback for command complete event
* cme is valid only for BTHF_CLIENT_CMD_COMPLETE_ERROR_CME type
*/
-typedef void (*bthf_client_cmd_complete_callback) (bthf_client_cmd_complete_t type, int cme);
+typedef void (*bthf_client_cmd_complete_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_cmd_complete_t type,
+ int cme);
/** Callback for subscriber information
*/
-typedef void (* bthf_client_subscriber_info_callback) (const char *name,
+typedef void (* bthf_client_subscriber_info_callback) (const bt_bdaddr_t *bd_addr,
+ const char *name,
bthf_client_subscriber_service_type_t type);
/** Callback for in-band ring tone settings
*/
-typedef void (* bthf_client_in_band_ring_tone_callback) (bthf_client_in_band_ring_state_t state);
+typedef void (* bthf_client_in_band_ring_tone_callback) (const bt_bdaddr_t *bd_addr,
+ bthf_client_in_band_ring_state_t state);
/**
* Callback for requested number from AG
*/
-typedef void (* bthf_client_last_voice_tag_number_callback) (const char *number);
+typedef void (* bthf_client_last_voice_tag_number_callback) (const bt_bdaddr_t *bd_addr,
+ const char *number);
/**
* Callback for sending ring indication to app
*/
-typedef void (* bthf_client_ring_indication_callback) (void);
+typedef void (* bthf_client_ring_indication_callback) (const bt_bdaddr_t *bd_addr);
/** BT-HF callback structure. */
typedef struct {
@@ -307,55 +323,59 @@ typedef struct {
bt_status_t (*connect)(bt_bdaddr_t *bd_addr);
/** disconnect from audio gateway */
- bt_status_t (*disconnect)(bt_bdaddr_t *bd_addr);
+ bt_status_t (*disconnect)(const bt_bdaddr_t *bd_addr);
/** create an audio connection */
- bt_status_t (*connect_audio)(bt_bdaddr_t *bd_addr);
+ bt_status_t (*connect_audio)(const bt_bdaddr_t *bd_addr);
/** close the audio connection */
- bt_status_t (*disconnect_audio)(bt_bdaddr_t *bd_addr);
+ bt_status_t (*disconnect_audio)(const bt_bdaddr_t *bd_addr);
/** start voice recognition */
- bt_status_t (*start_voice_recognition)(void);
+ bt_status_t (*start_voice_recognition)(const bt_bdaddr_t *bd_addr);
/** stop voice recognition */
- bt_status_t (*stop_voice_recognition)(void);
+ bt_status_t (*stop_voice_recognition)(const bt_bdaddr_t *bd_addr);
/** volume control */
- bt_status_t (*volume_control) (bthf_client_volume_type_t type, int volume);
+ bt_status_t (*volume_control) (const bt_bdaddr_t *bd_addr,
+ bthf_client_volume_type_t type,
+ int volume);
/** place a call with number a number
* if number is NULL last called number is called (aka re-dial)*/
- bt_status_t (*dial) (const char *number);
+ bt_status_t (*dial) (const bt_bdaddr_t *bd_addr, const char *number);
/** place a call with number specified by location (speed dial) */
- bt_status_t (*dial_memory) (int location);
+ bt_status_t (*dial_memory) (const bt_bdaddr_t *bd_addr, int location);
/** perform specified call related action
* idx is limited only for enhanced call control related action
*/
- bt_status_t (*handle_call_action) (bthf_client_call_action_t action, int idx);
+ bt_status_t (*handle_call_action) (const bt_bdaddr_t *bd_addr,
+ bthf_client_call_action_t action,
+ int idx);
/** query list of current calls */
- bt_status_t (*query_current_calls) (void);
+ bt_status_t (*query_current_calls) (const bt_bdaddr_t *bd_addr);
/** query name of current selected operator */
- bt_status_t (*query_current_operator_name) (void);
+ bt_status_t (*query_current_operator_name) (const bt_bdaddr_t *bd_addr);
/** Retrieve subscriber information */
- bt_status_t (*retrieve_subscriber_info) (void);
+ bt_status_t (*retrieve_subscriber_info) (const bt_bdaddr_t *bd_addr);
/** Send DTMF code*/
- bt_status_t (*send_dtmf) (char code);
+ bt_status_t (*send_dtmf) (const bt_bdaddr_t *bd_addr, char code);
/** Request a phone number from AG corresponding to last voice tag recorded */
- bt_status_t (*request_last_voice_tag_number) (void);
+ bt_status_t (*request_last_voice_tag_number) (const bt_bdaddr_t *bd_addr);
/** Closes the interface. */
void (*cleanup)(void);
/** Send AT Command. */
- bt_status_t (*send_at_cmd) (int cmd, int val1, int val2, const char *arg);
+ bt_status_t (*send_at_cmd) (const bt_bdaddr_t *bd_addr, int cmd, int val1, int val2, const char *arg);
} bthf_client_interface_t;
__END_DECLS