void CreateAudioConnection(void) { hfp_audio_params * audio_params = NULL; HfpAudioTransferRequest(hfp_primary_link, hfp_audio_to_hfp , theSink.HFP_supp_features.packet_types, audio_params ); }
/**************************************************************************** NAME sinkTransferToggle DESCRIPTION If the audio is at the device end transfer it back to the AG and vice versa. RETURNS void */ void sinkTransferToggle( uint16 eventId ) { /* Get the link to toggle audio on */ hfp_link_priority priority = audioGetLinkPriority(FALSE); sync_pkt_type packet_type; hfp_audio_params* audio_params; audio_params = audioGetSettings(priority, &packet_type); AUD_DEBUG(("AUD: Audio Transfer\n")) ; /* Perform audio transfer */ HfpAudioTransferRequest(priority, hfp_audio_transfer, packet_type, audio_params ); }
/**************************************************************************** NAME sinkCheckForAudioTransfer DESCRIPTION checks on connection for an audio connction and performs a transfer if not present RETURNS void */ void sinkCheckForAudioTransfer ( void ) { sinkState lState = stateManagerGetState() ; AUD_DEBUG(("AUD: Tx[%d] [%x]\n", lState , (int)theSink.routed_audio)) ; switch (lState) { case deviceIncomingCallEstablish : case deviceThreeWayCallWaiting : case deviceThreeWayCallOnHold : case deviceThreeWayMulticall : case deviceIncomingCallOnHold : case deviceActiveCallNoSCO : { Sink sink; hfp_call_state state; hfp_link_priority priority = hfp_invalid_link; /* check call state and sink of AG1 */ if((HfpLinkGetCallState(hfp_primary_link, &state))&&(state == hfp_call_state_active)&& (HfpLinkGetAudioSink(hfp_primary_link, &sink))&&(!sink)) { priority = hfp_primary_link; } /* or check call state and sink of AG2 */ else if((HfpLinkGetCallState(hfp_secondary_link, &state))&&(state == hfp_call_state_active)&& (HfpLinkGetAudioSink(hfp_secondary_link, &sink))&&(!sink)) { priority = hfp_secondary_link; } /* if call found with no audio */ if (priority) { hfp_audio_params * audio_params = NULL; HfpAudioTransferRequest(priority, hfp_audio_to_hfp , theSink.HFP_supp_features.packet_types, audio_params ); } } break ; default: break; } }
/**************************************************************************** NAME sinkTransferToggle DESCRIPTION If the audio is at the device end transfer it back to the AG and vice versa. RETURNS void */ void sinkTransferToggle( uint16 eventId ) { /* Get the link to toggle audio on */ hfp_link_priority priority = audioGetLinkPriority(FALSE); sync_pkt_type packet_type; hfp_audio_params* audio_params; audio_params = audioGetSettings(priority, &packet_type); /* Mask out all but SCO packet types if feature enabled */ if(theSink.features.audio_sco) packet_type = (packet_type & sync_all_sco) | sync_all_edr_esco; AUD_DEBUG(("AUD: Audio Transfer\n")) ; /* Perform audio transfer */ HfpAudioTransferRequest(priority, hfp_audio_transfer, packet_type, audio_params ); }