QCC3034连接 iphone会出现断开情况

QCC3034连接 iphone会出现断开情况

  需要修改内容如下:

/*
Copyright (c) 2004 - 2016 Qualcomm Technologies International, Ltd.
*/
 
/*!
@file
@ingroup sink_app
@brief   
    Handles link policy and role switch settings across all devices/profiles
*/
 
/****************************************************************************
    Header files
*/
#include "sink_private_data.h"
#include "sink_main_task.h"
#include "sink_private_data_config_def.h"
#include "sink_link_policy.h"
#include "sink_statemanager.h"
#include "sink_devicemanager.h"
#include "sink_swat.h"
#include "sink_audio_routing.h"
 
#include <sink.h>
 
#ifdef ENABLE_PBAP
#include <bdaddr.h>
#include "sink_pbap.h"
#endif
 
#ifdef ENABLE_PEER
/* headers required for sending DM_HCI_QOS_SETUP_REQ */
#include <vm.h>
 
#include <app/bluestack/types.h>
#include <app/bluestack/bluetooth.h>
#include <app/bluestack/hci.h>
#include <app/bluestack/dm_prim.h>
#endif
 
 
/* Lower power table for HFP SLC */
static const lp_power_table lp_powertable_default[2]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_passive,    0,              0,              0,          0,          30},    /* Passive mode 30 seconds */
    {lp_sniff,      800,            800,            2,          1,          0 }     /* Enter sniff mode (500mS)*/
};
 
/* Lower power table for HFP when an audio connection is open */
static const lp_power_table lp_powertable_sco[2]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_passive,    0,              0,              0,          0,          30},    /*Passive mode 30 seconds */
    {lp_sniff,      160,            160,            2,          1,          0}      /* Enter sniff mode (100mS)*/
};
 
static const lp_power_table lp_powertable_a2dp_default[2]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_active,     0,              0,              0,          0,          10},    /* Active mode 10 seconds */
    {lp_sniff,      800,            800,            2,          1,          0 }     /* Enter sniff mode (500mS)*/
};
 
/* Lower power table for A2DP. */
static const lp_power_table lp_powertable_a2dp_stream_sink[]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_passive,    0,              0,              0,          0,          0}      /* Go into passive mode and stay there */
};
 
/* Lower power table for A2DP. */
static const lp_power_table lp_powertable_a2dp_stream_source[]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_active,    0,              0,              0,          0,          0}      /* Go into active mode and stay there */
};
 
#if defined ENABLE_PBAP || defined ENABLE_GAIA
/* Power table for PBAP or GAIA DFU access. */
static const lp_power_table lp_powertable_data_access[]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_active,    0,              0,              0,          0,          0}      /* Go into active mode and stay there */
};
#endif /* defined ENABLE_PBAP || defined ENABLE_GAIA */
 
#ifdef ENABLE_AVRCP
/* Lower power table for AVRCP  */
static const lp_power_table lp_powertable_avrcp[]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_active,    0,              0,              0,          0,          AVRCP_ACTIVE_MODE_INTERVAL},      /* Go into active mode for 10 seconds*/
    {lp_sniff,     800,            800,            2,          1,          0 } 
};
#endif
 
#ifdef ENABLE_SUBWOOFER
static const lp_power_table lp_powertable_subwoofer[2]=
{
 
    /* mode,        min_interval,   max_interval,   attempt,    timeout,    duration */
    {lp_active,     0,              0,              0,          0,          10},    /* Active mode 10 seconds */
    {lp_sniff,      160,            160,            2,          1,          0}      /* Enter sniff mode (100mS)*/
};
#endif
 
#ifdef DEBUG_LP
    #define LP_DEBUG(x) DEBUG(x)
#else
    #define LP_DEBUG(x) 
#endif   
 
 
static uint16 linkPolicyNumberPhysicalConnections (void)
{
 
    uint16 connections = 0;
    Sink sink_pri, sink_sec, sink_a2dp_pri, sink_a2dp_sec;
 
    /* obtain any hfp link sinks */
    HfpLinkGetSlcSink(hfp_primary_link, &sink_pri);
    HfpLinkGetSlcSink(hfp_secondary_link, &sink_sec);
 
    /* obtain sinks for any a2dp links */
    sink_a2dp_pri = A2dpSignallingGetSink(getA2dpLinkDataDeviceId(a2dp_primary));
    sink_a2dp_sec = A2dpSignallingGetSink(getA2dpLinkDataDeviceId(a2dp_secondary));
 
    /* if primary hfp exists then check its role */
    if (sink_pri)
    {
 
        connections++;
    }
 
    /* if secondary hfp connection then check its role */    
    if (sink_sec)
    {
 
        connections++;
    }
 
    /* if primary a2dp exists and it is not the same device as pri or sec hfp connections */
    if (sink_a2dp_pri && !deviceManagerIsSameDevice(a2dp_primary, hfp_primary_link) && !deviceManagerIsSameDevice(a2dp_primary, hfp_secondary_link))
    {
 
        connections++;
    }
 
    /* if secondary a2dp exists and it is not the same device as pri or sec hfp connections */
    if (sink_a2dp_sec && !deviceManagerIsSameDevice(a2dp_secondary, hfp_primary_link) && !deviceManagerIsSameDevice(a2dp_secondary, hfp_secondary_link))
    {
 
        connections++;
    }
 
    LP_DEBUG(("LP: Number of physical connections = %u\n", connections ));    
    return connections;
}
 
/****************************************************************************
NAME    
    linkPolicyUseDefaultSettings
 
DESCRIPTION
    set the link policy based on no a2dp streaming or sco 
 
RETURNS
    void
*/
static void linkPolicyUseDefaultSettings(Sink sink)
{
 
    /* Set up our sniff sub rate params for SLC */
    power_table *userPowerTable = sinkDataGetUserPowerTable();
    ssr_params_t slc_params;
    sinkDataGetSsrSlcParams(&slc_params);
 
    ConnectionSetSniffSubRatePolicy(sink, slc_params.max_remote_ssr_latency, slc_params.min_remote_ssr_tim
  • 21
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值