term_m.c

来自「一个Linux下测试串口的源代码」· C语言 代码 · 共 76 行

C
76
字号
/*****************************************************************************//* TERM_M.C								     *//* This is the linux Communication Test Program for Advantech PCL card * * This file is part of pclterm * copyright (c)2000 ,ADVANTECH Co,Ltd * * pclterm is free software;you can redistribute it and/or modify it * under the terms of version 2 of GNU General Public License as * published by the Free Software Foundation.*//*****************************************************************************/#include	<signal.h>#include	"term.h"#define SENDPATTERN	0#define SENDFILE	1#define RECEIVEFILE     2/*****************************************************************************//* GLOBAL VARIABLES							     *//*****************************************************************************//*****************************************************************************//* STATIC FUNCTIONS							     *//*****************************************************************************//*****************************************************************************//* STATIC VARIABLES							     *//*****************************************************************************/static	struct	WItem	dModeMenuitem[] = {	{ F_Active, "Send Pattern " },	{ F_Active, "Send file    " },	{ F_Active, "Receive file    " }};static	struct	WSelect dModeMenu = {	-1, 6, "Advanced Transfer Modes", 3, 0, 0, 0, 3, dModeMenuitem,	{ "Enter:Select  Esc:Exit"}, 0};/*****************************************************************************//*	MAIN FUNCTIONS							     *//*****************************************************************************/void	mode_setup(){	int	key;	mw_selectinit(&dModeMenu);	do {	    switch((key = mw_select())) {	    case SENDPATTERN:		mw_selectend();		term_menu();		pattern_setup();		term_menu();		mw_selectinit(&dModeMenu);		break;	    case SENDFILE:		mw_selectend();		term_menu();		sfile_setup();		mw_selectinit(&dModeMenu);		break;	    case RECEIVEFILE:	        mw_selectend();		term_menu();		rfile_setup();		mw_selectinit(&dModeMenu);	        break;	    }	} while ( key != K_ESC );	mw_selectend();}

⌨️ 快捷键说明

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