⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyshell.c

📁 linux gprs能信实验戏动源码,成功用车载系统,城市公交
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <fcntl.h>#include <unistd.h>#include <errno.h>#include <pthread.h>#include <time.h>#include "../keyboard/get_key.h"char shell_s[]="\nkeyshell> ";/*int argc, char *argv[*/#define CMD_TPYE			(0)#define PHONE_NUMBER		(1)#define MAX_CMD_DEPTH  	(2)extern char PHONE[];void * keyshell(){	char cmd[256]={0,};	int i;		kbd_init();		//键盘初始化			gprs_init();		//GPRS 初始化			printf("\n<gprs control shell>");	printf("\n [1]  give a call");			printf("\n [2]  respond a call");			printf("\n [3]  hold a call");			printf("\n [4]  send a msg");	printf("\n [**] help menu");//	printf("\n[1]give a call	[2]send a msg	[**]exit shell");		//	printf("\n[1]give a call	[2]send a msg	[**]exit shell");			while(1){		printf(shell_s);		fflush(stdout);		get_line(cmd);		printf("\r\n");				//显示必要的输出		if(strncmp("1",cmd,1)==0){						printf("\nyou select to gvie a call, please input number:");				fflush(stdout);			get_number(cmd);			gprs_call(cmd, strlen(cmd));			printf("\ncalling......");				} else if(strncmp("2",cmd,1)==0){						gprs_ans();			printf("\nanswering.......");			} else if(strncmp("3",cmd,1)==0){			gprs_hold();			printf("\nhold a call");		}else if (strncmp("4",cmd,1)==0){					printf("\nyou select to send a message, please input number:");				fflush(stdout);			get_number(cmd);			gprs_msg(cmd, strlen(cmd));			printf("\nsending......");			}else if (strncmp("**",cmd,2)==0){			printf("\n<gprs control shell>");			printf("\n [1]  give a call");			printf("\n [2]  respond a call");					printf("\n [3]  hold a call");					printf("\n [4]  send a msg");			printf("\n [**] help menu");		}else if(cmd[0] != 0){					system(cmd);		}	}		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -