/****************************************************************************/
/* Copyright 1991 - 2003 MBARI												*/
/****************************************************************************/
/* Summary	: Static Table of user commands for OASIS3 Mooring Controller	*/
/* Filename : usrCmdTbl.h													*/
/* Author	: Robert Herlien (rah)											*/
/* Project	: OASIS3 Mooring												*/
/* $Revision: 1.1 $															*/
/* Created	: 02/03/2003 rah												*/
/*																			*/
/* MBARI provides this documentation and code "as is", with no warranty,	*/
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium	*/
/* Research Institute to assist in its use, correction, modification, or	*/
/* enhancement. This information should not be published or distributed to	*/
/* third parties without specific written permission from MBARI.			*/
/*																			*/
/****************************************************************************/
/* Modification History:													*/
/* 03feb2003 rah - created from OASIS usrcmds.h								*/
/****************************************************************************/

#ifndef INCusrCmdTblh
#define INCusrCmdTblh	1


/********************************/
/*		User Command Table		*/
/********************************/
										/************************************/
const FuncEntry functbl[] =				/* User Interface Function Table	*/
{										/*									*/
  {"ANALOG","Read analog channel",		/* Read analog channel				*/
   analog, DEC, NOPARM, NOPARM, NOPARM},
  {"CON","Connect to instrument",		/* Connect							*/
	connect, STRING, NOPARM, NOPARM, NOPARM},
  {"AUX","Do Driver Aux function",		/* Perform driver aux function		*/
	aux, STRING, DEC, DEC, NOPARM},		/* Drvr name, time, parm			*/
  {"INIT","Initialize Instrument",		/* Initialize instrument			*/
	init, STRING, DEC, DEC, NOPARM},	/* Drvr name, time, parm			*/
  {"SYNC","Sync Instrument",			/* Sync driver						*/
	sync, STRING, DEC, DEC, NOPARM},	/* Drvr name, time, parm			*/
  {"CMDADD",NULL,						/* Add a function to command list	*/
	cmdAdd, STRING, HEX, ALL, NOPARM},
  {"CAPTURE","Capture input to a file", /* Capture							*/
	usrCapture, STRING, STRING, HEX, NOPARM},
  {"COPY","Copy <srcfile> <dstfile>",	/* Copy file						*/
	usrCopy, STRING, STRING, NOPARM, NOPARM},
  {"DEL","Delete file (also ERA)",		/* Delete file						*/
	usrDelete, STRING, NOPARM, NOPARM, NOPARM},
  {"ERA",NULL,							/* Delete file						*/
	usrDelete, STRING, NOPARM, NOPARM, NOPARM},
  {"REN","Rename <oldName> <newName>",	/* Rename file				*/
	usrRename, STRING, STRING, NOPARM, NOPARM},
  {"D","Display Memory",				/* Display Memory					*/
	display, HEX, HEX, NOPARM, NOPARM},
  {"DIR","Get directory of flash drive",/* DIR								*/
	usrDir, STRING, NOPARM, NOPARM, NOPARM},
  {"DRVADD","Add a driver - DRVADD <Driver type> [Driver Name]",
	drvadd, STRING, STRING, NOPARM, NOPARM}, /* Add a driver to driver list	   */
  {"DRVDEL","Delete a driver",			/* Delete a driver from driver list */
	drvdel, STRING, NOPARM, NOPARM, NOPARM},
  {"DRVPARM","Set Driver parameters (also DP)",
	drvparms, STRING, NOPARM, NOPARM, NOPARM}, /* Set Driver parameters		*/
  {"DP",NULL,							/* Alternate to drvparm				*/
	drvparms, STRING, NOPARM, NOPARM, NOPARM},
  {"DUMP","Dump Log block(s)",			/* Dump log block(s)				*/
	dump, DEC, DEC, NOPARM, NOPARM},
  {"GETDATA", NULL,						/* Get all data since last getdata	*/
	getdata, DEC, NOPARM, NOPARM, NOPARM},	/* This is for automatic  usage*/
  {"GETYDATA", NULL,					/* Send all all data since last getydata  */
	getydata, DEC, NOPARM, NOPARM, NOPARM},	/* via YModem */
  {"GETLOG","Get Log Data",				/* Get specific log records			*/
	getlog, DEC, DEC, NOPARM, NOPARM},	/* This is for users				*/
  {"GETYLOG","Get Log Data",	/* Get specific log records			*/
	getylog, DEC, DEC, NOPARM, NOPARM},	/* This is for users				*/
  {"CHECKLOG","Log Block diagnostic",	/* Check Log block(s)				*/
	checkLog, DEC, DEC, NOPARM, NOPARM},
  {"H","Help (also ?)",					/* Print Help Message				*/
	help, NOPARM, NOPARM, NOPARM, NOPARM},
  {"HEXDUMP","Dump File in Hex - HexDump <file> <start> <len>",
   usrHexDump, STRING, HEX, HEX, NOPARM}, /* Hex file dump					*/
#if 0
  {"LOAD","Load Bytes",					/* Load Bytes						*/
	load, NOPARM, NOPARM, NOPARM, NOPARM},
#endif
  {"KILL","Kill a driver task",			/* Kill								*/
	usrKill, STRING, NOPARM, NOPARM, NOPARM},
  {"LOGS","Get logged records",			/* Get log record numbers			*/
	getlognmbrs, NOPARM, NOPARM, NOPARM, NOPARM},
  {"PARM","Show/set user parameters",	/* Get/Set User parameters			*/
	params, STRING, ALL, NOPARM, NOPARM},
  {"ARRAY","Show user arrays",	/* Get User parameters arrays		*/
	param_arrays, STRING, ALL, NOPARM, NOPARM},
  {"POWER","Get/Set power vector",		/* Get/Set power vector				*/
	usr_power, HEX, NOPARM, NOPARM, NOPARM},
  {"QUIT","Quit",						/* Quit								*/
	quit, NOPARM, NOPARM, NOPARM, NOPARM},
  {"Q",NULL,							/* Alternate Quit					*/
	quit, NOPARM, NOPARM, NOPARM, NOPARM},
  {"RESET","Reset System",				/* Reset System or Log memory		*/
	reset, STRING, DEC, NOPARM, NOPARM},
  {"S", "Set Memory",					/* Set Memory						*/
	set, HEX, DEC, NOPARM, NOPARM},
  {"TIME","Get or Set Time & Date",		/* Get/Set Time & Date				*/
	usr_time, ALL, NOPARM, NOPARM, NOPARM},
  {"DATE",NULL,							/* Alternate get/set time/date		*/
	usr_time, ALL, NOPARM, NOPARM, NOPARM},
  {"TYPE","Type file to screen",		/* Type file						*/
	usrType, STRING, NOPARM, NOPARM, NOPARM},
  {"MORE","Type file to screen w/breaks", /* More file						*/
	usrMore, STRING, NOPARM, NOPARM, NOPARM},
  {"START","Start a script",			/* Start a script					*/
	startScript, STRING, NOPARM, NOPARM, NOPARM},
  {"STOP","Stop a script",				/* Stop a script					*/
	stopScript, STRING, NOPARM, NOPARM, NOPARM},
  {"RESTART","Retart a script",			/* Restart a script					*/
	restartScript, STRING, NOPARM, NOPARM, NOPARM},
  {"VER","Echo version number",			/* Version number					*/
	version, STRING, NOPARM, NOPARM, NOPARM},
  {"SaveCfg", "Save config file",		/* Save OASIS.CFG					*/
	usrSaveCfg, NOPARM, NOPARM, NOPARM, NOPARM},
  {"DeleteLine", "DeleteLine <line> <file>", /* DeleteLine					*/
	deleteLine, DEC, STRING, NOPARM, NOPARM},
  {"DeleteChars", "DeleteChars <line> <file> [numChars]", /* DeleteChars	*/
	deleteChars, DEC, STRING, DEC, NOPARM},
  {"InsertLine", "InsertLine <line> <file>", /* InsertLine					*/
	insertLine, DEC, STRING, NOPARM, NOPARM},
  {"InsertChars", "InsertChars <line> <file>", /* InsertChar				*/
	insertChars, DEC, STRING, NOPARM, NOPARM},
  {"CHECKSTACK","Check task stacks",	/* Check stack						*/
	checkStack, NOPARM, NOPARM, NOPARM, NOPARM},
  {"FREEMEM","Display free memory",		/* Free memory						*/
	memCheck, DEC, NOPARM, NOPARM, NOPARM},
  {"STRING","Set string parameter (deprecated)", /* Set string parameter	*/
	params, STRING, ALL, NOPARM, NOPARM},
  {"SHOWVARS","Show System Variables",
	showVars, NOPARM, NOPARM, NOPARM, NOPARM},
  {"YS","Send Files via YModem",		/* YModem Send						*/
	ymdmSend, STRING, NOPARM, NOPARM, NOPARM},
  {"DIAG","Run Diagnostics",			/* Diagnostics						*/
	o3Diagnostic, NOPARM, NOPARM, NOPARM, NOPARM},
  {"TESTTASK","Create a Test Thread",	/* Test Thread						*/
	startTestThread, DEC, DEC, DEC, NOPARM},
  {"DELAY","Test task delay in O3 ticks", /* Delay test						*/
	testDelay, DEC, DEC, NOPARM, NOPARM},
  {"DELAY1","Test delay in secs/rtcTicks", /* Delay test					*/
	testDelay1, DEC, DEC, NOPARM, NOPARM},
  {"MODTEST","Run ModBus Test",			/* ModBus Test						*/
	modbusTest, DEC, DEC, DEC, NOPARM},
  {"MODSHOW","Show ModBus status",		/* Show ModBus status				*/
	showModBus, NOPARM, NOPARM, NOPARM, NOPARM},
  {"MODPOWER","Turn ModBus ON/OFF",		/* Turn on/off ModBus power			*/
	usrModPower, DEC, DEC, NOPARM, NOPARM},
  {"SCRIPTS", "Show status of scripts", /* Show script status		*/
	showScript, NOPARM, NOPARM, NOPARM, NOPARM},
  {"REMSHOW","Show Remote/Virtual port status", /* Show remote status		*/
	showRemote, NOPARM, NOPARM, NOPARM, NOPARM},
  {"REMCON","Connect to Remote Serial Port", /* Remote connect				*/
	remConnect, DEC, DEC, DEC, NOPARM},
  {"RemPower","Turn on/off remote power bit", /* Remote power				*/
	 usrRemPower, STRING, STRING, NOPARM, NOPARM},
  {"RemOutput","Turn on/off remote output bit", /* Remote output			*/
	 usrRemOutput, STRING, STRING, NOPARM, NOPARM},
  {"RemPulse","Pulse remote output bit",		/* Remote output pulse		*/
	 usrRemOutPulse, STRING, STRING, NOPARM, NOPARM},
  {"RemOff","Turn off ALL remote output and power bits",
	 remOff, NOPARM, NOPARM, NOPARM, NOPARM},
  {"AssignSerial","Assign remote serial port", /* Assign remote serial		*/
	 usrAssignSerial, DEC, DEC, DEC, DEC},
  {"AssignPower","Assign remote power port",   /* Assign remote power bit  */
	 usrAssignPower, DEC, DEC, DEC, DEC},
  {"AssignOutput","Assign remote output bit",  /* Assign remote output bit */
	 usrAssignOutput, DEC, DEC, DEC, DEC},
  {"sysLog", "Write to system log",
   usrSysLog, STRING, DEC, DEC, DEC},
  {"echo",NULL,
   usrEcho, STRING, STRING, STRING, STRING},
  {"echoAll",NULL,
   echoAll, STRING, ALL, STRING, STRING},
  {"testNum",NULL,
   testNum, STRING, NOPARM, NOPARM, NOPARM},
#ifdef DEBUG_KILL
  {"KILLTEST", NULL,					/* taskKill Test					*/
	taskKillTest, NOPARM, NOPARM, NOPARM, NOPARM},
#endif
#ifdef TNC
  {"TNC","Send command to remote radio", /* Send cmd strng to radio	 */
	tnc_cmd, ALL, NOPARM, NOPARM, NOPARM},
  {"***", NULL,							/* Message from radio				*/
	radiomsg, ALL, NOPARM, NOPARM, NOPARM},
#endif
#ifdef DEBUG_SERIAL_CMD
  {"SERIAL", "Dump serial channel variables",
   serDump, DEC, NOPARM, NOPARM, NOPARM},
#endif
#ifdef DEBUG_SYSTEM_CMD
  {"SYSTEM", "Dump internal system tables",
   showSystem, HEX, NOPARM, NOPARM, NOPARM},
#endif
#ifdef DEBUG_FREEZE_CMD
  {"FREEZE", "Freeze/unfreeze dispatcher",
   usr_freeze, HEX, NOPARM, NOPARM, NOPARM},
#endif
#ifdef DEBUG_SPI
  {"SPI", "Show SPI Errors",
   dumpSpiErrors, NOPARM, NOPARM, NOPARM, NOPARM},
#endif

  {"SAMPLE","sample a driver",
	sample, STRING, NOPARM, NOPARM, NOPARM},
  {"LSAMPLE","show last sample of a driver",
	lsample, STRING, NOPARM, NOPARM, NOPARM},
  {"?", NULL,							/* Print Help Message				*/
	help, NOPARM, NOPARM, NOPARM, NOPARM}
};										/************************************/

#endif /* INCusrCmdTblh */
