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

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

#endif /* INCusrCmdTblh */
