void * AP_UART_USB_RX (void* lpParameter) { char buf_cmd [BUF_SIZE] = {0}; int len; LOGD(TAG "Enter AP_UART_USB_RX()\n"); for (;;) { len = read_a_line(g_fd_uart, buf_cmd, BUF_SIZE); if (len>0) { buf_cmd[len] = '\0'; LOGD(TAG "AP_UART_USB_RX Command: %s, Len: %d\n" ,buf_cmd, len); AT_Pre_Process (buf_cmd); #ifdef MTK_DT_SUPPORT if(g_mdFlag==1) send_at (g_fd_atcmd, buf_cmd); if(g_mdFlag==2) send_at (g_fd_atcmdmd2, buf_cmd); #else send_at (g_fd_atcmd, buf_cmd); #endif } } //pthread_exit (NULL); }
void * AP_UART_USB_RX (void* lpParameter) { char buf_cmd [BUF_SIZE] = {0}; int len; int wr_len; char result[64] = {0}; LOGD(TAG "Enter AP_UART_USB_RX()\n"); cmd_handler_init (); for (;;) { len = read_a_line(g_fd_uart, buf_cmd, BUF_SIZE); if (len>0) { buf_cmd[len] = '\0'; LOGD(TAG "AP_UART_USB_RX Command: %s, Len: %d\n" ,buf_cmd, len); AT_Pre_Process (buf_cmd); LOGD("buf_cmd:%s\n", buf_cmd); #if 0 #ifdef MTK_DT_SUPPORT if(g_mdFlag==1) send_at (g_fd_atcmd, buf_cmd); if(g_mdFlag==2) send_at (g_fd_atcmdmd2, buf_cmd); #else send_at (g_fd_atcmd, buf_cmd); #endif #endif CMD_OWENR_ENUM owner = rmmi_cmd_processor(buf_cmd, result); LOGD(TAG "result:%s\n", result); if(owner == CMD_OWENR_AP) { wr_len = write_chars (g_fd_uart, result, strlen(result)); if (wr_len != strlen(result)) LOGE(TAG "AP_CCCI_RX: wr_len != rd_len\n"); } else { if(g_mdFlag == 1) { #if defined(MTK_EXTERNAL_MODEM_SLOT) if(!strcmp(MTK_EXTERNAL_MODEM_SLOT, "1")) { #ifndef EVDO_DT_SUPPORT send_at(g_fd_atcmdmd_dt, buf_cmd); #endif } else{ if(is_support_modem(1)){ send_at(g_fd_atcmd, buf_cmd); }else if(is_support_modem(2)){ send_at(g_fd_atcmdmd2, buf_cmd); } } #else if(is_support_modem(1)){ send_at(g_fd_atcmd, buf_cmd); }else if(is_support_modem(2)){ send_at(g_fd_atcmdmd2, buf_cmd); } #endif } else if(g_mdFlag == 2) { #if defined(MTK_EXTERNAL_MODEM_SLOT) if(!strcmp(MTK_EXTERNAL_MODEM_SLOT, "2")) { #ifndef EVDO_DT_SUPPORT send_at(g_fd_atcmdmd_dt, buf_cmd); #endif }else{ if(is_support_modem(1)){ send_at(g_fd_atcmd, buf_cmd); }else if(is_support_modem(2)){ send_at(g_fd_atcmdmd2, buf_cmd); } } #else if(is_support_modem(1)){ send_at(g_fd_atcmd, buf_cmd); }else if(is_support_modem(2)){ send_at(g_fd_atcmdmd2, buf_cmd); } #endif } } } } //pthread_exit (NULL); }