//----------------------------------------------------------------------------- int gps_soc_request_abort(void) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ if (gps_soc_transaction.socket_id >= 0) { ilm_struct *ilm_send = NULL; int ret; ret = soc_close(gps_soc_transaction.socket_id); gps_soc_log("soc_close result: %d", ret); kal_sleep_task(250); soc_close_nwk_account_by_id(MOD_GPS_TCPIP, gps_soc_transaction.nwt_acount_id); /* close socket and disconnect bearer here */ ilm_send = allocate_ilm(MOD_GPS_TCPIP); ilm_send->msg_id = MSG_ID_APP_SOC_DEACTIVATE_REQ; ilm_send->peer_buff_ptr = NULL; ilm_send->local_para_ptr = NULL; SEND_ILM(MOD_GPS_TCPIP, MOD_SOC, SOC_APP_SAP, ilm_send); } gps_soc_transaction.post_retry_counter = 0; gps_soc_stop_timer(); return 0; }
/***************************************************************************** * FUNCTION * mmi_mms_bgsr_get_msg_info_cb * DESCRIPTION * * PARAMETERS * filepath [IN] * RETURNS * file size *****************************************************************************/ void mmi_mms_bgsr_get_msg_info_cb(U32 msg_id, mmi_mms_bgsr_msg_info_struct *msg_info) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ struct ilm_struct *ilm_ptr = NULL; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ /* Write your code here */ ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_NAV_ACTIVATE_BGSR_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); return; }
static void msf_sas_send_dl_ind(MSF_UINT8 mod_src, MSF_UINT8 data_type, const char *url, const char *mime_type, const kal_uint8 *file_name) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ ilm_struct *ilm_ptr = NULL; mmi_da_dispatch_file_req_struct *p; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ p = (mmi_da_dispatch_file_req_struct*) construct_local_para(sizeof(mmi_da_dispatch_file_req_struct), TD_RESET); p->mime_type = 0; p->mime_subtype = 0; memset(p->url, 0, sizeof(p->url)); if (mod_src == MSF_MODID_PHS) { p->action = MMI_DA_PUSH; } else if (mod_src == MSF_MODID_SMA || mod_src == MSF_MODID_MEA) { p->action = MMI_DA_SAVE_AS; strcpy((char *)p->url, "mms://"); } else if (data_type == MsfResourceFile) { p->action = MMI_DA_SAVE_AS; } else { p->action = MMI_DA_WAP_DOWNLOAD; if (strlen(url) > 0) { strncpy((char *)p->url, url, strlen(url) > sizeof(p->url) ? sizeof(p->url) : strlen(url)); } else { strcpy((char *)p->url, "http://"); } } memset(p->filepath, 0, sizeof(p->filepath)); widget_ucs2_strcpy((kal_uint8*) p->filepath, (const kal_uint8*)file_name); strcpy((char *)p->mime_type_string, (const char*)mime_type); ilm_ptr = allocate_ilm(MOD_WAP); ilm_ptr->msg_id = (kal_uint16) MSG_ID_MMI_DA_DISPATCH_FILE_REQ; /* Set the message id */ ilm_ptr->peer_buff_ptr = NULL; /* there are no peer message */ ilm_ptr->local_para_ptr = (local_para_struct*) p; SEND_ILM(MOD_WAP, MOD_MMI, WAP_MMI_SAP, ilm_ptr); return; }
/***************************************************************************** * FUNCTION * uem_send_bmtmsg_to_uem * DESCRIPTION * * PARAMETERS * msg_name [IN] * RETURNS * void *****************************************************************************/ void uem_send_bmtmsg_to_uem(kal_uint32 msg_name, ...) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ kal_uint32 cause; va_list varpars; drvuem_pmic_ind_struct *pmic_ind_struct; bmt_adc_measure_done_conf_struct *bmd_adc_done; bmt_adc_measure_done_conf_struct *ilm_bmd_adc_done; ilm_struct *ilm_ptr = NULL; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ switch (msg_name) { case MSG_ID_BMT_ADC_MEASURE_DONE_CONF: { va_start(varpars, msg_name); bmd_adc_done = (bmt_adc_measure_done_conf_struct*) va_arg(varpars, kal_uint32); va_end(varpars); ilm_ptr = allocate_ilm(MOD_BMT); ilm_ptr->msg_id = (kal_uint16) MSG_ID_BMT_ADC_MEASURE_DONE_CONF; ilm_ptr->peer_buff_ptr = NULL; ilm_bmd_adc_done = bmt_adc_measure_done_conf_struct*) construct_local_para( sizeof(bmt_adc_measure_done_conf_struct), TD_CTRL); ilm_bmd_adc_done->adc_sche_id = bmd_adc_done->adc_sche_id; ilm_bmd_adc_done->adc_value = bmd_adc_done->adc_value; ilm_bmd_adc_done->volt = bmd_adc_done->volt; ilm_ptr->local_para_ptr = (local_para_struct*) ilm_bmd_adc_done; break; } case MSG_ID_DRVUEM_PMIC_IND: { va_start(varpars, msg_name); cause = (kal_uint32) va_arg(varpars, kal_uint32); va_end(varpars); ilm_ptr = allocate_ilm(MOD_BMT); ilm_ptr->msg_id = (kal_uint16) MSG_ID_DRVUEM_PMIC_IND; ilm_ptr->peer_buff_ptr = NULL; pmic_ind_struct = (drvuem_pmic_ind_struct*) construct_local_para(sizeof(drvuem_pmic_ind_struct), TD_CTRL); pmic_ind_struct->status = (BMT_CHR_STAT) cause; ilm_ptr->local_para_ptr = (local_para_struct*) pmic_ind_struct; break; } } SEND_ILM(MOD_BMT, MOD_UEM, DRIVER_PS_SAP, ilm_ptr); return; }
void das_send_file_dl_progress_ind(int session_id) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ ilm_struct *ilm_ptr = NULL; wap_mmi_file_dl_progress_ind_struct *p; das_job_t *job; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ job = das_find_job_by_session_id(session_id); p = (wap_mmi_file_dl_progress_ind_struct*) construct_local_para(sizeof(wap_mmi_file_dl_progress_ind_struct), TD_RESET); p->session_id = session_id; if(!job) { p->seq_num = 0; p->acc_size = 0; } else { if(job->status == DAS_STATUS_DOWNLOADING) { p->status = WAP_DL_STATUS_DOWNLOADING; p->cause = WAP_DL_ERROR_OK; } else if(job->status == DAS_STATUS_COMPLETE) { p->status = WAP_DL_STATUS_COMPLETE; p->cause = WAP_DL_ERROR_OK; } else { p->status = WAP_DL_STATUS_ABORTED; p->cause = job->cause; } p->seq_num = ++job->seq_num; p->acc_size = job->download_size; job->indication_sent = TRUE; job->status = DAS_STATUS_WAITING; } ilm_ptr = allocate_ilm(MOD_WAP); ilm_ptr->msg_id = (kal_uint16) MSG_ID_WAP_MMI_FILE_DL_PROGRESS_IND; /* Set the message id */ ilm_ptr->peer_buff_ptr = NULL; /* there are no peer message */ ilm_ptr->local_para_ptr = (local_para_struct*) p; SEND_ILM(MOD_WAP, MOD_MMI, WAP_MMI_SAP, ilm_ptr); return; }
/* * FUNCTION * l4a_sendmsg_ilm * DESCRIPTION * get an ilm structure and send to dest module. * * CALLS * l4a_send_msg_ft[] * PARAMETERS * src: source module * dest: destination module * msg: message id which is defined in mmi_sap.h * param: an ilm message structure pointer * RETURNS * none * GLOBALS AFFECTED * none */ void l4a_sendmsg_ilm(module_type src,module_type dest,msg_type msg,void *param) { ilm_struct *ilm_ptr = NULL; /* First allocate a memory for an interlayer message structure */ ilm_ptr = allocate_ilm( src ); ilm_ptr->msg_id = (kal_uint16) msg;/* Set the message id */ ilm_ptr->peer_buff_ptr = NULL;/* there are no peer message */ ilm_ptr->local_para_ptr = (local_para_struct *)param; SEND_ILM(src,dest,MMI_L4C_SAP,ilm_ptr); }
static void send_message(void *local_para_ptr, void *peer_buff_ptr, msg_type ilm_id, module_type dst_id) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ ilm_struct *ilm_ptr = NULL; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->local_para_ptr = (local_para_struct*) local_para_ptr; ilm_ptr->msg_id = ilm_id; ilm_ptr->peer_buff_ptr = (peer_buff_struct*) peer_buff_ptr; SEND_ILM(MOD_MMI, dst_id, MMI_GADGET_SAP, ilm_ptr); }
/***************************************************************************** * FUNCTION * drmt_mmi_send_ilm * DESCRIPTION * * PARAMETERS * local_para_ptr [?] [?] [?] * peer_buff_ptr [?] [?] [?] * ilm_id [IN] * dst_id(?) [IN](?) * RETURNS * void *****************************************************************************/ static void drmt_mmi_send_ilm(void *local_para_ptr, void *peer_buff_ptr, msg_type ilm_id) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ ilm_struct *ilm_ptr = NULL; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ ilm_ptr = allocate_ilm(MOD_DRMT); ilm_ptr->local_para_ptr = (local_para_struct*) local_para_ptr; ilm_ptr->msg_id = ilm_id; ilm_ptr->peer_buff_ptr = (peer_buff_struct*) peer_buff_ptr; SEND_ILM(MOD_DRMT, MOD_MMI, DRMT_MMI_SAP, ilm_ptr); }
/***************************************************************************** * FUNCTION * mmi_mms_cancel_download_rsp_callback * DESCRIPTION * * PARAMETERS * filepath [IN] * RETURNS * file size *****************************************************************************/ void mmi_mms_cancel_download_rsp_callback(U32 msg_id, U8 result) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ struct ilm_struct *ilm_ptr = NULL; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ /* Write your code here */ mmi_mms_bgsr_result = result; ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_CANCEL_DOWNLOAD_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); return; }
static void das_send_dl_stop_rsp(int session_id) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ ilm_struct *ilm_ptr = NULL; wap_mmi_file_dl_stop_rsp_struct *p; das_job_t *job; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ p = (wap_mmi_file_dl_stop_rsp_struct*) construct_local_para(sizeof(wap_mmi_file_dl_stop_rsp_struct), TD_RESET); p->session_id = session_id; p->status = WAP_DL_STATUS_CANCELLED; job = das_find_job_by_session_id(session_id); if(!job) { p->seq_num = 0; p->cause = WAP_DL_ERROR_INVALID_SESSION_ID; p->acc_size = 0; } else { p->seq_num = ++job->seq_num; p->cause = WAP_DL_ERROR_CANCELLED; p->acc_size = job->download_size; } ilm_ptr = allocate_ilm(MOD_WAP); ilm_ptr->msg_id = (kal_uint16) MSG_ID_WAP_MMI_FILE_DL_STOP_RSP; /* Set the message id */ ilm_ptr->peer_buff_ptr = NULL; /* there are no peer message */ ilm_ptr->local_para_ptr = (local_para_struct*) p; SEND_ILM(MOD_WAP, MOD_MMI, WAP_MMI_SAP, ilm_ptr); return; }
/***************************************************************************** * FUNCTION * mmi_mms_bgsr_get_msg_info_cb * DESCRIPTION * * PARAMETERS * filepath [IN] * RETURNS * file size *****************************************************************************/ void mmi_mms_bgsr_change_msg_cb(U32 msg_id, U8 result) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ /* Write your local var declare here */ struct ilm_struct *ilm_ptr = NULL; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ /* Write your code here */ MMI_ASSERT(msg_id == mmi_mms_bgsr_op_msg_id); mmi_mms_bgsr_result = result; switch(mmi_mms_bgsr_op) { case MMI_MMS_BGSR_OP_CANCEL_ALL_INBOX: { ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_CANCEL_ALL_INBOX_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); break; } case MMI_MMS_BGSR_OP_MOVE_TO_FOLDER: { ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_MOVE_TO_FOLDER_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); break; } case MMI_MMS_BGSR_OP_DELETE: { ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_DELETE_MSG_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); break; } case MMI_MMS_BGSR_OP_DELETE_ALL_INBOX: { ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_DELETE_ALL_INBOX_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); break; } case MMI_MMS_BGSR_OP_DELETE_ALL_OUTBOX: { ilm_ptr = allocate_ilm(MOD_MMI); ilm_ptr->msg_id = MSG_ID_MMS_BGSR_DELETE_ALL_OUTBOX_RSP; ilm_ptr->peer_buff_ptr = NULL; ilm_ptr->local_para_ptr = NULL; SEND_ILM(MOD_MMI, MOD_WAP, WAP_MMI_SAP, ilm_ptr); break; } } return; }
void das_send_file_dl_ind(das_job_t *job) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ int len; kal_uint16 length; ilm_struct *ilm_ptr = NULL; wap_mmi_file_dl_ind_struct *p; peer_buff_struct *peer_buff_ptr = NULL; wap_mmi_file_dl_var_struct var = {0}; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ p = (wap_mmi_file_dl_ind_struct*) construct_local_para(sizeof(wap_mmi_file_dl_ind_struct), TD_RESET); p->session_id = job->id; memset(p->url, 0, WAP_DL_MAX_URL_LEN); if(job->url) { len = strlen(job->url); strncpy((char *)p->url, job->url, len > WAP_DL_MAX_URL_LEN ? WAP_DL_MAX_URL_LEN : len); } memset(p->mime_type, 0, WAP_DL_MAX_MIME_TYPE_LEN); if(job->mime_type) { len = strlen(job->mime_type); strncpy((char *)p->mime_type, job->mime_type, len > WAP_DL_MAX_MIME_TYPE_LEN ? WAP_DL_MAX_MIME_TYPE_LEN : len); } memset(p->file_name, 0, WAP_DL_MAX_FILE_NAME_LEN); widget_utf8_to_ucs2_string(p->file_name, WAP_DL_MAX_FILE_NAME_LEN, (const kal_uint8 *)job->file_name); p->file_length = job->total_size; if (job->header) { var.header_len = strlen(job->header); var.header = (kal_uint8*) job->header; } else { var.header_len = 0; } if (job->buffer_tail > 0) { var.content_len = job->buffer_tail; var.content = (kal_uint8*) job->buffer; } else { var.content_len = 0; } len = wps_pun_var_part(WPS_PUN_SIZE, MSG_ID_WAP_MMI_FILE_DL_IND, (void*)&var, NULL); if (len > 0) { peer_buff_ptr = construct_peer_buff(len, 0, 0, TD_RESET); if (wps_pun_var_part (WPS_PUN_PACK, MSG_ID_WAP_MMI_FILE_DL_IND, (void*)&var, get_pdu_ptr(peer_buff_ptr, &length)) != len) { free_peer_buff(peer_buff_ptr); peer_buff_ptr = NULL; } } ilm_ptr = allocate_ilm(MOD_WAP); ilm_ptr->msg_id = (kal_uint16) MSG_ID_WAP_MMI_FILE_DL_IND; /* Set the message id */ ilm_ptr->peer_buff_ptr = peer_buff_ptr; ilm_ptr->local_para_ptr = (local_para_struct*) p; SEND_ILM(MOD_WAP, MOD_MMI, WAP_MMI_SAP, ilm_ptr); }
/***************************************************************************** * FUNCTION * das_send_dl_ind * DESCRIPTION * * PARAMETERS * mod_src [IN] * data_type [IN] * url [?] * mime_type [?] * file_name [?] * RETURNS * *****************************************************************************/ int das_send_dl_ind(MSF_UINT8 mod_src, MSF_UINT8 data_type, const char *url, const char *mime_type, const kal_uint8 *file_name, const char *header, MSF_INT32 network_account_id) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ ilm_struct *ilm_ptr = NULL; peer_buff_struct *peer_buff_ptr = NULL; mmi_da_dispatch_file_var_struct *peer_pdu = NULL; mmi_da_dispatch_file_req_struct *p; kal_uint16 length; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ p = (mmi_da_dispatch_file_req_struct*) construct_local_para(sizeof(mmi_da_dispatch_file_req_struct), TD_RESET); p->mime_type = 0; p->mime_subtype = 0; memset(p->url, 0, sizeof(p->url)); if (data_type == MsfResourceBuffer) { #ifndef __MMI_DUAL_SIM__ p->action = MMI_DA_PUSH; #else if(always_ask_get_sim_info_data_account((kal_uint32)network_account_id) == ALWAYS_ASK_SIM_INFO_SIM2) { p->action = MMI_DA_PUSH_SIM2; } else { p->action = MMI_DA_PUSH_SIM1; } #endif } else if (mod_src == MSF_MODID_SMA || mod_src == MSF_MODID_MEA) { p->action = MMI_DA_SAVE_AS; strcpy((char *)p->url, "mms://"); } else if (data_type == MsfResourceFile) { p->action = MMI_DA_SAVE_AS; } else { p->action = MMI_DA_WAP_DOWNLOAD; if (strlen(url) > 0) { strncpy((char *)p->url, url, strlen(url) > sizeof(p->url) ? sizeof(p->url) : strlen(url)); } else { strcpy((char *)p->url, "http://"); } } memset(p->filepath, 0, sizeof(p->filepath)); widget_ucs2_strcpy((kal_uint8*) p->filepath, (const kal_uint8*)file_name); strcpy((char *)p->mime_type_string, (const char*)mime_type); peer_buff_ptr = construct_peer_buff(sizeof(mmi_da_dispatch_file_var_struct) + strlen(header), 0, 0, TD_RESET); peer_pdu = (mmi_da_dispatch_file_var_struct *)get_pdu_ptr(peer_buff_ptr, &length); peer_pdu->header_len = strlen(header); memcpy(peer_pdu->header, header, peer_pdu->header_len); ilm_ptr = allocate_ilm(MOD_WAP); ilm_ptr->msg_id = (kal_uint16) MSG_ID_MMI_DA_DISPATCH_FILE_REQ; /* Set the message id */ ilm_ptr->peer_buff_ptr = peer_buff_ptr; /* there are no peer message */ ilm_ptr->local_para_ptr = (local_para_struct*) p; SEND_ILM(MOD_WAP, MOD_MMI, WAP_MMI_SAP, ilm_ptr); return 1; }