static char PhoneHandleCall(char *msg) { u8 phonebuff[20]; u8 atcmd[50]; EFILE efile; struct phoneleixing *ph; ph=(struct phoneleixing *)msg; clear_lcd(); phonebuff[0]=EepromFile_Open(file_phonebook,&efile); memset(phonebuff,0,sizeof(phonebuff)); if(ph->leixin==0)EepromFile_Seek(&efile,10+ph->numPhone*98+12,EepromFile_SEEK_SET); else EepromFile_Seek(&efile,10+ph->numPhone*98+12+18,EepromFile_SEEK_SET); EepromFile_read(phonebuff,18,&efile); DrawTitle_to_row_Language2(2,"正在拨号...","Dialing..."); strcpy((char *)atcmd,"ATD"); strcat((char *)atcmd,(const char *)phonebuff); strcat((char *)atcmd,";\r"); send_at_cmd(atcmd); //text_out_to_row_x_Language2(1,25,phonebuff,phonebuff); phonebuff[0]=Waitkey_TillKeyPress(); send_at_cmd("ATH\r"); return phonebuff[0]; }
/************************************光标在手机处菜单**********************************************/ static char PhoneHandleCall(char *msg) { u8 phonebuff[20]; u8 atcmd[50]; EFILE efile; struct phoneleixing *ph; ph=(struct phoneleixing *)msg; clear_lcd(); /*fp=fopen("PhoneBook","rb"); if(fp!=NULL){ //如果有记录,则先把记录读到phonebuff 。 #ifdef DEBUG_PRINTF printf("open PhoneBook success!!\n"); #endif }else{ #ifdef DEBUG_PRINTF printf("open PhoneBook failure!!\n"); #endif return KEY_ReturnPrevious; }*/ phonebuff[0]=EepromFile_Open(file_phonebook,&efile); memset(phonebuff,0,sizeof(phonebuff)); /*if(ph->leixin==0)fseek(fp,10+ph->numPhone*98+12,SEEK_SET); else fseek(fp,10+ph->numPhone*98+12+18,SEEK_SET); fread(phonebuff,18,1,fp);*/ if(ph->leixin==0)EepromFile_Seek(&efile,10+ph->numPhone*98+12,EepromFile_SEEK_SET); else EepromFile_Seek(&efile,10+ph->numPhone*98+12+18,EepromFile_SEEK_SET); EepromFile_read(phonebuff,18,&efile); DrawTitle_to_row_Language2(2,"正在拨号...","Dialing..."); strcpy((char *)atcmd,"ATD"); strcat((char *)atcmd,(const char *)phonebuff); strcat((char *)atcmd,";\r"); send_at_cmd(atcmd); //text_out_to_row_x_Language2(1,25,phonebuff,phonebuff); phonebuff[0]=Waitkey_TillKeyPress(); send_at_cmd("ATH\r"); return phonebuff[0]; }