mtk 关于情景模式中的蓝牙模式

/*****************************************************************************
 * FUNCTION
 *  srv_bt_cm_get_existed_conn_info
 * DESCRIPTION
 *  This function is to get existed connection info
 * PARAMETERS
 *  index       [IN]           existed connection index
 * RETURNS
 *  srv_bt_cm_connect_struct      existed connection info
 *****************************************************************************/
srv_bt_cm_connect_struct *srv_bt_cm_get_existed_conn_info(U16 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_BT_ASSERT(index == 0 || index < g_srv_bt_cm_cntx.existed_conn_num);

    return &(g_srv_bt_cm_cntx.existed_conn[index]);

}

 

 

 

/*****************************************************************************
 * FUNCTION
 *  srv_bt_cm_is_profile_connected
 * DESCRIPTION
 *  This function is to check if XXX profile connected
 * PARAMETERS
 *  conn_type       [IN]        to check if conn_type is connected, conn_type is defind in srv_bt_cm_connection_type
 * RETURNS
 *  MMI_BOOL            TRUE : the profile is connected
 *                      FALSE : the profile is not connected
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_profile_connected(srv_bt_cm_connection_type conn_type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U32 i = 0;
    U8 act_con_num = 0;
    srv_bt_cm_connect_struct *conn_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    act_con_num = srv_bt_cm_get_existed_conn_num();

    /* get index of existed_conn */
    for (i = 0; i < act_con_num; i++)
    {
        conn_p = srv_bt_cm_get_existed_conn_info((U16) i);
        if (conn_p->conn_type == conn_type && conn_p->active == MMI_TRUE)
        {
            MMI_TRACE(MMI_CONN_TRC_G7_BT, MMI_BT_G7_SRV_BT_CM_IS_PROFILE_CONNECTED, conn_type, MMI_TRUE);
            return MMI_TRUE;
        }
    }
    MMI_TRACE(MMI_CONN_TRC_G7_BT, MMI_BT_G7_SRV_BT_CM_IS_PROFILE_CONNECTED, conn_type, MMI_FALSE);       
    return MMI_FALSE;
}

 

 

/*****************************************************************************
 * FUNCTION
 *  srv_bt_cm_is_profile_connected_type
 * DESCRIPTION
 *  This function is to check if BT connected
 * PARAMETERS
 *  NULL
 * RETURNS
 *  MMI_BOOL            TRUE : the profile is connected
 *                      FALSE : the profile is not connected
 *****************************************************************************/

MMI_BOOL srv_bt_cm_is_profile_connected_type(void)
{
    if ((srv_bt_cm_is_profile_connected(SRV_BT_CM_HFP_CONNECTION) &&
                !srv_bt_cm_is_profile_connected(SRV_BT_CM_HSP_CONNECTION)))//蓝牙
    {
        return MMI_TRUE;
    }
    return MMI_FALSE;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值