mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-04 06:39:53 +00:00
Merge branch 'master' of https://github.com/bluekitchen/btstack
This commit is contained in:
commit
4651e1ae77
@ -282,6 +282,9 @@ void hfp_reset_context_flags(hfp_connection_t * hfp_connection){
|
|||||||
hfp_connection->codec_confirmed = 0;
|
hfp_connection->codec_confirmed = 0;
|
||||||
|
|
||||||
hfp_connection->establish_audio_connection = 0;
|
hfp_connection->establish_audio_connection = 0;
|
||||||
|
hfp_connection->call_waiting_notification_enabled = 0;
|
||||||
|
hfp_connection->command = HFP_CMD_NONE;
|
||||||
|
hfp_connection->enable_status_update_for_ag_indicators = 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static hfp_connection_t * create_hfp_connection_context(){
|
static hfp_connection_t * create_hfp_connection_context(){
|
||||||
@ -296,9 +299,8 @@ static hfp_connection_t * create_hfp_connection_context(){
|
|||||||
|
|
||||||
hfp_connection->parser_state = HFP_PARSER_CMD_HEADER;
|
hfp_connection->parser_state = HFP_PARSER_CMD_HEADER;
|
||||||
hfp_connection->command = HFP_CMD_NONE;
|
hfp_connection->command = HFP_CMD_NONE;
|
||||||
hfp_connection->negotiated_codec = 0;
|
|
||||||
|
|
||||||
hfp_connection->enable_status_update_for_ag_indicators = 0xFF;
|
hfp_reset_context_flags(hfp_connection);
|
||||||
|
|
||||||
linked_list_add(&hfp_connections, (linked_item_t*)hfp_connection);
|
linked_list_add(&hfp_connections, (linked_item_t*)hfp_connection);
|
||||||
return hfp_connection;
|
return hfp_connection;
|
||||||
|
@ -559,6 +559,7 @@ typedef struct hfp_connection {
|
|||||||
uint8_t ag_send_clip;
|
uint8_t ag_send_clip;
|
||||||
uint8_t ag_echo_and_noise_reduction;
|
uint8_t ag_echo_and_noise_reduction;
|
||||||
uint8_t ag_activate_voice_recognition;
|
uint8_t ag_activate_voice_recognition;
|
||||||
|
uint8_t ag_notify_incoming_call_waiting;
|
||||||
uint8_t send_subscriber_number;
|
uint8_t send_subscriber_number;
|
||||||
uint8_t next_subscriber_number_to_send;
|
uint8_t next_subscriber_number_to_send;
|
||||||
|
|
||||||
|
15
src/hfp_ag.c
15
src/hfp_ag.c
@ -219,7 +219,7 @@ static int hfp_ag_send_phone_number_for_voice_tag_cmd(uint16_t cid){
|
|||||||
|
|
||||||
static int hfp_ag_send_call_waiting_notification(uint16_t cid){
|
static int hfp_ag_send_call_waiting_notification(uint16_t cid){
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
sprintf(buffer, "\r\n+CCWA: \"%s\",%u\r\n", hfp_gsm_clip_number(), hfp_gsm_clip_type());
|
sprintf(buffer, "\r\n%s: \"%s\",%u\r\n", HFP_ENABLE_CALL_WAITING_NOTIFICATION, hfp_gsm_clip_number(), hfp_gsm_clip_type());
|
||||||
return send_str_over_rfcomm(cid, buffer);
|
return send_str_over_rfcomm(cid, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1605,6 +1605,12 @@ static void hfp_run_for_context(hfp_connection_t *hfp_connection){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hfp_connection->ag_notify_incoming_call_waiting){
|
||||||
|
hfp_connection->ag_notify_incoming_call_waiting = 0;
|
||||||
|
hfp_ag_send_call_waiting_notification(hfp_connection->rfcomm_cid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (hfp_connection->command == HFP_CMD_UNKNOWN){
|
if (hfp_connection->command == HFP_CMD_UNKNOWN){
|
||||||
hfp_connection->ok_pending = 0;
|
hfp_connection->ok_pending = 0;
|
||||||
hfp_connection->send_error = 0;
|
hfp_connection->send_error = 0;
|
||||||
@ -2245,4 +2251,11 @@ void hfp_ag_clear_last_dialed_number(void){
|
|||||||
hfp_gsm_clear_last_dialed_number();
|
hfp_gsm_clear_last_dialed_number();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hfp_ag_notify_incoming_call_waiting(bd_addr_t bd_addr){
|
||||||
|
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_bd_addr(bd_addr);
|
||||||
|
if (!hfp_connection->call_waiting_notification_enabled) return;
|
||||||
|
|
||||||
|
hfp_connection->ag_notify_incoming_call_waiting = 1;
|
||||||
|
hfp_run_for_context(hfp_connection);
|
||||||
|
}
|
||||||
|
|
||||||
|
59
src/hfp_ag.h
59
src/hfp_ag.h
@ -220,6 +220,13 @@ void hfp_ag_set_battery_level(int level);
|
|||||||
*/
|
*/
|
||||||
void hfp_ag_clear_last_dialed_number(void);
|
void hfp_ag_clear_last_dialed_number(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief Notify the HF that an incoming call is waiting
|
||||||
|
* during an ongoing call. The notification will be sent only if the HF has
|
||||||
|
* has previously enabled the "Call Waiting notification" in the AG.
|
||||||
|
* @param bd_addr Bluetooth address of the HF
|
||||||
|
*/
|
||||||
|
void hfp_ag_notify_incoming_call_waiting(bd_addr_t bd_addr);
|
||||||
|
|
||||||
// Voice Recognition
|
// Voice Recognition
|
||||||
|
|
||||||
@ -231,85 +238,85 @@ void hfp_ag_clear_last_dialed_number(void);
|
|||||||
void hfp_ag_activate_voice_recognition(bd_addr_t bd_addr, int activate);
|
void hfp_ag_activate_voice_recognition(bd_addr_t bd_addr, int activate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief
|
* @brief Send a phone number back to the HF.
|
||||||
* @param bd_addr Bluetooth address of the HF
|
* @param bd_addr Bluetooth address of the HF
|
||||||
* @param number
|
* @param phone_number
|
||||||
*/
|
*/
|
||||||
void hfp_ag_send_phone_number_for_voice_tag(bd_addr_t bd_addr, const char * number);
|
void hfp_ag_send_phone_number_for_voice_tag(bd_addr_t bd_addr, const char * phone_number);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief
|
* @brief Reject sending a phone number to the HF.
|
||||||
* @param bd_addr Bluetooth address of the HF
|
* @param bd_addr Bluetooth address of the HF
|
||||||
*/
|
*/
|
||||||
void hfp_ag_reject_phone_number_for_voice_tag(bd_addr_t bd_addr);
|
void hfp_ag_reject_phone_number_for_voice_tag(bd_addr_t bd_addr);
|
||||||
|
|
||||||
|
|
||||||
// Cellular Actions
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Store phone number with initiated call.
|
||||||
*/
|
|
||||||
void hfp_ag_incoming_call(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief number is stored.
|
|
||||||
* @param type
|
* @param type
|
||||||
* @param number
|
* @param number
|
||||||
*/
|
*/
|
||||||
void hfp_ag_set_clip(uint8_t type, const char * number);
|
void hfp_ag_set_clip(uint8_t type, const char * number);
|
||||||
|
|
||||||
|
|
||||||
|
// Cellular Actions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Pass the accept incoming call event to the AG.
|
||||||
|
*/
|
||||||
|
void hfp_ag_incoming_call(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Pass the reject outgoing call event to the AG.
|
||||||
*/
|
*/
|
||||||
void hfp_ag_outgoing_call_rejected(void);
|
void hfp_ag_outgoing_call_rejected(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Pass the accept outgoing call event to the AG.
|
||||||
*/
|
*/
|
||||||
void hfp_ag_outgoing_call_accepted(void);
|
void hfp_ag_outgoing_call_accepted(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Pass the outgoing call ringing event to the AG.
|
||||||
*/
|
*/
|
||||||
void hfp_ag_outgoing_call_ringing(void);
|
void hfp_ag_outgoing_call_ringing(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Pass the outgoing call established event to the AG.
|
||||||
*/
|
*/
|
||||||
void hfp_ag_outgoing_call_established(void);
|
void hfp_ag_outgoing_call_established(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief Pass the call droped event to the AG.
|
||||||
*/
|
*/
|
||||||
void hfp_ag_call_dropped(void);
|
void hfp_ag_call_dropped(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief
|
* @brief Set network registration status.
|
||||||
* @param status
|
* @param status 0 - not registered, 1 - registered
|
||||||
*/
|
*/
|
||||||
void hfp_ag_set_registration_status(int status);
|
void hfp_ag_set_registration_status(int status);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief
|
* @brief Set network signal strength.
|
||||||
* @param strength
|
* @param strength [0-5]
|
||||||
*/
|
*/
|
||||||
void hfp_ag_set_signal_strength(int strength);
|
void hfp_ag_set_signal_strength(int strength);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief
|
* @brief Set roaming status.
|
||||||
* @param status
|
* @param status 0 - no roaming, 1 - roaming active
|
||||||
*/
|
*/
|
||||||
void hfp_ag_set_roaming_status(int status);
|
void hfp_ag_set_roaming_status(int status);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief
|
* @brief Set subcriber number information, e.g. the phone number
|
||||||
* @param numbers
|
* @param numbers
|
||||||
* @param numbers_count
|
* @param numbers_count
|
||||||
*/
|
*/
|
||||||
void hfp_ag_set_subcriber_number_information(hfp_phone_number_t * numbers, int numbers_count);
|
void hfp_ag_set_subcriber_number_information(hfp_phone_number_t * numbers, int numbers_count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Called by cellular unit after a DTMF code was transmitted, so that the next one can be emitted
|
* @brief Called by cellular unit after a DTMF code was transmitted, so that the next one can be emitted.
|
||||||
* @param bd_addr Bluetooth address of the HF
|
* @param bd_addr Bluetooth address of the HF
|
||||||
*/
|
*/
|
||||||
void hfp_ag_send_dtmf_code_done(bd_addr_t bd_addr);
|
void hfp_ag_send_dtmf_code_done(bd_addr_t bd_addr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user