mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-16 16:20:50 +00:00
hfp_hf: call hfp_hf_run for all events from hfp_handle_hci_event
This commit is contained in:
parent
1c6a0fc0fa
commit
46f073f23a
@ -160,8 +160,6 @@ static btstack_packet_handler_t hfp_ag_callback;
|
||||
static btstack_packet_handler_t hfp_hf_rfcomm_packet_handler;
|
||||
static btstack_packet_handler_t hfp_ag_rfcomm_packet_handler;
|
||||
|
||||
static void (*hfp_hf_run_for_context_fn)(hfp_connection_t * hfp_connection);
|
||||
|
||||
static hfp_connection_t * sco_establishment_active;
|
||||
|
||||
// HFP_SCO_PACKET_TYPES_NONE == no choice/override
|
||||
@ -694,8 +692,6 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
||||
}
|
||||
log_info("hf accept sco %u\n", hfp_connection->hf_accept_sco);
|
||||
sco_establishment_active = hfp_connection;
|
||||
if (!hfp_hf_run_for_context_fn) break;
|
||||
(*hfp_hf_run_for_context_fn)(hfp_connection);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1618,10 +1614,6 @@ void hfp_set_hf_rfcomm_packet_handler(btstack_packet_handler_t handler){
|
||||
hfp_hf_rfcomm_packet_handler = handler;
|
||||
}
|
||||
|
||||
void hfp_set_hf_run_for_context(void (*callback)(hfp_connection_t * hfp_connection)){
|
||||
hfp_hf_run_for_context_fn = callback;
|
||||
}
|
||||
|
||||
void hfp_init(void){
|
||||
hfp_allowed_sco_packet_types = SCO_PACKET_TYPES_ALL;
|
||||
}
|
||||
|
@ -660,7 +660,6 @@ void hfp_set_ag_rfcomm_packet_handler(btstack_packet_handler_t handler);
|
||||
|
||||
void hfp_set_hf_callback(btstack_packet_handler_t callback);
|
||||
void hfp_set_hf_rfcomm_packet_handler(btstack_packet_handler_t handler);
|
||||
void hfp_set_hf_run_for_context(void (*callbcack)(hfp_connection_t * hfp_connection));
|
||||
|
||||
void hfp_init(void);
|
||||
|
||||
|
@ -1141,10 +1141,6 @@ static void hfp_hf_rfcomm_packet_handler(uint8_t packet_type, uint16_t channel,
|
||||
|
||||
static void hfp_hf_hci_event_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
hfp_handle_hci_event(packet_type, channel, packet, size, HFP_ROLE_HF);
|
||||
|
||||
// allow for sco established -> ring transition and sco retry
|
||||
if (packet_type != HCI_EVENT_PACKET) return;
|
||||
if (hci_event_packet_get_type(packet) != HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE) return;
|
||||
hfp_hf_run();
|
||||
}
|
||||
|
||||
@ -1158,9 +1154,7 @@ void hfp_hf_init(uint16_t rfcomm_channel_nr){
|
||||
|
||||
// used to set packet handler for outgoing rfcomm connections - could be handled by emitting an event to us
|
||||
hfp_set_hf_rfcomm_packet_handler(&hfp_hf_rfcomm_packet_handler);
|
||||
|
||||
hfp_set_hf_run_for_context(hfp_hf_run_for_context);
|
||||
|
||||
|
||||
hfp_supported_features = HFP_DEFAULT_HF_SUPPORTED_FEATURES;
|
||||
hfp_codecs_nr = 0;
|
||||
hfp_indicators_nr = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user