
/// Copyright 2010 MBARI.                                                    
/// MBARI Proprietary Information. All rights reserved.                      

/// \file actions.h
/// \brief Most functions called from command line.
/// All take a string argument and return an return_code_t

#ifndef ACTIONS_H
#define ACTIONS_H
#include "cwgsys.h"
#include "script.h"

/// sub list commands 
return_code_t actGetCmd(char* arg);   /// <parse arg as Get cmd
return_code_t actSetCmd(char* arg);   /// <parse arg as Set cmd
return_code_t actClrCmd(char* arg);   /// <parse arg as Clr cmd
return_code_t actPulseCmd(char* arg);   /// <parse arg as Clr cmd
return_code_t actScriptCmd(char* arg);   /// <parse arg as Clr cmd
//return_code_t actFlCmd(char* arg);    /// <parse arg as Fl cmd
return_code_t actLiCmd(char* arg);    /// <parse arg as Li cmd
//return_code_t actOrbCmd(char* arg);   /// <parse arg as Orb cmd
/// Root commands 
return_code_t actHelpCmd(char* arg);    /// <print list of cmds
return_code_t actUptimeCmd(char* arg);  /// <print up time in ms
//return_code_t actTasksCmd(char* arg);   /// <list active tasks
return_code_t actResetCmd(char* arg);   /// <reset device
return_code_t actCfgExportCmd(char* arg); /// <save cfg vars to file
return_code_t actConCmd(char* arg);     /// <connect to a port
return_code_t actEchoCmd(char* arg);   /// <testing command
return_code_t actHelloCmd(char* arg);   /// <testing command
return_code_t actSweep(char* arg);   /// <testing command
return_code_t actUploadCmd(char* arg);   /// <ascii file upload command
return_code_t actMacroCmd(char* arg);   /// call macros
return_code_t actSetDebugCmd(char* arg);     /// <set/clear module debug flags
return_code_t actLogCmd(char* arg);     /// log annotation
return_code_t actCatCmd(char* arg);     /// cat/tail
return_code_t actLineCountCmd(char* arg);     /// count lines
return_code_t actCtrCmd(char* arg);   /// change/show counter value
return_code_t actFlagCmd(char* arg);   /// change/show flag value
return_code_t actVersionCmd(char* arg);   /// show version
return_code_t actQCountCmd(char* arg);   /// queue entry count
return_code_t actQPopCmd(char* arg);   /// read and erase queue entries
return_code_t actQPeekCmd(char* arg);   /// read queue entries

/// Get commands 
return_code_t actGetTime(char* arg);        /// <display time from RTC
return_code_t actGetNextRun(char* arg);    /// <display time until next task
return_code_t actGetBitCmd(char* arg);      /// <get state if a dig_out pin
return_code_t actGetAnalogCmd(char* arg);   /// <display voltage on an analog port
return_code_t actGetSerCmd(char* arg);      /// <get a line from a serial port
return_code_t actGetDataCmd(char* arg);
return_code_t actGetVarCmd(char* arg);      /// <show config var's value
return_code_t actGetStdCmd(char* arg);       /// <display standard frequency and counts
/// Set commands 
return_code_t actSetTime(char* arg);        /// <set the time on the RTC
return_code_t actSetBitsCmd(char* arg);      /// <turn on dig_out bit
return_code_t actSetVarCmd(char* arg);      /// <set a config var's value
return_code_t actSetSerCmd(char* arg);      /// <send message to port
return_code_t actSetBaudCmd(char* arg);     /// <set new baudrate
/// Clear commands 
return_code_t actClrBitsCmd(char* arg);      /// <turn off dig_out bit
/// Pulse commands
//return_code_t actPulseBitCmd(char* arg);      /// Pulse IO bit
return_code_t actPulseBitsCmd(char* arg);      /// Pulse IO bit

// Li commands
return_code_t actLicorTMCmd(char* arg);      /// take Licor measurement
return_code_t actLicorORCmd(char* arg);      /// set Licor output rate
return_code_t actLicorInitCmd(char* arg);      /// initialize Licor
return_code_t actLicorLastCmd(char* arg); 
return_code_t actLicorCalCmd(char* arg); 
return_code_t actLicorNMEASCmd(char* arg); 

/// Script commands 
return_code_t actScrNOPCmd(char* arg, script_hnd_t hnd);      /// NOP
return_code_t actScrLoadCmd(char* arg, script_hnd_t hnd);      /// Load
return_code_t actScrUnloadCmd(char* arg, script_hnd_t hnd);      /// Unload
return_code_t actScrResetCmd(char* arg, script_hnd_t hnd);      /// Reset
return_code_t actScrRunCmd(char* arg, script_hnd_t hnd);      /// Run
return_code_t actScrJogCmd(char* arg, script_hnd_t hnd);      /// Jog
return_code_t actScrEndCmd(char* arg, script_hnd_t hnd);      /// End
return_code_t actScrDelayCmd(char* arg, script_hnd_t hnd);    /// Delay
return_code_t actScrShowCmd(char* arg, script_hnd_t hnd);
return_code_t actScrDebugCmd(char* arg, script_hnd_t hnd);    /// set debug flag
return_code_t actScrMacroCmd(char* arg, script_hnd_t hnd);    /// run macros
return_code_t actScrScheduleCmd(char* arg, script_hnd_t hnd); /// schedule script
return_code_t actScrSyncCmd(char* arg, script_hnd_t hnd);     /// restart script run timer
return_code_t actScrGotoCmd(char* arg, script_hnd_t hnd);     /// jump to label
return_code_t actScrIfCmd(char* arg, script_hnd_t hnd);       /// conditional 

#endif