mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 10:20:58 +00:00
use global hfp ag indicators
This commit is contained in:
parent
5a36d28b6d
commit
32fbcbfb1f
16
src/hfp_ag.c
16
src/hfp_ag.c
@ -62,7 +62,9 @@
|
|||||||
#include "hfp_ag.h"
|
#include "hfp_ag.h"
|
||||||
|
|
||||||
static const char default_hfp_ag_service_name[] = "Voice gateway";
|
static const char default_hfp_ag_service_name[] = "Voice gateway";
|
||||||
|
|
||||||
static uint16_t hfp_supported_features = HFP_DEFAULT_AG_SUPPORTED_FEATURES;
|
static uint16_t hfp_supported_features = HFP_DEFAULT_AG_SUPPORTED_FEATURES;
|
||||||
|
|
||||||
static uint8_t hfp_codecs_nr = 0;
|
static uint8_t hfp_codecs_nr = 0;
|
||||||
static uint8_t hfp_codecs[HFP_MAX_NUM_CODECS];
|
static uint8_t hfp_codecs[HFP_MAX_NUM_CODECS];
|
||||||
|
|
||||||
@ -95,11 +97,11 @@ hfp_ag_indicator_t * get_hfp_ag_indicators(hfp_connection_t * context){
|
|||||||
return (hfp_ag_indicator_t *)&(context->ag_indicators);
|
return (hfp_ag_indicator_t *)&(context->ag_indicators);
|
||||||
}
|
}
|
||||||
|
|
||||||
static hfp_ag_indicator_t * get_ag_indicator_for_name(hfp_connection_t * context, const char * name){
|
static hfp_ag_indicator_t * get_ag_indicator_for_name(const char * name){
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < context->ag_indicators_nr; i++){
|
for (i = 0; i < hfp_ag_indicators_nr; i++){
|
||||||
if (strcmp(context->ag_indicators[i].name, name) == 0){
|
if (strcmp(hfp_ag_indicators[i].name, name) == 0){
|
||||||
return &context->ag_indicators[i];
|
return &hfp_ag_indicators[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -617,7 +619,7 @@ static int incoming_call_state_machine(hfp_connection_t * context){
|
|||||||
switch (context->call_state){
|
switch (context->call_state){
|
||||||
case HFP_CALL_IDLE:
|
case HFP_CALL_IDLE:
|
||||||
//printf(" HFP_CALL_TRIGGER_AUDIO_CONNECTION \n");
|
//printf(" HFP_CALL_TRIGGER_AUDIO_CONNECTION \n");
|
||||||
indicator = get_ag_indicator_for_name(context, "callsetup");
|
indicator = get_ag_indicator_for_name("callsetup");
|
||||||
if (!indicator) return 0;
|
if (!indicator) return 0;
|
||||||
|
|
||||||
indicator->status = HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS;
|
indicator->status = HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS;
|
||||||
@ -648,7 +650,7 @@ static int incoming_call_state_machine(hfp_connection_t * context){
|
|||||||
case HFP_CALL_TRANSFER_CALL_STATUS:
|
case HFP_CALL_TRANSFER_CALL_STATUS:
|
||||||
//printf(" HFP_CALL_TRANSFER_CALL_STATUS \n");
|
//printf(" HFP_CALL_TRANSFER_CALL_STATUS \n");
|
||||||
context->call_state = HFP_CALL_TRANSFER_CALLSETUP_STATUS;
|
context->call_state = HFP_CALL_TRANSFER_CALLSETUP_STATUS;
|
||||||
indicator = get_ag_indicator_for_name(context, "call");
|
indicator = get_ag_indicator_for_name("call");
|
||||||
indicator->status = HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT;
|
indicator->status = HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT;
|
||||||
hfp_ag_transfer_ag_indicators_status_cmd(context->rfcomm_cid, indicator);
|
hfp_ag_transfer_ag_indicators_status_cmd(context->rfcomm_cid, indicator);
|
||||||
return 1;
|
return 1;
|
||||||
@ -661,7 +663,7 @@ static int incoming_call_state_machine(hfp_connection_t * context){
|
|||||||
context->call_state = HFP_CALL_TRIGGER_AUDIO_CONNECTION;
|
context->call_state = HFP_CALL_TRIGGER_AUDIO_CONNECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
indicator = get_ag_indicator_for_name(context, "callsetup");
|
indicator = get_ag_indicator_for_name("callsetup");
|
||||||
indicator->status = HFP_HELDCALL_STATUS_NO_CALLS_HELD;
|
indicator->status = HFP_HELDCALL_STATUS_NO_CALLS_HELD;
|
||||||
hfp_ag_transfer_ag_indicators_status_cmd(context->rfcomm_cid, indicator);
|
hfp_ag_transfer_ag_indicators_status_cmd(context->rfcomm_cid, indicator);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user