예제 #1
0
/****************************************************************************
NAME 
 VolumeDown

DESCRIPTION
 Decrements volume - sends a response to the AG

RETURNS
 void
    
*/
void VolumeDown ( void )
{
    uint16 lOldVol = 0;
    uint16 lNewVol = 0;
  
    /* check for a2dp streaming before checking for hpf profiles */
    if(!CheckVolumeA2dp(decrease_volume) && theHeadset.conf->no_of_profiles_connected)
    {
        /* Get the link to change volume on */
        hfp_link_priority priority = audioGetLinkPriority(TRUE);

        /* get current volume for this profile */
        lOldVol = theHeadset.profile_data[PROFILE_INDEX(priority)].audio.gSMVolumeLevel;
        /* obtain new volume level */
        lNewVol = theHeadset.audioData.gVolMaps[lOldVol].DecVol ;
        /* send, set and store new volume level */

		#if 1
		VolumeSendAndSetHeadsetVolume ( lNewVol ,TRUE ,priority,decrease_volume) ;
		#else
        VolumeSendAndSetHeadsetVolume ( lNewVol ,TRUE ,priority) ;
        #endif
		
       	VOL_DEBUG(("VOL: VolDwn[%d][%d]to AG%d\n",lOldVol, lNewVol, priority))  ;
    }      
}
예제 #2
0
/****************************************************************************
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 );
}
예제 #3
0
파일: sink_audio.c 프로젝트: NemProjects/BC
/****************************************************************************
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 );
}