📄 mfw_bta.c
字号:
case BTP_DISCONNECT_DEVICE_CNF:
/* BTI confirms disconnection for profile hsg */
MALLOC(disconnect_cnf, sizeof(T_MFW_BT_DISCONNECT_CNF));
memset(disconnect_cnf, 0, sizeof(T_MFW_BT_DISCONNECT_CNF));
disconnect_cnf->service = ((T_BTP_DISCONNECT_DEVICE_CNF *)data)->device;
disconnect_cnf->cnf_id = ((T_BTP_DISCONNECT_DEVICE_CNF *)data)->cnf_id;
memcpy(disconnect_cnf->bd_addr, ((T_BTP_DISCONNECT_DEVICE_CNF *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
bt_signal(BT_DISCONNECT_DEVICE_CNF, disconnect_cnf);
#ifdef _SIMULATION_
TRACE_EVENT_P3("disconn cnf = %d, %d, %s", disconnect_cnf->service, disconnect_cnf->cnf_id, disconnect_cnf->bd_addr);
#endif
MFREE(disconnect_cnf);
return TRUE;
case BTP_DISCON_DUN_FAX_CNF:
/* BTI confirms disconnection for profile dun/fax */
MALLOC(discon_dun_fax_cnf, sizeof(T_MFW_BT_DISCON_DUN_FAX_CNF));
memset(discon_dun_fax_cnf, 0, sizeof(T_MFW_BT_DISCON_DUN_FAX_CNF));
discon_dun_fax_cnf->service = ((T_BTP_DISCON_DUN_FAX_CNF *)data)->device;
discon_dun_fax_cnf->result_bd = ((T_BTP_DISCON_DUN_FAX_CNF *)data)->cause;
bt_signal(BT_DISCON_DUN_FAX_CNF, discon_dun_fax_cnf);
#ifdef _SIMULATION_
TRACE_EVENT_P2("disconn cnf = %d, %d", discon_dun_fax_cnf->service, discon_dun_fax_cnf->result_bd);
#endif
MFREE(discon_dun_fax_cnf);
return TRUE;
case BTP_DISCONNECT_DEVICE_IND:
/* BTI indicats disconnection from headset*/
MALLOC(disconnect_ind, sizeof(T_MFW_BT_DISCONNECT_IND));
memset(disconnect_ind, 0, sizeof(T_MFW_BT_DISCONNECT_IND));
disconnect_ind->service = ((T_BTP_DISCONNECT_DEVICE_IND *)data)->device;
disconnect_ind->ind_id = ((T_BTP_DISCONNECT_DEVICE_IND *)data)->ind_id;
memcpy(disconnect_ind->bd_addr, ((T_BTP_DISCONNECT_DEVICE_IND *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
bt_signal(BT_DISCONNECT_DEVICE_IND, disconnect_ind);
#ifdef _SIMULATION_
TRACE_EVENT_P3("disconn ind hsg = %d, %d, %s", disconnect_ind->service, disconnect_ind->ind_id, disconnect_ind->bd_addr);
#endif
MFREE(disconnect_ind);
return TRUE;
case BTP_DISCON_DUN_FAX_IND:
/* BTI indicates disconnection from remote dun/fax */
MALLOC(disc_dun_fax_ind, sizeof(T_MFW_BT_DISCON_DUN_FAX_IND));
memset(disc_dun_fax_ind, 0, sizeof(T_MFW_BT_DISCON_DUN_FAX_IND));
disc_dun_fax_ind->service = ((T_BTP_DISCON_DUN_FAX_IND *)data)->device;
bt_signal(BT_DISCON_DUN_FAX_IND, disc_dun_fax_ind);
#ifdef _SIMULATION_
TRACE_EVENT_P1("disconn ind dun = %d", disc_dun_fax_ind->service);
#endif
MFREE(disc_dun_fax_ind);
return TRUE;
case BTP_DEVICE_PAIRED_IND:
/* BTI indicates that a pin code is needed */
MALLOC(pair_indication, sizeof(T_MFW_BT_DEV_PAIR_IND));
memset(pair_indication, 0, sizeof(T_MFW_BT_DEV_PAIR_IND));
memcpy(pair_indication->rem_bd_addr, ((T_BTP_DEVICE_PAIRED_IND *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
memcpy(pair_indication->rem_bd_name, ((T_BTP_DEVICE_PAIRED_IND *)data)->bd_name, MFW_BT_NAME_MAX_LEN);
pair_indication->pair_res = ((T_BTP_DEVICE_PAIRED_IND *)data)->pair_result;
bt_signal(BT_DEVICE_PAIRED_IND, pair_indication);
#ifdef _SIMULATION_
TRACE_EVENT_P2("pair ind = %d %s", pair_indication->pair_res, pair_indication->rem_bd_name);
#endif
MFREE(pair_indication);
return TRUE;
case BTP_TRUSTED_DEV_LIST_FULL:
/* BTI indicates that list of trusted devices is full */
bt_signal(BT_TRUSTED_DEV_LIST_FULL, NULL);
#ifdef _SIMULATION_
TRACE_EVENT("TRUSTED_DEV_LIST_FULL");
#endif
return TRUE;
case BTP_CALL_MONITORING_STATUS:
/* BTI indicates call monitoring messages by dun/fax */
MALLOC(dun_call_state, sizeof(T_MFW_BT_CALL_STATUS_DUN_FAX));
memset(dun_call_state, 0, sizeof(T_MFW_BT_CALL_STATUS_DUN_FAX));
dun_call_state->service = ((T_BTP_CALL_MONITORING_STATUS *)data)->device;
switch(((T_BTP_CALL_MONITORING_STATUS *)data)->call_status)
{
case BTI_DUN_CALL_IN_PRO:
dun_call_state->call_state = MFW_BT_CALL_IN_PROGRESS;
break;
case BTI_DUN_CALL_ESTABLISHED:
dun_call_state->call_state = MFW_BT_CALL_ESTABLISHED;
break;
case BTI_DUN_CALL_PAUSED:
dun_call_state->call_state = MFW_BT_CALL_PAUSED;
break;
case BTI_DUN_CALL_RESUMED:
dun_call_state->call_state = MFW_BT_CALL_RESUMED;
break;
case BTI_DUN_CALL_HANGUP_IN_PR:
dun_call_state->call_state = MFW_BT_HANGUP_IN_PROGRESS;
break;
case BTI_DUN_CALL_RELEASED:
dun_call_state->call_state = MFW_BT_CALL_RELEASED;
break;
case BTI_FAX_CALL_IN_PRO:
dun_call_state->call_state = MFW_BT_CALL_IN_PROGRESS;
break;
case BTI_FAX_CALL_ESTABLISHED:
dun_call_state->call_state = MFW_BT_CALL_ESTABLISHED;
break;
case BTI_FAX_CALL_HANGUP_IN_PR:
dun_call_state->call_state = MFW_BT_HANGUP_IN_PROGRESS;
break;
case BTI_FAX_CALL_RELEASED:
dun_call_state->call_state = MFW_BT_CALL_RELEASED;
break;
default:
break;
}
bt_signal(BT_CALL_MONITORING_STATUS, dun_call_state);
#ifdef _SIMULATION_
TRACE_EVENT_P2("dun call monit = %d %d", dun_call_state->service, dun_call_state->call_state);
#endif
MFREE(dun_call_state);
return TRUE;
case BTP_OPP_SERV_PUT_IND:
/* BTI indicates that a put response is needed (OPP server) */
MALLOC(opp_put_ind, sizeof(T_MFW_BT_OPP_PUT_IND));
memset(opp_put_ind, 0, sizeof(T_MFW_BT_OPP_PUT_IND));
opp_put_ind->service = ((T_BTP_OPP_SERV_PUT_IND *)data)->device;
opp_put_ind->subtype = ((T_BTP_OPP_SERV_PUT_IND *)data)->subtype;
memcpy(opp_put_ind->bd_addr, ((T_BTP_OPP_SERV_PUT_IND *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
memset(&receiv_object_name, 0, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);/* limited with 256 characters */
memcpy(&receiv_object_name, &((T_BTP_OPP_SERV_PUT_IND *)data)->object_name, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);
/* from string in Primitive to static buffer in MFW, pointer to MMI */
opp_put_ind->mfw_opp_object.mfw_object_name = receiv_object_name;
opp_put_ind->mfw_opp_object.mfw_object_length = ((T_BTP_OPP_SERV_PUT_IND *)data)->object_length;
bt_signal(BT_OPP_SERV_PUT_IND, opp_put_ind);
#ifdef _SIMULATION_
TRACE_EVENT_P3("opp put ind = %d, %d, %s", opp_put_ind->service, opp_put_ind->subtype, receiv_object_name);
#endif
MFREE(opp_put_ind);
return TRUE;
case BTP_OPP_SERV_PUT_CNF:
/* BTI indicates that an object push procedure is finished or cancelled */
MALLOC(opp_put_cnf, sizeof(T_MFW_BT_OPP_PUT_CNF));
memset(opp_put_cnf, 0, sizeof(T_MFW_BT_OPP_PUT_CNF));
opp_put_cnf->service = ((T_BTP_OPP_SERV_PUT_CNF *)data)->device;
opp_put_cnf->subtype = ((T_BTP_OPP_SERV_PUT_CNF *)data)->subtype;
memcpy(opp_put_cnf->bd_addr, ((T_BTP_OPP_SERV_PUT_CNF *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
opp_put_cnf->mfw_opp_object.mfw_object_type = ((T_BTP_OPP_SERV_PUT_CNF *)data)->object_type;
memset(&receiv_object_name, 0, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);/* limited with 256 characters */
memcpy(&receiv_object_name, &((T_BTP_OPP_SERV_PUT_CNF *)data)->object_name, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);
opp_put_cnf->mfw_opp_object.mfw_object_name = receiv_object_name;/* from string in Primitive to static buffer in MFW (pointer is not possible in Primitive), pointer of buffer */
opp_put_cnf->mfw_opp_object.mfw_object_length = ((T_BTP_OPP_SERV_PUT_CNF *)data)->object_length;
opp_put_cnf->error_cause = ((T_BTP_OPP_SERV_PUT_CNF *)data)->cause;
bt_signal(BT_OPP_SERV_PUT_CNF, opp_put_cnf);
#ifdef _SIMULATION_
TRACE_EVENT_P3("opp put cnf = %d, %d, %s", opp_put_cnf->service, opp_put_cnf->subtype, receiv_object_name);
#endif
MFREE(opp_put_cnf);
return TRUE;
case BTP_OPP_OBJECT_PUSH_CNF:
/* BTI indicates that an object push procedure is finished or cancelled */
MALLOC(opp_obj_push_cnf, sizeof(T_MFW_BT_OPP_PUSH_CNF));
memset(opp_obj_push_cnf, 0, sizeof(T_MFW_BT_OPP_PUSH_CNF));
opp_obj_push_cnf->service = ((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->device;
opp_obj_push_cnf->subtype = ((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->subtype;
memcpy(opp_obj_push_cnf->bd_addr, ((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
opp_obj_push_cnf->mfw_opp_object.mfw_object_type = ((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->object_type;
memset(&receiv_object_name, 0, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);/* limited with 256 characters */
memcpy(&receiv_object_name, &((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->object_name, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);
opp_obj_push_cnf->mfw_opp_object.mfw_object_name = receiv_object_name;/* from string in Primitive to static buffer in MFW (pointer is not possible in Primitive), pointer of buffer */
memset(&receiv_object_mime_type, 0, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);/* limited with 256 characters */
memcpy(&receiv_object_mime_type, &((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->object_m_t, MFW_BT_OPP_OBJECT_MIME_MAX_LEN);
opp_obj_push_cnf->mfw_opp_object.mfw_object_mime_type = receiv_object_mime_type;/* same comment like for ...object_name */
opp_obj_push_cnf->mfw_opp_object.mfw_object_length = ((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->object_length;
opp_obj_push_cnf->error_cause = ((T_BTP_OPP_OBJECT_PUSH_CNF *)data)->cause;
bt_signal(BT_OPP_OBJECT_PUSH_CNF, opp_obj_push_cnf);
#ifdef _SIMULATION_
TRACE_EVENT_P3("opp push cnf = %d, %d, %s", opp_obj_push_cnf->service, opp_obj_push_cnf->subtype, receiv_object_name);
#endif
MFREE(opp_obj_push_cnf);
return TRUE;
case BTP_OPP_OBJECT_PULL_CNF:
/* BTI indicates that an object push procedure is finished or cancelled */
MALLOC(opp_obj_pull_cnf, sizeof(T_MFW_BT_OPP_PULL_CNF));
memset(opp_obj_pull_cnf, 0, sizeof(T_MFW_BT_OPP_PULL_CNF));
opp_obj_pull_cnf->service = ((T_BTP_OPP_OBJECT_PULL_CNF *)data)->device;
opp_obj_pull_cnf->subtype = ((T_BTP_OPP_OBJECT_PULL_CNF *)data)->subtype;
memcpy(opp_obj_pull_cnf->bd_addr, ((T_BTP_OPP_OBJECT_PULL_CNF *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
opp_obj_pull_cnf->mfw_opp_object.mfw_object_type = ((T_BTP_OPP_OBJECT_PULL_CNF *)data)->object_type;
memset(&receiv_object_name, 0, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);/* limited with 256 characters */
memcpy(&receiv_object_name, &((T_BTP_OPP_OBJECT_PULL_CNF *)data)->object_name, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);
opp_obj_pull_cnf->mfw_opp_object.mfw_object_name = receiv_object_name;/* from string in Primitive to static buffer in MFW (pointer is not possible in Primitive), pointer of buffer */
memset(&receiv_object_mime_type, 0, MFW_BT_OPP_OBJECT_NAME_MAX_LEN);/* limited with 256 characters */
memcpy(&receiv_object_mime_type, &((T_BTP_OPP_OBJECT_PULL_CNF *)data)->object_m_t, MFW_BT_OPP_OBJECT_MIME_MAX_LEN);
opp_obj_pull_cnf->mfw_opp_object.mfw_object_mime_type = receiv_object_mime_type;/* same comment like for ...object_name */
opp_obj_pull_cnf->mfw_opp_object.mfw_object_length = ((T_BTP_OPP_OBJECT_PULL_CNF *)data)->object_length;
opp_obj_pull_cnf->error_cause = ((T_BTP_OPP_OBJECT_PULL_CNF *)data)->cause;
bt_signal(BT_OPP_OBJECT_PULL_CNF, opp_obj_pull_cnf);
#ifdef _SIMULATION_
TRACE_EVENT_P3("opp pull cnf = %d, %d, %s", opp_obj_pull_cnf->service, opp_obj_pull_cnf->subtype, receiv_object_name);
#endif
MFREE(opp_obj_pull_cnf);
return TRUE;
case BTP_SRV_SYNC_CNF:
/* BTI indicates that synchronization operation completes (initiated by client or server) */
MALLOC(srv_sync_cnf, sizeof(T_MFW_BT_SRV_SYNC_CNF));
memset(srv_sync_cnf, 0, sizeof(T_MFW_BT_SRV_SYNC_CNF));
srv_sync_cnf->service = ((T_BTP_SRV_SYNC_CNF *)data)->device;
srv_sync_cnf->subtype = ((T_BTP_SRV_SYNC_CNF *)data)->subtype;
memcpy(srv_sync_cnf->mfw_client_bd_addr, ((T_BTP_SRV_SYNC_CNF *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
memcpy(srv_sync_cnf->mfw_client_name, ((T_BTP_SRV_SYNC_CNF *)data)->bd_name, MFW_BT_NAME_MAX_LEN);
srv_sync_cnf->mfw_error_state = ((T_BTP_SRV_SYNC_CNF *)data)->cause;
bt_signal(BT_SRV_SYNC_CNF, srv_sync_cnf);
MFREE(srv_sync_cnf);
return TRUE;
case BTP_SRV_SYNC_AUTH_IND:
/* BTI indicates that synchronization operation completes (initiated by client or server) */
MALLOC(srv_sync_auth, sizeof(T_MFW_BT_SRV_SYNC_AUTH_IND));
memset(srv_sync_auth, 0, sizeof(T_MFW_BT_SRV_SYNC_AUTH_IND));
srv_sync_auth->service = ((T_BTP_SRV_SYNC_AUTH_IND *)data)->device;
srv_sync_auth->subtype = ((T_BTP_SRV_SYNC_AUTH_IND *)data)->subtype;
memcpy(srv_sync_auth->mfw_client_bd_addr, ((T_BTP_SRV_SYNC_AUTH_IND *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
memcpy(srv_sync_auth->mfw_client_name, ((T_BTP_SRV_SYNC_AUTH_IND *)data)->bd_name, MFW_BT_NAME_MAX_LEN);
bt_signal(BT_SRV_SYNC_AUTH_IND, srv_sync_auth);
#ifdef _SIMULATION_
TRACE_EVENT_P3("sync auth ind = %d, %d, %s", srv_sync_auth->service, srv_sync_auth->subtype, srv_sync_auth->mfw_client_bd_addr);
#endif
MFREE(srv_sync_auth);
return TRUE;
case BTP_SRV_SYNC_PULL_IND:
/* BTI indicates that the client requests to pull an object from the sync server */
MALLOC(srv_sync_pull_ind, sizeof(T_MFW_BT_SRV_SYNC_PULL_IND));
memset(srv_sync_pull_ind, 0, sizeof(T_MFW_BT_SRV_SYNC_PULL_IND));
srv_sync_pull_ind->service = ((T_BTP_SRV_SYNC_PULL_IND *)data)->device;
srv_sync_pull_ind->subtype = ((T_BTP_SRV_SYNC_PULL_IND *)data)->subtype;
memcpy(srv_sync_pull_ind->mfw_client_bd_addr, ((T_BTP_SRV_SYNC_PULL_IND *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
srv_sync_pull_ind->mfw_object_id.mfw_object_size = ((T_BTP_SRV_SYNC_PULL_IND *)data)->object_id_size;
memset(&sync_object_location_id, 0, MFW_BT_SYNC_OBJECT_IDENTIFIER);/* limited with 256 characters */
memcpy(&sync_object_location_id, &((T_BTP_SRV_SYNC_PULL_IND *)data)->object_id_loc, MFW_BT_SYNC_OBJECT_IDENTIFIER);
srv_sync_pull_ind->mfw_object_id.mfw_location = sync_object_location_id;/* from string in Primitive to static buffer in MFW (pointer is not possible in Primitive), pointer of buffer */
bt_signal(BT_SRV_SYNC_PULL_IND, srv_sync_pull_ind);
#ifdef _SIMULATION_
TRACE_EVENT_P3("sync pull ind = %d, %d, %d", srv_sync_pull_ind->service, srv_sync_pull_ind->subtype, srv_sync_pull_ind->mfw_object_id.mfw_object_size);
#endif
MFREE(srv_sync_pull_ind);
return TRUE;
case BTP_SRV_SYNC_PUSH_IND:
/* BTI indicates that the client requests to pull an object from the sync server */
MALLOC(srv_sync_push_ind, sizeof(T_MFW_BT_SRV_SYNC_PUSH_IND));
memset(srv_sync_push_ind, 0, sizeof(T_MFW_BT_SRV_SYNC_PUSH_IND));
srv_sync_push_ind->service = ((T_BTP_SRV_SYNC_PUSH_IND *)data)->device;
srv_sync_push_ind->subtype = ((T_BTP_SRV_SYNC_PUSH_IND *)data)->subtype;
memcpy(srv_sync_push_ind->mfw_client_bd_addr, ((T_BTP_SRV_SYNC_PUSH_IND *)data)->bd_addr, MFW_BT_ADDR_MAX_LEN);
srv_sync_push_ind->mfw_object_id.mfw_object_size = ((T_BTP_SRV_SYNC_PUSH_IND *)data)->object_id_size;
memset(&sync_object_location_id, 0, MFW_BT_SYNC_OBJECT_IDENTIFIER);/* limited with 256 characters */
memcpy(&sync_object_location_id, &((T_BTP_SRV_SYNC_PUSH_IND *)data)->object_id_loc, MFW_BT_SYNC_OBJECT_IDENTIFIER);
srv_sync_push_ind->mfw_object_id.mfw_location = sync_object_location_id;/* from string in Primitive to static buffer in MFW (pointer is not possible in Primitive), pointer of buffer */
bt_signal(BT_SRV_SYNC_PUSH_IND, srv_sync_push_ind);
#ifdef _SIMULATION_
TRACE_EVENT_P3("sync push ind = %d, %d, %d", srv_sync_push_ind->service, srv_sync_push_ind->subtype, srv_sync_push_ind->mfw_object_id.mfw_object_size);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -