U8 ntyCellClose(void) { ClearProtocolEventHandler(MSG_ID_L4C_NBR_CELL_INFO_IND); ClearProtocolEventHandler(MSG_ID_L4C_NBR_CELL_INFO_REG_CNF); mmi_frm_send_ilm(MOD_L4C, MSG_ID_L4C_NBR_CELL_INFO_DEREG_REQ, NULL, NULL); flg_lbs_init = 0; return 0; }
int gcj_StopGprs() { ClearProtocolEventHandler(MSG_ID_MMI_NW_GPRS_CONNECTED_RSP); #ifdef __MMI_MULTI_SIM__ ClearSlaveProtocolEventHandler(MSG_ID_MMI_NW_GPRS_CONNECTED_RSP); #endif ClearProtocolEventHandler(MSG_ID_APP_SOC_GET_HOST_BY_NAME_IND); int ret = soc_StopGPRS(); return ret; }
void mmi_mexe_read_rpk_instance_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_smu_read_sim_rsp_struct *rpk_instance; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ rpk_instance = (mmi_smu_read_sim_rsp_struct*) info; ClearProtocolEventHandler(PRT_MMI_SMU_READ_SIM_RSP); memcpy(g_MExE_context.certificate_data + (g_MExE_context.certificate_file_read_cycle * 256), rpk_instance->data, rpk_instance->length); // need to read many cycles if (g_MExE_context.certificate_file_total_cycle == g_MExE_context.certificate_file_read_cycle) { mmi_mexe_send_sim_certificate_record_ind(); } else { g_MExE_context.certificate_file_read_cycle++; mmi_mexe_read_rpk_instance_req(); } }
/***************************************************************************** * FUNCTION * mmi_idle_get_spdi_info_rsp * DESCRIPTION * Response of read EF_SPDI info * PARAMETERS * info [IN] * RETURNS * void *****************************************************************************/ void mmi_idle_get_spdi_info_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_smu_read_file_info_rsp_struct *spdi_info; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ spdi_info = (mmi_smu_read_file_info_rsp_struct*) (info); memset(&g_spdi_info[0][0], 0, sizeof (g_spdi_info)); ClearProtocolEventHandler(PRT_MMI_SMU_READ_FILE_INFO_RSP); #ifdef __GEMINI__ if (spdi_info->result.flag == 0 && sim_service_table_query(SERVICE_SP_DSPL_INFO, SIM1) == SERVICE_SUPPORT) #else if (spdi_info->result.flag == 0 && sim_service_table_query(SERVICE_SP_DSPL_INFO) == SERVICE_SUPPORT) #endif { mmi_idle_get_spdi_data_req(spdi_info->file_size); } else { g_spdi_number = 0; mmi_eons_init(); } }
static void gcjDnsEvent(void * inMsg) { app_soc_get_host_by_name_ind_struct *dns_ind; gcj_dnsLen=0xff; gcj_TraceOut(0,"j2me: file %s,function %s,inMsg=%x",__FILE__,__FUNCTION__,inMsg); if( inMsg ) { dns_ind = (app_soc_get_host_by_name_ind_struct*) inMsg; if (dns_ind->result == KAL_TRUE) { ClearProtocolEventHandler(MSG_ID_APP_SOC_GET_HOST_BY_NAME_IND); memcpy(gcj_dnsBuff,dns_ind->addr,dns_ind->addr_len); gcj_dnsLen=dns_ind->addr_len; gcj_TraceOut(0,"j2me: file %s,function %s,,gcj_dnsLen=%d",__FILE__,__FUNCTION__,gcj_dnsLen); } } gcj_StubTakeMutex(&netMutex); _SOCKET_T *thisH = socketHead.next; while (thisH) { if (thisH->isWaitForGprs) { gcj_StubReleaseSemphone(thisH->thisReadSem); thisH->isWaitForGprs = 0; } thisH = thisH->next; } gcj_StubReleaseMutex(&netMutex); }
/***************************************************************************** * FUNCTION * srv_ctm_rsp_close * DESCRIPTION * * PARAMETERS * info [IN] info * RETURNS * void *****************************************************************************/ void srv_ctm_phdlr_close_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ MMI_TRACE(MMI_COMMON_TRC_G5_CALL, FUNC_SRV_PHDLR_CTM_CLOSE_RSP); ClearProtocolEventHandler(MSG_ID_MEDIA_CTM_CLOSE_CNF); /* open_req may be sent before the previous close_rsp is received, thus only clear the state when the current state is still closing */ if (srv_ctm_p->state == SRV_CTM_STATE_CLOSING) { srv_ctm_p->state = SRV_CTM_STATE_IDLE; /* clear all the operation when close is completed */ srv_ctm_p->rsp_cb = NULL; srv_ctm_p->curr_act = SRV_CTM_ACT_IDLE; srv_ctm_p->mode_opening = 0; } srv_ctm_p->mode_activated = 0; srv_ctm_send_ind(SRV_CTM_IND_CLOSE, NULL); }
void mmi_mexe_read_rpk_file_info_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_smu_read_file_info_rsp_struct *rpk_file_info; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ rpk_file_info = (mmi_smu_read_file_info_rsp_struct*) (info); ClearProtocolEventHandler(PRT_MMI_SMU_READ_FILE_INFO_RSP); if (rpk_file_info->result.flag == 0) { g_MExE_context.rpk_record_length = (U8) (rpk_file_info->file_size / rpk_file_info->num_of_rec); g_MExE_context.rpk_record_total = rpk_file_info->num_of_rec; g_MExE_context.rpk_record_read = 0; } else { /* error handler for allocated and activated file not found */ mmi_mexe_finish_rpk_file(MMI_FALSE); } mmi_mexe_retrieve_certificate_handler(); }
void ntyGetHostByNameIndCallback(void *inMsg) { NattyHttp *http = ntyHttpInstance(); app_soc_get_host_by_name_ind_struct *dns_ind; //sockaddr_struct server_ip_addr; nty_printf("card_gps_get_host_by_name_ind_plateform \r\n"); ClearProtocolEventHandler(MSG_ID_APP_SOC_GET_HOST_BY_NAME_IND); if (!inMsg) { return; } dns_ind = (app_soc_get_host_by_name_ind_struct*) inMsg; nty_printf("card_gps_get_host_by_name_ind_plateform: len=%d: addr=%d.%d.%d.%d \r\n", dns_ind->addr_len, dns_ind->addr[0], dns_ind->addr[1], dns_ind->addr[2], dns_ind->addr[3]); /* Check if the result is OK */ if (dns_ind->result == KAL_TRUE) { memset(&http->addr, 0x00, sizeof(sockaddr_struct)); memcpy(http->addr.addr, dns_ind->addr, dns_ind->addr_len); http->addr.addr_len = dns_ind->addr_len; nty_printf("card_gps_get_host_by_name_ind_plateform srv_socketid\r\n"); #ifdef stu_card http->addr.port=80; #else http->addr.port=80; #endif http->addr.sock_type=0; ntyMMISocketAddrCopy(&http->addr, &http->addr); ntyHttpConnect(http); //gps_connect(http->socketid, &http->addr); } else { //gprs_active= KAL_FALSE; //gps_closeSocket(srv_socketid); //StartTimer(ABREPEAT_BUILD_CACHE_DELAY_TIMER, 10*1000, card_conncet_to_platform); } //plateform_connecting=0; }
/***************************************************************************** * FUNCTION * mmi_ctm_connect_rsp_hdlr * DESCRIPTION * * PARAMETERS * info [IN] info * RETURNS * void *****************************************************************************/ void srv_ctm_phdlr_connect_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ MMI_BOOL result = MMI_TRUE; srv_ctm_rsp_struct rsp; srv_ctm_rsp_cb_func_ptr cb; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ClearProtocolEventHandler(MSG_ID_MEDIA_CTM_CONNECT_CNF); #ifndef __CTM_DEBUG result = (((media_ctm_connect_cnf_struct*)info)->result == MED_RES_OK) ? MMI_TRUE : MMI_FALSE; #endif /* __CTM_DEBUG */ MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_SRV_CTM_PHDLR_CONNECT_RSP, result, srv_ctm_p->state); if (srv_ctm_p->state == SRV_CTM_STATE_CONNECTING) { srv_ctm_p->state = result ? SRV_CTM_STATE_CONNECTED : SRV_CTM_STATE_OPENED; } cb = srv_ctm_p->rsp_cb; srv_ctm_p->rsp_cb = NULL; srv_ctm_p->curr_act = SRV_CTM_ACT_IDLE; /* send rsp to ctm app */ if(cb) { rsp.result = result; (*cb)(&rsp); } #ifdef __CTM_DEBUG StartTimer(CM_NOTIFYDURATION_TIMER, 2000, (FuncPtr) srv_ctm_phdlr_receive_text_ind); #endif }
/***************************************************************************** * FUNCTION * mmi_syncml_finish_sync_ind * DESCRIPTION * Protocol event handler * PARAMETERS * info [IN] message content * RETURNS * void *****************************************************************************/ void mmi_syncml_get_imei_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_nw_get_imei_rsp_struct *dataPtr = (mmi_nw_get_imei_rsp_struct*) info; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ClearProtocolEventHandler(MSG_ID_MMI_NW_GET_IMEI_RSP); if (dataPtr->result == 1) { mmi_syncml_start_sync_req(dataPtr->imei); } else { MMI_ASSERT(0); } }
void MTPNP_PFAL_boot_up(void * inMsg) { if (MTPNP_AD_Get_Card1Status() > 0x0 && MTPNP_AD_Get_Card2Status() > 0x0) { ClearProtocolEventHandler(MSG_ID_MTPNP_WAIT_DUALSIM_READY); FlightModeCheckBeforeAnimation(); } else { MYQUEUE Message; SetProtocolEventHandler(MTPNP_PFAL_boot_up, MSG_ID_MTPNP_WAIT_DUALSIM_READY); Message.oslSrcId = MOD_MMI; Message.oslDestId = MOD_MMI; Message.oslMsgId = MSG_ID_MTPNP_WAIT_DUALSIM_READY; Message.oslDataPtr = NULL; Message.oslPeerBuffPtr = NULL; OslMsgSendExtQueue(&Message); } }
/***************************************************************************** * FUNCTION * mmi_idle_get_spdi_data_rsp * DESCRIPTION * Response of read EF_SPDI data * PARAMETERS * info [IN] * RETURNS * void *****************************************************************************/ void mmi_idle_get_spdi_data_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_smu_read_sim_rsp_struct *spdi_data; U8 spdi_offset = 4; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ spdi_data = (mmi_smu_read_sim_rsp_struct*) info; ClearProtocolEventHandler(PRT_MMI_SMU_READ_SIM_RSP); if (spdi_data->result.flag == 0) { memcpy(&g_spdi_info[0][0], &spdi_data->data[spdi_offset], spdi_data->data[spdi_offset - 1]); } mmi_eons_init(); }
/***************************************************************************** * FUNCTION * srv_ctm_phdlr_open_rsp * DESCRIPTION * * PARAMETERS * info [IN] info * RETURNS * void *****************************************************************************/ void srv_ctm_phdlr_open_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ MMI_BOOL result = MMI_TRUE; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ClearProtocolEventHandler(MSG_ID_MEDIA_CTM_OPEN_CNF); if ((srv_ctm_p->state != SRV_CTM_STATE_OPENING) && (srv_ctm_p->state != SRV_CTM_STATE_IDLE)) { /* ignore if ctm is not opening */ /* the state may be idle if close rsp arrives before open rsp (switch tty status) */ MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_SRV_CTM_PHDLR_OPEN_RSP_IGNORE, srv_ctm_p->state); return; } if (((media_ctm_open_cnf_struct*)info)->result == MED_RES_OK) { /* open OK */ MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_SRV_CTM_PHDLR_OPEN_RSP_SUC); srv_ctm_p->state = SRV_CTM_STATE_OPENED; srv_ctm_p->mode_activated = srv_ctm_p->mode_opening; } else { MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_SRV_CTM_PHDLR_OPEN_RSP_FAIL); srv_ctm_p->state = SRV_CTM_STATE_IDLE; } }
void mmi_mexe_get_sim_certificate_rsp(void) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ MYQUEUE Message; mmi_get_sim_certificate_rsp_struct *sim_certificate_rsp; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ClearProtocolEventHandler(MSG_ID_MMI_SEND_SIM_CERTIFICATE_RECORD_RES); if (g_MExE_context.key_identifier != NULL) { OslMfree(g_MExE_context.key_identifier); g_MExE_context.key_identifier = NULL; } if (g_MExE_context.certificate_identifier != NULL) { OslMfree(g_MExE_context.certificate_identifier); g_MExE_context.certificate_identifier = NULL; } if (g_MExE_context.certificate_data != NULL) { OslMfree(g_MExE_context.certificate_data); g_MExE_context.certificate_data = NULL; } Message.oslSrcId = MOD_MMI; Message.oslDestId = g_MExE_context.sender_module; Message.oslMsgId = MSG_ID_MMI_GET_SIM_CERTIFICATE_RSP; sim_certificate_rsp = (mmi_get_sim_certificate_rsp_struct*) OslConstructDataPtr(sizeof(mmi_get_sim_certificate_rsp_struct)); sim_certificate_rsp->total = g_MExE_context.idx_certificate; Message.oslDataPtr = (oslParaType*) sim_certificate_rsp; Message.oslPeerBuffPtr = NULL; OslMsgSendExtQueue(&Message); }
void mmi_mexe_read_service_table_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_smu_read_sim_rsp_struct *MExE_data; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ MExE_data = (mmi_smu_read_sim_rsp_struct*) info; ClearProtocolEventHandler(PRT_MMI_SMU_READ_SIM_RSP); if (MExE_data->result.flag == 0) { if (MExE_data->data[0] & 0x03) /* 0000 0011 */ { g_MExE_context.ORPK_support = MMI_TRUE; } if (MExE_data->data[0] & 0x0C) /* 0000 1100 */ { g_MExE_context.ARPK_support = MMI_TRUE; } if (MExE_data->data[0] & 0x30) /* 0011 0000 */ { g_MExE_context.TPRPK_support = MMI_TRUE; } if (g_MExE_context.ORPK_support || g_MExE_context.ARPK_support || g_MExE_context.TPRPK_support) { g_MExE_context.MExE_valid = MMI_TRUE; } } }
/***************************************************************************** * FUNCTION * srv_ctm_phdlr_send_text_rsp * DESCRIPTION * * PARAMETERS * info [?] * RETURNS * void *****************************************************************************/ void srv_ctm_phdlr_send_text_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ MMI_BOOL result = MMI_TRUE; srv_ctm_rsp_struct rsp; srv_ctm_rsp_cb_func_ptr cb; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ClearProtocolEventHandler(MSG_ID_MEDIA_CTM_SEND_TEXT_CNF); #ifndef __CTM_DEBUG result = (((media_ctm_send_text_cnf_struct*)info)->result == MED_RES_OK) ? MMI_TRUE : MMI_FALSE; #endif /* __CTM_DEBUG */ MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_SRV_CTM_PHDLR_SEND_TEXT_RSP, result, srv_ctm_p->state); if (srv_ctm_p->state == SRV_CTM_STATE_SENDING) { srv_ctm_p->state = SRV_CTM_STATE_CONNECTED; } cb = srv_ctm_p->rsp_cb; srv_ctm_p->rsp_cb = NULL; srv_ctm_p->curr_act = SRV_CTM_ACT_IDLE; /* send rsp to ctm app */ if(cb) { rsp.result = result; (*cb)(&rsp); } }
void mmi_mexe_read_rpk_file_rsp(void *info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ mmi_smu_read_sim_rsp_struct *rpk_file; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ rpk_file = (mmi_smu_read_sim_rsp_struct*) info; ClearProtocolEventHandler(PRT_MMI_SMU_READ_SIM_RSP); if (rpk_file->result.flag == 0) { if ((++g_MExE_context.rpk_record_read) == g_MExE_context.rpk_record_total) { mmi_mexe_finish_rpk_file(MMI_TRUE); } if (rpk_file->data[0] == 0xFF) { /* certificate descriptor is invalid */ mmi_mexe_retrieve_certificate_handler(); return; } if (g_MExE_context.required_type != MExE_CERTIFICATE_ALL && g_MExE_context.required_type != rpk_file->data[2]) { /* certificate type is not desired */ mmi_mexe_retrieve_certificate_handler(); return; } /* prepare parameters to read instance */ memcpy(&g_MExE_context.certificate_file_id[0], &rpk_file->data[3], 2); g_MExE_context.certificate_file_length = rpk_file->data[7] * 256 + rpk_file->data[8]; g_MExE_context.certificate_file_read_cycle = 0; if ((g_MExE_context.certificate_file_length % 256) == 0 && (g_MExE_context.certificate_file_length / 256) > 0) { g_MExE_context.certificate_file_total_cycle = g_MExE_context.certificate_file_length / 256 - 1; } else { g_MExE_context.certificate_file_total_cycle = g_MExE_context.certificate_file_length / 256; } memset(g_MExE_context.key_identifier, 0, MAX_MExE_IDENTIFIER_LEN); memset(g_MExE_context.certificate_identifier, 0, MAX_MExE_IDENTIFIER_LEN); /* keep the root public key description file */ g_MExE_context.authority_certificate = rpk_file->data[1]; g_MExE_context.certificate_type = rpk_file->data[2]; g_MExE_context.key_identifier_length = rpk_file->data[9]; memcpy(g_MExE_context.key_identifier, rpk_file->data + 10, g_MExE_context.key_identifier_length); if (rpk_file->data[10 + g_MExE_context.key_identifier_length] != 0 && rpk_file->data[10 + g_MExE_context.key_identifier_length] != 0xFF) { g_MExE_context.certificate_identifier_length = rpk_file->data[10 + g_MExE_context.key_identifier_length]; memcpy(g_MExE_context.certificate_identifier, rpk_file->data + 11 + g_MExE_context.key_identifier_length, g_MExE_context.certificate_identifier_length); } else { g_MExE_context.certificate_identifier_length = 0; } mmi_mexe_read_rpk_instance_req(); } else { /* error handler for allocated and activated file not found */ mmi_mexe_finish_rpk_file(MMI_FALSE); } }
kal_int32 ntyHttpClose(int sockId) { soc_shutdown(sockId, SHUT_RDWR); soc_close(sockId); ClearProtocolEventHandler(MSG_ID_APP_SOC_GET_HOST_BY_NAME_IND); }