|
LRAUV
revA
|
Provides a simple command line interface to the LRAUV. More...
#include <CommandLine.h>


Public Member Functions | |
| CommandLine (Supervisor &supervisor) | |
| virtual | ~CommandLine () |
| void | initialize () |
| Provide a space for initialization before being run. More... | |
| void | run () |
| The actual "payload" of the component. More... | |
| void | uninitialize () |
| Provide a space for uninitialization. More... | |
| virtual bool | isWritable () |
| indicates whether the stream can actually be written to. More... | |
| virtual OutStream & | write (const char *buffer, size_t num) |
| writes num bytes from buffer to the output buffer/stream More... | |
| void | setChar (const char theChar) |
| void | flush () |
| FILE * | getOutFile () |
| void | commandBang (ParsedCommand *parsedCommand) |
| void | commandBurn (ParsedCommand *parsedCommand, BurnMode mode) |
| void | commandConfigSet (ParsedCommand *parsedCommand, ConfigSetMode mode) |
| void | commandConversation (ParsedCommand *parsedCommand, ConversationMode mode) |
| void | commandDo (ParsedCommand *parsedCommand) |
| void | commandFailComponent (ParsedCommand *parsedCommand, FailComponentMode mode) |
| void | commandFailVariable (ParsedCommand *parsedCommand, FailVariableMode mode) |
| void | commandGet (ParsedCommand *parsedCommand) |
| void | commandGFscan (ParsedCommand *parsedCommand) |
| void | commandHelp (ParsedCommand *parsedCommand) |
| void | commandIbit (ParsedCommand *parsedCommand) |
| void | commandIbitMcp3553 (ParsedCommand *parsedCommand) |
| void | commandLoad (ParsedCommand *parsedCommand) |
| void | commandMaintainAdd (ParsedCommand *parsedCommand, SyncComponent::CycleOrder cycleOrder) |
| void | commandMaintainClear (ParsedCommand *parsedCommand) |
| void | commandMaintainUnavailable (ParsedCommand *parsedCommand, SyncComponent::CycleOrder cycleOrder) |
| void | commandMaintainInvalid (ParsedCommand *parsedCommand, SyncComponent::CycleOrder cycleOrder) |
| void | commandMaintainList (ParsedCommand *parsedCommand) |
| void | commandMaintainRemove (ParsedCommand *parsedCommand) |
| void | commandQuick (ParsedCommand *parsedCommand, QuickMode mode) |
| void | commandQuit (ParsedCommand *parsedCommand) |
| void | commandReportAdd (ParsedCommand *parsedCommand, ReportAddMode mode) |
| void | commandReportClear (ParsedCommand *parsedCommand) |
| void | commandReportList (ParsedCommand *parsedCommand) |
| void | commandReportRemove (ParsedCommand *parsedCommand) |
| void | commandRestart (ParsedCommand *parsedCommand, RestartType mode) |
| void | commandRestartApplication (ParsedCommand *parsedCommand) |
| void | commandRestartHardware (ParsedCommand *parsedCommand) |
| void | commandRestartLogs (ParsedCommand *parsedCommand) |
| void | commandRestartSystem (ParsedCommand *parsedCommand) |
| void | commandResume (ParsedCommand *parsedCommand) |
| void | commandRetransmit (ParsedCommand *parsedCommand, RetransmitType retransmitType) |
| void | commandRun (ParsedCommand *parsedCommand) |
| void | commandSet (ParsedCommand *parsedCommand) |
| void | commandSchedule (ParsedCommand *parsedCommand, ScheduleType scheduleType) |
| void | commandSchedulePause (Syslog::Severity schedulePauseSeverity, Timestamp pauseTime) |
| void | commandScheduleShowPaused () |
| void | commandScheduleResume () |
| void | commandShowBest (ParsedCommand *parsedCommand) |
| void | commandShowComponent (ParsedCommand *parsedCommand) |
| void | commandShowDependencies (ParsedCommand *parsedCommand) |
| void | commandShowStack (ParsedCommand *parsedCommand) |
| void | commandShowState (ParsedCommand *parsedCommand) |
| void | commandShowVariable (ParsedCommand *parsedCommand) |
| void | commandStop (ParsedCommand *parsedCommand) |
Public Member Functions inherited from AsyncComponent | |
| bool | isIdlePriority () |
Public Member Functions inherited from Component | |
| virtual | ~Component () |
| Destructor cleans up readers_ and writers_. More... | |
| void | registerReader (DataReader *reader) |
| void | unregisterReader (DataReader *reader) |
| void | registerWriter (DataWriter *writer) |
| void | unregisterWriter (DataWriter *writer) |
| void | disableMetering (void) |
| FlexArray< DataReader * > & | getReaderList (void) |
| FlexArray< DataWriter * > & | getWriterList (void) |
| const Module * | getModule () |
| virtual void | configure () |
| Read (or re-read!) configuration settings. More... | |
| virtual void | execute (void) |
| bool | isActive () const |
| Indicates if the component is active. More... | |
| const CodedStr & | getName (void) const |
| Returns the name. More... | |
| const Timestamp & | getTimeOfLastRun (void) const |
| ComponentState | getState (void) |
| Return the component's current state. More... | |
| void | setState (ComponentState state) |
| RunState | getRunState (void) |
| Return the component's run state. More... | |
| bool | isUsingRunState () |
| Return true if using runState. More... | |
| void | requestData (bool requestingData) |
| Tell the component to start (or stop) sending data. More... | |
| void | requestStart () |
| Tell the component to start runnning. More... | |
| void | requestPause (const Timespan expectedPauseTime) |
| Tell the component to pause runnning. More... | |
| void | requestResume () |
| Tell the component resume from pause. More... | |
| void | requestStop () |
| Tell the component to stop runnning. More... | |
| virtual RunState | start () |
| Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence. More... | |
| virtual RunState | starting () |
| Might follow a STOP...START sequence Subseqent. More... | |
| virtual RunState | runnable () |
| Should eventually follow a START request or RESETTING. More... | |
| virtual RunState | satisfied () |
| Possible return value of a Behavior. More... | |
| virtual RunState | pause () |
| Pause for a short period (indicated by pauseTime) More... | |
| virtual RunState | pausing () |
| Might follow a PAUSE request. More... | |
| virtual RunState | paused () |
| Should eventually follow a PAUSE request: should set continueTime. More... | |
| virtual RunState | resume () |
| Resume from PAUSE. More... | |
| virtual RunState | resuming () |
| Might follow a PAUSE...RESUME sequence. More... | |
| virtual RunState | resetting () |
| Might occur in case of Error. More... | |
| virtual RunState | stop () |
| Initial state – can be later followed by START. More... | |
| virtual RunState | stopping () |
| Might follow a STOP request. More... | |
| virtual RunState | stopped () |
| Should eventually follow a STOP request. More... | |
| void | setCriticalFailureReported (bool boolVal) |
| void | setRecoveringFromCritical (bool boolVal) |
| void | setFailureReported (bool boolVal) |
| bool | isFailureUninitialized () |
| void | setFailureUninitialized (bool boolVal) |
| void | setRetryTimeout (const Timespan &timeout) |
| virtual bool | isCompleted (void) |
| Query if this component is completed. More... | |
| void | setPeriod (const Timespan &period) |
| Set the period of this component... used if it is periodic. More... | |
| const Timespan & | getPeriod (void) |
| Returns the component's period (regardless of whether it is periodic) More... | |
| ComponentType | getComponentType () |
| Getter function for ComponentType. More... | |
| virtual bool | isFailed (void) const |
| virtual FailureMode::FailType | getFailureType (void) const |
| virtual bool | getCriticalFailureReported (void) const |
| virtual bool | getFailureReported (void) const |
| virtual Timespan | getRetryTimeout (void) const |
| virtual FailureMode::FailType | setFailure (FailureMode::FailType failureType) |
| virtual int | getFailCount (void) const |
| virtual bool | isFailureMissionCritical () |
| virtual int | getAllowableFailures (void) const |
| virtual void | setAllowableFailures (int fails) |
| Logger & | getLogger (void) |
| virtual int | incrementFailCount (void) |
| virtual void | resetFailCount (void) |
| virtual int | getSkippedRunsSinceFail (void) const |
| virtual int | incrementSkippedRunsSinceFail (void) |
| virtual void | logVoltage (float voltage, float averageVoltage) |
| virtual void | logCurrent (float current, float averageCurrent) |
| const Timestamp & | getWriteTimestamp (void) |
| void | setWriteTimestamp (const Timestamp &writeTimestamp) |
| BlobReader * | newBlobReader (const BlobURI &blobURI) |
| BlobReader * | newBlobReaderFromUniversal (const Str &componentName, const UniversalBlobURI &blobURI) |
| BlobWriter * | newBlobWriter (const BlobURI &blobURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| ConfigReader * | newConfigReader (const ConfigURI &configURI) |
| DataReader * | newDataReader (const DataURI &dataURI) |
| DataReader * | newDataReaderFromUniversal (const Str &componentName, const UniversalURI &universalURI) |
| DataWriter * | newDataWriter (const DataURI &dataURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalBlobReader * | newUniversalBlobReader (const UniversalBlobURI &universalURI) |
| UniversalBlobWriter * | newUniversalBlobWriter (const UniversalBlobURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalDataReader * | newUniversalReader (const UniversalURI &universalURI) |
| UniversalDataWriter * | newUniversalWriter (const UniversalURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
Public Member Functions inherited from OutStream | |
| virtual | ~OutStream () |
| Destructor. More... | |
| virtual OutStream & | writeHex (const char *buffer, size_t num) |
| writes num bytes from buffer to the output buffer/stream as hex chars More... | |
| virtual OutStream & | write (const char *buffer) |
| writes zero-terminated buffer to the output buffer/stream More... | |
| virtual OutStream & | writeHex (const char *buffer) |
| writes zero-terminated buffer to the output buffer/stream More... | |
| OutStream & | operator<< (const Str buffer) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const char buffer[]) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const char byte) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const signed char byte) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const unsigned char byte) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const int number) |
| write a Str, using stream operator More... | |
| OutStream & | writeChar (const signed char value) |
| writes a single byte to the output buffer/stream More... | |
| OutStream & | writeCharHex (const signed char byte) |
| writes a single signed char to the output buffer/stream as 2 hex chars More... | |
| OutStream & | writeUCharHex (const unsigned char byte) |
| writes a single unsigned char to the output buffer/stream as 2 hex chars More... | |
| OutStream & | writeInteger (const int number, const unsigned int radix=10) |
| writes an integer as a base-radix string More... | |
| OutStream & | writeNumber (const double number, const unsigned int radix=10) |
| OutStream & | writeShort (const short value) |
| writes a single short to the output buffer/stream More... | |
| OutStream & | writeShortHex (const short word) |
| writes a single short to the output buffer/stream as 4 hex chars More... | |
| OutStream & | writeUShortHex (const unsigned short word) |
| writes a single unsigned short to the output buffer/stream as 4 hex chars More... | |
| OutStream & | writeUShortCompact (const unsigned short &value) |
| writes an unsigned short integer as 1 to 3 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 16 bit value, encoded in 3 bytes More... | |
| OutStream & | writeInt24 (const int medInt) |
| writes a 3-byte integer to the output buffer/stream only works on little-endian machines! More... | |
| OutStream & | writeInt (const int value) |
| writes a 4-byte integer to the output buffer/stream More... | |
| OutStream & | writeLongLong (const long long value) |
| writes a 8-byte integer to the output buffer/stream More... | |
| OutStream & | writeLongLongCompact (const long long &value) |
| writes a signed long long integer as 1 to 9 bytes, encoded as follows: 0xxxxxxx - 7 bit value, encoded in 1 byte 10xxxxxx+1byte - 14 bit value, encoded in 2 bytes 110xxxxx+2bytes - 21 bit value, encoded in 3 bytes 1110xxxx+3bytes - 28 bit value, encoded in 4 bytes 11110xxx+4bytes - 35 bit value, encoded in 5 bytes 111110xx+5bytes - 42 bit value, encoded in 6 bytes 1111110x+6bytes - 49 bit value, encoded in 7 bytes 11111110+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes More... | |
| OutStream & | writeFloat (const float value) |
| writes a 4-byte float to the output buffer/stream More... | |
| OutStream & | writeFloat2 (const float value) |
| writes a 2-byte float to the output buffer/stream More... | |
| OutStream & | writeFloat3 (const float value) |
| writes a 3-byte float to the output buffer/stream More... | |
| OutStream & | writeDouble (const double value) |
| writes a 8-byte double to the output buffer/stream More... | |
| OutStream & | writeDouble6 (const double value) |
| size_t | bytesWritten () |
Static Public Member Functions | |
| static void | DoCommand (const char *command, bool forceRun) |
| static void | DoScheduled () |
| static void | DoScheduleList () |
| static void | DoScheduleResume () |
| static void | DoSchedulePause (Syslog::Severity schedulePauseSeverity, Timestamp pauseTime) |
| static bool | IsCommandQueued () |
| static void | CommandBang (ParsedCommand *parsedCommand, int mode) |
| static void | CommandBurn (ParsedCommand *parsedCommand, int mode) |
| static void | CommandConfigSet (ParsedCommand *parsedCommand, int mode) |
| static void | CommandConversation (ParsedCommand *parsedCommand, int mode) |
| static void | CommandDo (ParsedCommand *parsedCommand, int mode) |
| static void | CommandFailComponent (ParsedCommand *parsedCommand, int mode) |
| static void | CommandFailVariable (ParsedCommand *parsedCommand, int mode) |
| static void | CommandGet (ParsedCommand *parsedCommand, int mode) |
| static void | CommandGFscan (ParsedCommand *parsedCommand, int mode) |
| static void | CommandHelp (ParsedCommand *parsedCommand, int mode) |
| static void | CommandIbit (ParsedCommand *parsedCommand, int mode) |
| static void | CommandIbitMcp3553 (ParsedCommand *parsedCommand, int mode) |
| static void | CommandLoad (ParsedCommand *parsedCommand, int mode) |
| static void | CommandMaintainAdd (ParsedCommand *parsedCommand, int mode) |
| static void | CommandMaintainClear (ParsedCommand *parsedCommand, int mode) |
| static void | CommandMaintainUnavailable (ParsedCommand *parsedCommand, int mode) |
| static void | CommandMaintainInvalid (ParsedCommand *parsedCommand, int mode) |
| static void | CommandMaintainList (ParsedCommand *parsedCommand, int mode) |
| static void | CommandMaintainRemove (ParsedCommand *parsedCommand, int mode) |
| static void | CommandQuick (ParsedCommand *parsedCommand, int mode) |
| static void | CommandQuit (ParsedCommand *parsedCommand, int mode) |
| static void | CommandReportAdd (ParsedCommand *parsedCommand, int mode) |
| static void | CommandReportClear (ParsedCommand *parsedCommand, int mode) |
| static void | CommandReportList (ParsedCommand *parsedCommand, int mode) |
| static void | CommandReportRemove (ParsedCommand *parsedCommand, int mode) |
| static void | CommandRestart (ParsedCommand *parsedCommand, int mode) |
| static void | CommandResume (ParsedCommand *parsedCommand, int mode) |
| static void | CommandRetransmit (ParsedCommand *parsedCommand, int mode) |
| static void | CommandRun (ParsedCommand *parsedCommand, int mode) |
| static void | CommandSet (ParsedCommand *parsedCommand, int mode) |
| static void | CommandSchedule (ParsedCommand *parsedCommand, int mode) |
| static void | CommandShowBest (ParsedCommand *parsedCommand, int mode) |
| static void | CommandShowComponent (ParsedCommand *parsedCommand, int mode) |
| static void | CommandShowDependencies (ParsedCommand *parsedCommand, int mode) |
| static void | CommandShowStack (ParsedCommand *parsedCommand, int mode) |
| static void | CommandShowState (ParsedCommand *parsedCommand, int mode) |
| static void | CommandShowVariable (ParsedCommand *parsedCommand, int mode) |
| static void | CommandStop (ParsedCommand *parsedCommand, int mode) |
Protected Member Functions | |
| Command & | addCommand (const char *keyword, const char *description, bool advanced=false) |
| void | clearParsed () |
| bool | findUniqueArg (char *buffer, int len) |
| Return true if a unique arg matches the supplied arg. More... | |
| bool | parseBufferEnd () |
| If the last word in buffer is a valid arg, deal with it. More... | |
| void | completeArg (char *buffer, int len) |
| Normally called in response to a tab keypress. More... | |
| CommandSyntax * | findUniqueSyntax (char *buffer, int len, bool &anyMatch) |
| Return unique syntax that buffer matches unique keyword. More... | |
| bool | findSyntax (char *buffer, int len) |
| If the buffer equals a unique syntax keyword, set parsedSyntax_ to that syntax. More... | |
| void | completeSyntax (char *buffer, int len) |
| Normally called in response to a tab keypress. More... | |
| void | clearLine () |
| void | backspace () |
| void | setLine (const char *line, bool allowExec) |
| void | execLine () |
| void | getLines () |
| unsigned char | kbGetc () |
| char * | nextWord (char **line) |
Protected Member Functions inherited from AsyncComponent | |
| AsyncComponent (const Str &name, const Module *module, const Timespan period, bool idlePriority=false) | |
| Protected constructor for components that run in periodic asynchronous threads. More... | |
| AsyncComponent (const Str &name, const Module *module, bool idlePriority=false) | |
| Protected constructor for components that run in continuous asynchronous threads. More... | |
Protected Member Functions inherited from Component | |
| virtual ConfigURI | getConfigURI (ConfigOption configOption) const |
| Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc. More... | |
| virtual ConfigURI | getConfigURI (ConfigOption configOption, ElementURI forElement) const |
| Should return [myNamespace]::POWER_[forElement], [myNamespace]::LATENCY_[forElement], etc. More... | |
| virtual void | setDurationOfLastRun (const Timespan &span) |
| virtual void | setTimeOfRun (const Timestamp &time) |
| virtual void | setTimeOfLastRun (const Timestamp &time) |
| virtual void | setDt (const Timespan &dt) |
| virtual bool | setEnabled (bool enabled=true) |
| void | setRunState (const RunState runState) |
| const Timespan | getPauseTime () const |
| virtual void | setFailureMissionCritical (bool failureMissionCritical) |
| bool | simulateHardware () |
Protected Member Functions inherited from OutStream | |
| OutStream () | |
| Protected Constructor for abstract class. More... | |
Protected Attributes | |
| FlexArray< Command * > | commands_ |
| ParsedCommand | parsedCommands_ [MAX_CMDS] |
| int | parsedCommandCount_ |
| bool | haveTermios_ |
| struct termios | originalTermios_ |
| struct termios | newTermios_ |
| Supervisor & | supervisor_ |
| FILE * | in_ |
| FILE * | out_ |
| const char * | prompt_ |
| char | hostname_ [MAX_HOST_NAME_SIZE] |
| FlexArray< Str * > | cmdHistory_ |
| size_t | cmdHistoryIndex_ |
| Mutex | scheduleMutex_ |
| bool | gettingLines_ |
| bool | cmdQueued_ |
| StrValue | keyText_ |
| Timestamp | burnStopTime_ |
| char | doBuffer_ [1024] |
| size_t | doBytes_ |
| Str | doSbd_ |
| DataReader * | ibitRunningReader_ |
| DataReader * | scanRunningReader_ |
| UniversalDataReader * | platformConversationReader_ |
| UniversalDataWriter * | platformConversationWriter_ |
Protected Attributes inherited from AsyncComponent | |
| bool | idlePriority_ |
Protected Attributes inherited from Component | |
| Logger | logger_ |
| Syslog::Severity | debugLevel_ |
| ComponentState | state_ |
| Keep track of whether the component has "completed" or should be run again. More... | |
| Timespan | desiredPeriod_ |
| CodedStr & | name_ |
| Store the component's name (used for logging purposes) More... | |
| Timestamp | timeOfRun_ |
| Timestamp | timeOfLastRun_ |
| Timespan | durationOfLastRun_ |
| Timespan | dt_ |
| Timespan | retryTimeout_ |
| bool | enabled_ |
| bool | failureReported_ |
| Indicates if the failure has been reported – cuts down on syslog. More... | |
| bool | criticalFailureReported_ |
| Indicates if a "Critical" failure has been reported – cuts down on syslog. More... | |
| bool | recoveringFromCritical_ |
| Indicates that a component had a previous critical failure that has been cleared temporarily awaiting final word from the component itself. More... | |
| bool | failureUninitialized_ |
| Indicates if the failure has resulted in an uninitialize call. More... | |
| int | failCount_ |
| Number of failures logged by PCaller. More... | |
| bool | failureMissionCritical_ |
| If true (default), complete failure ends mission. More... | |
| int | allowableFailures_ |
| Number of failures allowed to occur. More... | |
| int | skippedRunsSinceFail_ |
| Number of skipped runs since failureMode_ set by failCount_. More... | |
| FailureMode::FailType | failureType_ |
| Failed status. If failCount_ > 0, then this may be reset. More... | |
| Timestamp | timeOfFailure_ |
| Time of last failure. Relevant only if failed=true. More... | |
| Timestamp | writeTimestamp_ |
| Time of last write. More... | |
| FlexArray< DataReader * > | readers_ |
| FlexArray< DataWriter * > | writers_ |
| const Module * | module_ |
| Timespan | pauseTime_ |
| bool | meteringEnabled_ |
| If true, metering is enabled. More... | |
| DataWriter * | durationOfLastRunWriter_ |
| Writer for durationOfLastRun. More... | |
| DataWriter * | voltageWriter_ |
| DataWriter * | avgVoltageWriter_ |
| DataWriter * | currentWriter_ |
| DataWriter * | avgCurrentWriter_ |
| bool | persistentPause_ |
| True if data is persistent while component is paused. More... | |
Protected Attributes inherited from OutStream | |
| size_t | lastWritten_ |
Static Protected Attributes | |
| static const int | BUFF_SIZE = 1024 |
| static char | ConsoleBuffer_ [BUFF_SIZE] |
| static int | InputIndex_ |
| static char | OutputBuffer_ [BUFF_SIZE] |
| static int | OutputIndex_ |
| static const int | HISTORY_SIZE = 50 |
| static bool | AtMode_ |
| static const Timespan | BANG_TIMEOUT |
| static const size_t | MAX_HOST_NAME_SIZE = 128 |
| static char | QueuedCommand_ [BUFF_SIZE] |
| static Mutex | QueueCommandMutex_ |
| static CommandLine * | Instance_ |
Static Protected Attributes inherited from OutStream | |
| static const unsigned char | HEX_CHARS [] = "0123456789ABCDEF" |
Private Member Functions | |
| CommandLine (const CommandLine &old) | |
Friends | |
| class | CommandLine_Test |
Additional Inherited Members | |
Public Types inherited from Component | |
| enum | ComponentState { BLOCK_CONTINUOUS, BLOCK_PERIODIC, BLOCK_NORMAL, BLOCK_COMPLETED, BLOCK_UNKNOWN } |
| In this model, the component has basically two states: wanting to run, and completed (no longer needing to run). More... | |
| enum | ComponentType { COMPONENT_ASYNC, COMPONENT_CONFIG, COMPONENT_BEHAVIOR, COMPONENT_SYNC } |
| Components can indicate how they want to be handled by their type. More... | |
| enum | RunState { NO_RUN_STATE = 0, START, STARTING, RUNNABLE, SATISFIED, PAUSE, PAUSING, PAUSED, RESUME, RESUMING, RESETTING, STOP, STOPPING, STOPPED } |
Provides a simple command line interface to the LRAUV.
The command line is available from the console while the application runs, and is intended to take commands sent over the satellite radio.
| CommandLine::CommandLine | ( | Supervisor & | supervisor | ) |
References Command::addArg(), addCommand(), Command::addSyntax(), ARG_COMMAND, ARG_COMPONENT, ARG_CONFIG_DIR, ARG_CONFIG_VARIABLE, ARG_DECIMATION_TYPE, ARG_FLOAT, ARG_INT, ARG_MISSION, ARG_QUOTED_STRING, ARG_REGEX, ARG_SECONDS, ARG_SERVICE_TYPE, ARG_STRING, ARG_TIMESTAMP, ARG_TOKEN, ARG_UNIT, ARG_UNIVERSAL, ARG_VARIABLE, Units::BOOL, BURN_OFF, BURN_ON, BURN_SECONDS, CommandBang(), CommandBurn(), CommandConfigSet(), CommandConversation(), CommandDo(), CommandFailComponent(), CommandFailVariable(), CommandGet(), CommandGFscan(), CommandHelp(), CommandIbit(), CommandIbitMcp3553(), CommandLoad(), CommandMaintainAdd(), CommandMaintainClear(), CommandMaintainInvalid(), CommandMaintainList(), CommandMaintainRemove(), CommandMaintainUnavailable(), CommandQuick(), CommandQuit(), CommandReportAdd(), CommandReportClear(), CommandReportList(), CommandReportRemove(), CommandRestart(), CommandResume(), CommandRetransmit(), CommandRun(), CommandSchedule(), CommandSet(), CommandShowBest(), CommandShowComponent(), CommandShowDependencies(), CommandShowStack(), CommandShowState(), CommandShowVariable(), CommandStop(), CONFIG_SET_CONFIG, CONFIG_SET_LIST, CONFIG_SET_LOGGING, CONFIG_SET_RELOAD, CONVERSATION_SHOW, CONVERSATION_START, CONVERSATION_STOP, SyncComponent::CYCLE_CONTROL, SyncComponent::CYCLE_DERIVATION, SyncComponent::CYCLE_MISSION, SyncComponent::CYCLE_SENSOR, SyncComponent::CYCLE_SERVO, SyncComponent::CYCLE_SIMULATOR, doBuffer_, FAIL_COMPONENT_HARD, FAIL_COMPONENT_LIST, FAIL_COMPONENT_NONE, FAIL_COMPONENT_SEGFAULT, FAIL_COMPONENT_SHOW, FAIL_COMPONENT_SOFT, FAIL_VARIABLE_AVAILABLE, FAIL_VARIABLE_INVALID, FAIL_VARIABLE_LIST, FAIL_VARIABLE_SHOW, FAIL_VARIABLE_UNAVAILABLE, FAIL_VARIABLE_VALID, haveTermios_, hostname_, ibitRunningReader_, in_, Instance_, MAX_HOST_NAME_SIZE, Component::newDataReader(), newTermios_, Component::newUniversalReader(), Component::newUniversalWriter(), NOT_REQUIRED, originalTermios_, UniversalURI::PLATFORM_CONVERSATION, platformConversationReader_, platformConversationWriter_, prompt_, QueuedCommand_, QUICK_OFF, QUICK_ON, QUICK_SHOW, REPORT_ADD_MOD, REPORT_ADD_PERIODIC, REPORT_ADD_TOUCH, REQUIRED, REQUIRED_AFTER_PREVIOUS, RESTART_APPLICATION, RESTART_HARDWARE, RESTART_LOGS, RESTART_SYSTEM, RETRANSMIT_SBD, scanRunningReader_, SCHEDULE_ASAP, SCHEDULE_CLEAR, SCHEDULE_LIST, SCHEDULE_NEXT, SCHEDULE_PAUSE, SCHEDULE_REMOVE, SCHEDULE_RESUME, SCHEDULE_TIME, Component::setAllowableFailures(), and Component::setRetryTimeout().
|
virtual |
References haveTermios_, in_, Instance_, and originalTermios_.
|
private |
|
inlineprotected |
References FlexArray< T >::push().
Referenced by CommandLine().
|
protected |
References ConsoleBuffer_, InputIndex_, and out_.
Referenced by clearLine(), and getLines().
|
protected |
References backspace(), and InputIndex_.
Referenced by getLines(), and setLine().
|
protected |
References ParsedCommand::clearAll(), parsedCommandCount_, and parsedCommands_.
Referenced by getLines(), setLine(), and CommandLine_Test::testParse().
|
static |
References commandBang(), and Instance_.
Referenced by CommandLine(), and DataReceiver::Receive().
| void CommandLine::commandBang | ( | ParsedCommand * | parsedCommand | ) |
References BANG_TIMEOUT, Str::cStr(), Syslog::FAULT, ParsedCommand::getStringArg(), Syslog::IMPORTANT, Str::length(), Component::logger_, Timestamp::Now(), and Logger::syslog().
Referenced by CommandBang().
|
static |
References commandBurn(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandBurn | ( | ParsedCommand * | parsedCommand, |
| BurnMode | mode | ||
| ) |
References LPC3Reg::ActivateBurnwire(), BURN_OFF, BURN_ON, BURN_SECONDS, burnStopTime_, LPC3Reg::DeactivateBurnwire(), ParsedCommand::getNumberArg(), Syslog::IMPORTANT, Component::logger_, Timestamp::NOT_SET_TIME, Timestamp::Now(), and Logger::syslog().
Referenced by CommandBurn(), and getLines().
|
static |
References commandConfigSet(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandConfigSet | ( | ParsedCommand * | parsedCommand, |
| ConfigSetMode | mode | ||
| ) |
References commandSet(), CONFIG_SET_CONFIG, CONFIG_SET_LIST, CONFIG_SET_LOGGING, CONFIG_SET_RELOAD, Supervisor::ConfigureDecimation(), Str::cStr(), DecimationLogWriter::DecimationType2Str(), Syslog::FAULT, ParsedCommand::getDecimationTypeArg(), Slate::GetElement(), ParsedCommand::getNumberArg(), ParsedCommand::getServiceTypeArg(), ParsedCommand::getUnitArg(), ParsedCommand::getVariableArg(), ParsedCommand::hasArgIndex(), Syslog::IMPORTANT, ConfigDataElement::isSecure(), Config::LoadPersistedConfigSets(), Component::logger_, ElementURI::NO_CODE, Config::Persist(), ConfigDataElement::requiresRestart(), LogWriter::ServiceType2Str(), ConfigDataElement::setConfigValue(), and Logger::syslog().
Referenced by CommandConfigSet().
|
static |
References commandConversation(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandConversation | ( | ParsedCommand * | parsedCommand, |
| ConversationMode | mode | ||
| ) |
|
static |
References commandDo(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandDo | ( | ParsedCommand * | parsedCommand | ) |
References Str::cStr(), doBuffer_, doBytes_, doSbd_, Str::EMPTY_STR, Syslog::ERROR, Str::find(), ParsedCommand::getStringArg(), Str::length(), Component::logger_, and Logger::syslog().
Referenced by CommandDo().
|
static |
References commandFailComponent(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandFailComponent | ( | ParsedCommand * | parsedCommand, |
| FailComponentMode | mode | ||
| ) |
References FAIL_COMPONENT_HARD, FAIL_COMPONENT_LIST, FAIL_COMPONENT_NONE, FAIL_COMPONENT_SEGFAULT, FAIL_COMPONENT_SHOW, FAIL_COMPONENT_SOFT, Syslog::FAULT, ComponentRegistry::Find(), ParsedCommand::getComponentArg(), Component::getFailureType(), ComponentRegistry::GetIndexed(), Component::getName(), FailureMode::HARDWARE, Syslog::IMPORTANT, Component::isFailed(), ComponentRegistry::Length(), Component::logger_, FailureMode::NONE, Component::segfault(), Component::setFailure(), FailureMode::SOFTWARE, Logger::syslog(), and FailureMode::ToString().
Referenced by CommandFailComponent().
|
static |
References commandFailVariable(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandFailVariable | ( | ParsedCommand * | parsedCommand, |
| FailVariableMode | mode | ||
| ) |
References FAIL_VARIABLE_AVAILABLE, FAIL_VARIABLE_INVALID, FAIL_VARIABLE_LIST, FAIL_VARIABLE_SHOW, FAIL_VARIABLE_UNAVAILABLE, FAIL_VARIABLE_VALID, Syslog::FAULT, ElementURI::getCode(), Slate::GetElement(), Slate::GetElementURI(), Slate::GetElementURICount(), DataElement::getUri(), ParsedCommand::getVariableArg(), Syslog::IMPORTANT, DataElement::isInvalid(), DataElement::isUnavailable(), Component::logger_, ElementURI::NO_CODE, DataElement::setInvalid(), DataElement::setUnavailable(), and Logger::syslog().
Referenced by CommandFailVariable().
|
static |
References commandGet(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandGet | ( | ParsedCommand * | parsedCommand | ) |
|
static |
References commandGFscan(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandGFscan | ( | ParsedCommand * | parsedCommand | ) |
References DataReader::requestData(), and scanRunningReader_.
Referenced by CommandGFscan().
|
static |
References commandHelp(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandHelp | ( | ParsedCommand * | parsedCommand | ) |
References commands_, FlexArray< T >::get(), ParsedCommand::getCommandArg(), Command::help(), out_, and FlexArrayBase::size().
Referenced by CommandHelp().
|
static |
References commandIbit(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandIbit | ( | ParsedCommand * | parsedCommand | ) |
References ibitRunningReader_, and DataReader::requestData().
Referenced by CommandIbit(), and CommandIbitMcp3553().
|
static |
References commandIbit(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandIbitMcp3553 | ( | ParsedCommand * | parsedCommand | ) |
|
static |
References commandLoad(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandLoad | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::CRITICAL, ParsedCommand::getMissionArg(), Syslog::IMPORTANT, Supervisor::loadMission(), Component::logger_, supervisor_, and Logger::syslog().
Referenced by CommandLoad().
|
static |
References commandMaintainAdd(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandMaintainAdd | ( | ParsedCommand * | parsedCommand, |
| SyncComponent::CycleOrder | cycleOrder | ||
| ) |
References Supervisor::addMaintain(), SyncComponent::CYCLE_INCREMENT, Syslog::FAULT, ElementURI::getCode(), ParsedCommand::getNumberArg(), ParsedCommand::getUnitArg(), ParsedCommand::getVariableArg(), Component::logger_, ElementURI::NO_CODE, supervisor_, and Logger::syslog().
Referenced by CommandMaintainAdd().
|
static |
References commandMaintainClear(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandMaintainClear | ( | ParsedCommand * | parsedCommand | ) |
References Supervisor::removeAllMaintains(), and supervisor_.
Referenced by CommandMaintainClear().
|
static |
References commandMaintainInvalid(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandMaintainInvalid | ( | ParsedCommand * | parsedCommand, |
| SyncComponent::CycleOrder | cycleOrder | ||
| ) |
|
static |
References commandMaintainList(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandMaintainList | ( | ParsedCommand * | parsedCommand | ) |
References Supervisor::listMaintains(), and supervisor_.
Referenced by CommandMaintainList().
|
static |
References commandMaintainRemove(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandMaintainRemove | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::FAULT, ElementURI::getCode(), ParsedCommand::getVariableArg(), Component::logger_, ElementURI::NO_CODE, Supervisor::removeMaintain(), supervisor_, and Logger::syslog().
Referenced by CommandMaintainRemove().
|
static |
References commandMaintainUnavailable(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandMaintainUnavailable | ( | ParsedCommand * | parsedCommand, |
| SyncComponent::CycleOrder | cycleOrder | ||
| ) |
|
static |
References commandQuick(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandQuick | ( | ParsedCommand * | parsedCommand, |
| QuickMode | mode | ||
| ) |
References Syslog::FAULT, Syslog::IMPORTANT, Handler::IsFastSimAllowed(), Component::logger_, QUICK_OFF, QUICK_ON, QUICK_SHOW, and Logger::syslog().
Referenced by CommandQuick().
|
static |
References commandQuit(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandQuit | ( | ParsedCommand * | parsedCommand | ) |
References Component::BLOCK_COMPLETED, Component::setEnabled(), and Component::setState().
Referenced by CommandQuit(), commandRestartApplication(), and commandRestartSystem().
|
static |
References commandReportAdd(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandReportAdd | ( | ParsedCommand * | parsedCommand, |
| ReportAddMode | mode | ||
| ) |
References Supervisor::addReport(), Syslog::FAULT, ElementURI::getCode(), ParsedCommand::getNumberArg(), ParsedCommand::getVariableArg(), Component::logger_, ElementURI::NO_CODE, REPORT_ADD_MOD, REPORT_ADD_PERIODIC, REPORT_ADD_TOUCH, Reporter::REPORT_CHANGE, Reporter::REPORT_PERIODICALLY, Reporter::REPORT_TOUCHED, supervisor_, and Logger::syslog().
Referenced by CommandReportAdd().
|
static |
References commandReportClear(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandReportClear | ( | ParsedCommand * | parsedCommand | ) |
References Supervisor::removeAllReports(), and supervisor_.
Referenced by CommandReportClear().
|
static |
References commandReportList(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandReportList | ( | ParsedCommand * | parsedCommand | ) |
References Supervisor::listReports(), and supervisor_.
Referenced by CommandReportList().
|
static |
References commandReportRemove(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandReportRemove | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::FAULT, ElementURI::getCode(), ParsedCommand::getVariableArg(), Component::logger_, ElementURI::NO_CODE, Supervisor::removeReport(), supervisor_, and Logger::syslog().
Referenced by CommandReportRemove().
|
static |
References commandRestart(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandRestart | ( | ParsedCommand * | parsedCommand, |
| RestartType | mode | ||
| ) |
References commandRestartApplication(), commandRestartHardware(), commandRestartLogs(), commandRestartSystem(), RESTART_APPLICATION, RESTART_HARDWARE, RESTART_LOGS, and RESTART_SYSTEM.
Referenced by CommandRestart().
| void CommandLine::commandRestartApplication | ( | ParsedCommand * | parsedCommand | ) |
| void CommandLine::commandRestartHardware | ( | ParsedCommand * | parsedCommand | ) |
References commandRestartSystem(), Syslog::IMPORTANT, Component::logger_, and Logger::syslog().
Referenced by commandRestart().
| void CommandLine::commandRestartLogs | ( | ParsedCommand * | parsedCommand | ) |
References Supervisor::RestartLogs().
Referenced by commandRestart().
| void CommandLine::commandRestartSystem | ( | ParsedCommand * | parsedCommand | ) |
References AtMode_, Supervisor::ClearRunningFile(), commandQuit(), Syslog::FAULT, haveTermios_, in_, Component::logger_, newTermios_, originalTermios_, and Logger::syslog().
Referenced by commandRestart(), and commandRestartHardware().
|
static |
References commandResume(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandResume | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::CRITICAL, Str::cStr(), DoScheduleList(), DoScheduleResume(), ParsedCommand::getMissionArg(), Syslog::IMPORTANT, Component::logger_, Supervisor::resumeMission(), supervisor_, and Logger::syslog().
Referenced by CommandResume().
|
static |
References commandRetransmit(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandRetransmit | ( | ParsedCommand * | parsedCommand, |
| RetransmitType | retransmitType | ||
| ) |
References Str::cStr(), Syslog::FAULT, ParsedCommand::getIntegerArg(), ParsedCommand::getNumberArg(), ParsedCommand::getStringArg(), ParsedCommand::getTokenArg(), Component::logger_, Supervisor::QueueSBD(), RETRANSMIT_SBD, LogWriter::SERVICE_COUNT, LogWriter::ServiceType2Str(), Str::startsWith(), and Logger::syslog().
Referenced by CommandRetransmit().
|
static |
References commandRun(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandRun | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::CRITICAL, ParsedCommand::getMissionArg(), ParsedCommand::hasArgIndex(), Syslog::IMPORTANT, Component::logger_, Supervisor::runMission(), supervisor_, and Logger::syslog().
Referenced by CommandRun().
|
static |
References commandSchedule(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandSchedule | ( | ParsedCommand * | parsedCommand, |
| ScheduleType | scheduleType | ||
| ) |
References ScheduledItem::AddNext(), ScheduledItem::AddTimed(), ScheduledItem::Clear(), Timestamp::EPOCH_START_TIME, ParsedCommand::getIntegerArg(), ParsedCommand::getNumberArg(), ParsedCommand::getStringArg(), ParsedCommand::getTimestampArg(), ParsedCommand::getTokenArg(), Syslog::IMPORTANT, ScheduledItem::List(), Component::logger_, Timestamp::Now(), ScheduledItem::Pause(), ScheduledItem::Remove(), ScheduledItem::Resume(), SCHEDULE_ASAP, SCHEDULE_CLEAR, SCHEDULE_LIST, SCHEDULE_NEXT, SCHEDULE_PAUSE, SCHEDULE_REMOVE, SCHEDULE_RESUME, SCHEDULE_TIME, scheduleMutex_, and Logger::syslog().
Referenced by CommandSchedule().
| void CommandLine::commandSchedulePause | ( | Syslog::Severity | schedulePauseSeverity, |
| Timestamp | pauseTime | ||
| ) |
| void CommandLine::commandScheduleResume | ( | ) |
| void CommandLine::commandScheduleShowPaused | ( | ) |
|
static |
References commandSet(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandSet | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::FAULT, ParsedCommand::getArgCount(), Slate::GetElement(), ParsedCommand::getNumberArg(), ParsedCommand::getStringArg(), ParsedCommand::getUnitArg(), ParsedCommand::getVariableArg(), ConfigDataElement::isSecure(), Component::logger_, ElementURI::NO_CODE, Logger::syslog(), and Slate::WriteOnce().
Referenced by commandConfigSet(), and CommandSet().
|
static |
References commandShowBest(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandShowBest | ( | ParsedCommand * | parsedCommand | ) |
|
static |
References commandShowComponent(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandShowComponent | ( | ParsedCommand * | parsedCommand | ) |
References Str::cStr(), Syslog::FAULT, Slate::GetName(), ParsedCommand::getRegexArg(), Syslog::IMPORTANT, Component::logger_, CodedStr::NO_CODE, and Logger::syslog().
Referenced by CommandShowComponent().
|
static |
References commandShowDependencies(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandShowDependencies | ( | ParsedCommand * | parsedCommand | ) |
References Str::cStr(), DataAccessor::DATA_WRITER, DataAccess::getAccessorType(), CommandSyntax::getArg(), CodedStr::getCode(), ElementURI::getCode(), ParsedCommand::getComponentArg(), Slate::GetDataAccess(), DataAccess::getElementCode(), Slate::GetElementURI(), CommandArg::getKeyword(), Slate::GetName(), DataAccess::getOwnerCode(), ParsedCommand::getSyntax(), DataAccess::getUniversalCode(), ParsedCommand::getVariableArg(), DataAccess::NO_CODE, and out_.
Referenced by CommandShowDependencies().
|
static |
References commandShowStack(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandShowStack | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::IMPORTANT, Component::logger_, Supervisor::showStack(), supervisor_, and Logger::syslog().
Referenced by CommandShowStack().
|
static |
References commandShowState(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandShowState | ( | ParsedCommand * | parsedCommand | ) |
References Syslog::IMPORTANT, Component::logger_, MissionStateLogger::ShowMissionState(), and Logger::syslog().
Referenced by CommandShowState().
|
static |
References commandShowVariable(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandShowVariable | ( | ParsedCommand * | parsedCommand | ) |
References Str::cStr(), Syslog::FAULT, Slate::GetElement(), Slate::GetElementURI(), Slate::GetElementURICount(), Unit::getName(), ParsedCommand::getRegexArg(), DataElement::getUnit(), Syslog::IMPORTANT, DataElement::isOrphaned(), Component::logger_, and Logger::syslog().
Referenced by CommandShowVariable().
|
static |
References commandStop(), and Instance_.
Referenced by CommandLine().
| void CommandLine::commandStop | ( | ParsedCommand * | parsedCommand | ) |
References DoSchedulePause(), Syslog::IMPORTANT, Timestamp::Now(), Supervisor::stopMission(), and supervisor_.
Referenced by CommandStop().
|
protected |
Normally called in response to a tab keypress.
If there's a parsedCommand_, expand it. Otherwise expand all options and start a new line.
References commands_, ParsedCommand::completeArg(), ConsoleBuffer_, flush(), FlexArray< T >::get(), Command::getKeyword(), ParsedCommand::getStart(), InputIndex_, out_, parsedCommandCount_, parsedCommands_, and FlexArrayBase::size().
Referenced by getLines().
|
protected |
Normally called in response to a tab keypress.
If there's a parsedSyntax_, expand it. Otherwise expand all options and start a new line.
|
static |
References cmdQueued_, execLine(), gettingLines_, Instance_, Mutex::lock(), QueueCommandMutex_, setLine(), Timespan::sleepFor(), and Mutex::unlock().
Referenced by ScheduledItem::DoScheduled(), ESPComponent::powerUpESP(), DataReceiver::Receive(), ExternalSim::run(), Supervisor::run(), StopMission::runIfUnsatisfied(), Execute::runIfUnsatisfied(), and MissionManager::uninitializeMission().
|
static |
References ScheduledItem::DoScheduled(), Instance_, Component::logger_, and scheduleMutex_.
Referenced by Supervisor::run().
|
static |
References Instance_, ScheduledItem::List(), Component::logger_, and scheduleMutex_.
Referenced by commandResume().
|
static |
References Instance_, Component::logger_, ScheduledItem::Pause(), and scheduleMutex_.
Referenced by CBIT::checkCriticals(), and commandStop().
|
static |
References Instance_, Component::logger_, ScheduledItem::Resume(), and scheduleMutex_.
Referenced by commandResume().
|
protected |
References ParsedCommand::clearAll(), cmdHistory_, cmdHistoryIndex_, ConsoleBuffer_, ParsedCommand::execute(), flush(), HISTORY_SIZE, Syslog::IMPORTANT, InputIndex_, Component::logger_, parsedCommandCount_, parsedCommands_, FlexArray< T >::pop(), FlexArray< T >::push(), FlexArrayBase::size(), Logger::syslog(), and ParsedCommand::toString().
Referenced by DoCommand(), getLines(), and setLine().
|
protected |
If the buffer equals a unique syntax keyword, set parsedSyntax_ to that syntax.
Return true if buffer equals start of any syntax keyword.
|
protected |
Return true if a unique arg matches the supplied arg.
|
protected |
Return unique syntax that buffer matches unique keyword.
| void CommandLine::flush | ( | ) |
References BUFF_SIZE, ConsoleBuffer_, InputIndex_, out_, OutputBuffer_, OutputIndex_, and prompt_.
Referenced by completeArg(), execLine(), and write().
|
protected |
References StrValue::asString(), backspace(), Units::BOOL, BURN_OFF, burnStopTime_, clearLine(), clearParsed(), cmdHistory_, cmdHistoryIndex_, cmdQueued_, commandBurn(), completeArg(), ConsoleBuffer_, Str::cStr(), doBuffer_, doBytes_, doSbd_, Str::EMPTY_STR, Component::enabled_, Syslog::ERROR, execLine(), FlexArray< T >::get(), gettingLines_, hostname_, ibitRunningReader_, Syslog::INFO, InputIndex_, DataReader::isRequestingData(), kbGetc(), keyText_, Mutex::lock(), Component::logger_, Timestamp::NOT_SET_TIME, Timestamp::Now(), out_, parseBufferEnd(), prompt_, QueueCommandMutex_, DataReader::read(), DataReceiver::Receive(), DataReceiver::ReceiveSbd(), DataReader::requestData(), scanRunningReader_, Component::segfaultImpl(), Component::segfaultRequested_, setChar(), setLine(), FlexArrayBase::size(), Logger::syslog(), and Mutex::unlock().
Referenced by run().
|
inline |
References out_.
Referenced by ParsedCommand::completeCommand().
|
virtual |
Provide a space for initialization before being run.
Reimplemented from Component.
References Units::BOOL, keyText_, Component::logger_, platformConversationWriter_, Slate::ReadOnce(), and DataWriter::write().
|
static |
References cmdQueued_, Instance_, and QueueCommandMutex_.
Referenced by ScheduledItem::DoScheduled().
|
virtual |
indicates whether the stream can actually be written to.
Implements OutStream.
References Component::BLOCK_COMPLETED, Component::enabled_, and Component::state_.
|
protected |
References AtMode_, haveTermios_, in_, and Timespan::sleepFor().
Referenced by getLines().
|
protected |
|
protected |
If the last word in buffer is a valid arg, deal with it.
Report if a valid arg matches the supplied arg.
Return false if the end of the buffer is invalid.
If so, deal with it. If the last word in buffer is a valid arg, deal with it. If we need to toss the last character, return false.
References ARG_NONE, ARG_STRING, ParsedCommand::clearAll(), commands_, ConsoleBuffer_, ParsedCommand::getCurrentArgType(), ParsedCommand::getStart(), InputIndex_, ParsedCommand::isInQuotedString(), ParsedCommand::parseBufferEnd(), parsedCommandCount_, parsedCommands_, and ParsedCommand::setStart().
Referenced by getLines(), setChar(), and CommandLine_Test::testParse().
|
virtual |
The actual "payload" of the component.
Reimplemented from Component.
References Component::enabled_, getLines(), supervisor_, and Supervisor::terminate().
| void CommandLine::setChar | ( | const char | theChar | ) |
References BUFF_SIZE, ConsoleBuffer_, InputIndex_, Instance_, out_, and parseBufferEnd().
Referenced by ParsedCommand::completeCommand(), getLines(), and setLine().
|
protected |
References clearLine(), clearParsed(), execLine(), and setChar().
Referenced by DoCommand(), and getLines().
|
virtual |
Provide a space for uninitialization.
Reimplemented from Component.
|
virtual |
writes num bytes from buffer to the output buffer/stream
Implements OutStream.
References BUFF_SIZE, flush(), OutputBuffer_, and OutputIndex_.
|
friend |
|
staticprotected |
Referenced by commandRestartSystem(), and kbGetc().
|
staticprotected |
Referenced by commandBang().
|
staticprotected |
Referenced by commandRestartApplication(), flush(), setChar(), and write().
|
protected |
Referenced by commandBurn(), and getLines().
Referenced by execLine(), and getLines().
|
protected |
Referenced by execLine(), and getLines().
|
protected |
Referenced by DoCommand(), getLines(), and IsCommandQueued().
Referenced by commandHelp(), completeArg(), parseBufferEnd(), and CommandLine_Test::testParse().
|
staticprotected |
Referenced by backspace(), completeArg(), execLine(), flush(), getLines(), parseBufferEnd(), setChar(), and CommandLine_Test::testParse().
|
protected |
Referenced by commandDo(), CommandLine(), and getLines().
|
protected |
Referenced by commandDo(), and getLines().
|
protected |
Referenced by commandDo(), and getLines().
|
protected |
Referenced by DoCommand(), and getLines().
|
protected |
Referenced by CommandLine(), commandRestartSystem(), kbGetc(), and ~CommandLine().
|
staticprotected |
Referenced by execLine().
|
protected |
Referenced by CommandLine(), and getLines().
|
protected |
Referenced by commandIbit(), CommandLine(), and getLines().
|
protected |
Referenced by CommandLine(), commandRestartSystem(), kbGetc(), and ~CommandLine().
|
staticprotected |
Referenced by backspace(), clearLine(), completeArg(), execLine(), flush(), getLines(), parseBufferEnd(), setChar(), and CommandLine_Test::testParse().
|
staticprotected |
Referenced by CommandBang(), CommandBurn(), CommandConfigSet(), CommandConversation(), CommandDo(), CommandFailComponent(), CommandFailVariable(), CommandGet(), CommandGFscan(), CommandHelp(), CommandIbit(), CommandIbitMcp3553(), CommandLine(), CommandLoad(), CommandMaintainAdd(), CommandMaintainClear(), CommandMaintainInvalid(), CommandMaintainList(), CommandMaintainRemove(), CommandMaintainUnavailable(), CommandQuick(), CommandQuit(), CommandReportAdd(), CommandReportClear(), CommandReportList(), CommandReportRemove(), CommandRestart(), CommandResume(), CommandRetransmit(), CommandRun(), CommandSchedule(), CommandSet(), CommandShowBest(), CommandShowComponent(), CommandShowDependencies(), CommandShowStack(), CommandShowState(), CommandShowVariable(), CommandStop(), DoCommand(), DoScheduled(), DoScheduleList(), DoSchedulePause(), DoScheduleResume(), IsCommandQueued(), setChar(), CommandLine_Test::testParse(), and ~CommandLine().
|
protected |
Referenced by getLines(), and initialize().
|
staticprotected |
Referenced by CommandLine().
|
protected |
Referenced by CommandLine(), and commandRestartSystem().
|
protected |
Referenced by CommandLine(), commandRestartSystem(), and ~CommandLine().
|
protected |
Referenced by backspace(), commandHelp(), commandIbitMcp3553(), commandShowDependencies(), completeArg(), flush(), getLines(), getOutFile(), and setChar().
|
protected |
Referenced by clearParsed(), completeArg(), execLine(), and parseBufferEnd().
|
protected |
Referenced by clearParsed(), completeArg(), execLine(), and parseBufferEnd().
|
protected |
Referenced by commandConversation(), and CommandLine().
|
protected |
Referenced by commandConversation(), CommandLine(), and initialize().
|
protected |
Referenced by CommandLine(), flush(), and getLines().
|
staticprotected |
Referenced by DoCommand(), getLines(), and IsCommandQueued().
|
staticprotected |
Referenced by CommandLine().
|
protected |
Referenced by commandGFscan(), CommandLine(), and getLines().
|
protected |
Referenced by commandSchedule(), DoScheduled(), DoScheduleList(), DoSchedulePause(), and DoScheduleResume().
|
protected |
Referenced by commandLoad(), commandMaintainAdd(), commandMaintainClear(), commandMaintainInvalid(), commandMaintainList(), commandMaintainRemove(), commandMaintainUnavailable(), commandReportAdd(), commandReportClear(), commandReportList(), commandReportRemove(), commandResume(), commandRun(), commandShowStack(), commandStop(), and run().