mt2503 Bt Dialer断开与SP连接不成功,一直显示 "Disconnecting "
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
BT Dialer的蓝牙与SP连接成功,用户进行各种操作。
用户断开BT Dialer与SP的连接时,Dialer画面一直显示 "Disconnecting " 。
[SOLUTION]
需要修改如下3个file:
\plutoMMI\Service\DialerSrv\BTDialerSrv.c
\plutommi\Service\PbapSrv\pbapcSrv.c
\plutommi\Service\SppSrv\SppSrv.c
修改如下:
1. \plutommi\Service\DialerSrv\BTDialerSrv.c
修改srv_bt_dialer_disconnect_cnf_hdlr()的实现如下:
MMI_BOOL srv_bt_dialer_disconnect_cnf_hdlr(void *msg)
{
***************************************************
if(disconnect_rsp->result!=0)
{
SRV_BT_DIALER_LOG(SRV_BT_DIALER_DISCONNECT_FAIL);
kal_pROMpt_trace(MOD_MMI_CONN_APP, "[BTDialerSrv] cm_id:%d, hf_state:%d",SRV_BT_DIALER_GET_CM_CONN_ID,
g_bt_dialer_cntx->state);
if (SRV_BT_DIALER_GET_CM_CONN_ID != MMI_HF_INVALID_CONN_ID)
{
srv_bt_cm_stop_conn(SRV_BT_DIALER_GET_CM_CONN_ID);
SRV_BT_DIALER_SET_CM_CONN_ID(MMI_HF_INVALID_CONN_ID);
}
if(g_bt_dialer_cntx->cm_cb)
***********************************************************
}
2. \plutommi\Service\PbapSrv\pbapcSrv.c
(1).修改srv_pbapc_disconnect_req()的实现如下:
void srv_pbapc_disconnect_req(U32 conn_id)
{
***********************
SRV_PBAPC_STATE_TRANS(SRV_PBAPC_STATE_DISCONECTTING);
if (conn_id == 0xff)
{
if(srv_pbap_c->pbapc_cntx.bt_cm_callback)
srv_pbap_c->pbapc_cntx.bt_cm_callback(SRV_BT_CM_PBAPC_CONNECTION, MMI_FALSE, MMI_FALSE);
return;
}
srv_pbapc_send_msg(MSG_ID_BT_PBAPC_DISCONNECT_REQ,NULL);
}
(2).在本file里的其他地方:
请在有srv_bt_cm_stop_conn();后面加上下面一行code
srv_pbap_c->pbapc_cntx.cm_conn_id = 0xff;
3.\plutommi\Service\SppSrv\SppSrv.c
修改srv_spp_connect_ex()的实现如下:
void srv_spp_connect_ex(SppHandle handle,U32 UUID,srv_bt_cm_bt_addr* bt_addr, void* buf,U32 tx_size,U32
rx_size,srv_spp_connect_type conn_type)
{
*************************************
srv_spp_conn_cntx* conn;
srv_spp_conn_cntx* tempconn = inst->cntx.connect;
*************************************
if (tempconn->conn_id >0 ) {
srv_bt_cm_stop_conn(conn_id);
srv_spp_destroy_conn(inst, conn->port);
}
conn_id = srv_bt_cm_start_conn(MMI_FALSE, SRV_BT_CM_SPP_PROFILE_UUID, bt_addr, NULL);
*****************************************
}
修改完成后,下命令:
m r mmi_service
BT Dialer的蓝牙与SP连接成功,用户进行各种操作。
用户断开BT Dialer与SP的连接时,Dialer画面一直显示 "Disconnecting " 。
[SOLUTION]
需要修改如下3个file:
\plutoMMI\Service\DialerSrv\BTDialerSrv.c
\plutommi\Service\PbapSrv\pbapcSrv.c
\plutommi\Service\SppSrv\SppSrv.c
修改如下:
1. \plutommi\Service\DialerSrv\BTDialerSrv.c
修改srv_bt_dialer_disconnect_cnf_hdlr()的实现如下:
MMI_BOOL srv_bt_dialer_disconnect_cnf_hdlr(void *msg)
{
***************************************************
if(disconnect_rsp->result!=0)
{
SRV_BT_DIALER_LOG(SRV_BT_DIALER_DISCONNECT_FAIL);
kal_pROMpt_trace(MOD_MMI_CONN_APP, "[BTDialerSrv] cm_id:%d, hf_state:%d",SRV_BT_DIALER_GET_CM_CONN_ID,
g_bt_dialer_cntx->state);
if (SRV_BT_DIALER_GET_CM_CONN_ID != MMI_HF_INVALID_CONN_ID)
{
srv_bt_cm_stop_conn(SRV_BT_DIALER_GET_CM_CONN_ID);
SRV_BT_DIALER_SET_CM_CONN_ID(MMI_HF_INVALID_CONN_ID);
}
if(g_bt_dialer_cntx->cm_cb)
***********************************************************
}
2. \plutommi\Service\PbapSrv\pbapcSrv.c
(1).修改srv_pbapc_disconnect_req()的实现如下:
void srv_pbapc_disconnect_req(U32 conn_id)
{
***********************
SRV_PBAPC_STATE_TRANS(SRV_PBAPC_STATE_DISCONECTTING);
if (conn_id == 0xff)
{
if(srv_pbap_c->pbapc_cntx.bt_cm_callback)
srv_pbap_c->pbapc_cntx.bt_cm_callback(SRV_BT_CM_PBAPC_CONNECTION, MMI_FALSE, MMI_FALSE);
return;
}
srv_pbapc_send_msg(MSG_ID_BT_PBAPC_DISCONNECT_REQ,NULL);
}
(2).在本file里的其他地方:
请在有srv_bt_cm_stop_conn();后面加上下面一行code
srv_pbap_c->pbapc_cntx.cm_conn_id = 0xff;
3.\plutommi\Service\SppSrv\SppSrv.c
修改srv_spp_connect_ex()的实现如下:
void srv_spp_connect_ex(SppHandle handle,U32 UUID,srv_bt_cm_bt_addr* bt_addr, void* buf,U32 tx_size,U32
rx_size,srv_spp_connect_type conn_type)
{
*************************************
srv_spp_conn_cntx* conn;
srv_spp_conn_cntx* tempconn = inst->cntx.connect;
*************************************
if (tempconn->conn_id >0 ) {
srv_bt_cm_stop_conn(conn_id);
srv_spp_destroy_conn(inst, conn->port);
}
conn_id = srv_bt_cm_start_conn(MMI_FALSE, SRV_BT_CM_SPP_PROFILE_UUID, bt_addr, NULL);
*****************************************
}
修改完成后,下命令:
m r mmi_service