10 #define COMMANDLINE_H_
50 static void DoCommand(
const char* command,
bool forceRun );
67 void setChar(
const char theChar );
88 commands_.
push( command );
327 void setLine(
const char* line,
bool allowExec );
unsigned char kbGetc()
Definition: CommandLine.cpp:2124
static void CommandHelp(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:806
Unit tests for CommandLine class.
Definition: CommandLine_Test.h:24
Definition: CommandLine.h:154
FILE * in_
Definition: CommandLine.h:304
static void CommandReportAdd(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1054
FlexArray< Command * > commands_
Definition: CommandLine.h:80
void execLine()
Definition: CommandLine.cpp:1908
static void DoSchedulePause(Syslog::Severity schedulePauseSeverity, Timestamp pauseTime)
Definition: CommandLine.cpp:1674
void commandFailComponent(ParsedCommand *parsedCommand, FailComponentMode mode)
Definition: CommandLine.cpp:603
Contains the SyncComponent class definition.
bool findUniqueArg(char *buffer, int len)
Return true if a unique arg matches the supplied arg.
static void CommandMaintainList(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:988
Definition: CommandLine.h:122
static void DoScheduleList()
Definition: CommandLine.cpp:1686
void commandResume(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1241
const char * prompt_
Definition: CommandLine.h:306
Definition: CommandLine.h:190
FlexArray< Str * > cmdHistory_
Definition: CommandLine.h:310
Definition: CommandLine.h:121
void commandShowStack(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1537
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: UniversalDataReader.h:26
void commandRun(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1301
void commandReportRemove(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1125
static const int BUFF_SIZE
Definition: CommandLine.h:287
static void CommandStop(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1615
void commandSchedule(ParsedCommand *parsedCommand, ScheduleType scheduleType)
Definition: CommandLine.cpp:1321
static void CommandBang(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:332
void push(T item)
Definition: FlexArray.h:160
void commandMaintainRemove(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1002
void commandReportClear(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1105
void commandMaintainClear(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:948
void commandMaintainAdd(ParsedCommand *parsedCommand, SyncComponent::CycleOrder cycleOrder)
Definition: CommandLine.cpp:925
static void CommandShowState(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1543
ScheduleType
Definition: CommandLine.h:187
Definition: CommandLine.h:142
Definition: CommandLine.h:176
Definition: CommandLine.h:136
ParsedCommand parsedCommands_[MAX_CMDS]
Definition: CommandLine.h:82
Definition: Command.h:376
static void CommandSet(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1362
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: DataReader.h:30
DataReader * scanRunningReader_
Definition: CommandLine.h:339
UniversalDataWriter * platformConversationWriter_
Definition: CommandLine.h:341
static bool IsCommandQueued()
Definition: CommandLine.cpp:1698
#define MAX_CMDS
Definition: CommandLine.h:24
static const int HISTORY_SIZE
Definition: CommandLine.h:294
static void CommandConversation(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:548
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: UniversalDataWriter.h:24
Definition: CommandLine.h:193
static void CommandDo(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:572
Definition: CommandLine.h:192
Definition: CommandLine.h:144
Definition: CommandLine.h:178
Definition: CommandLine.h:146
void commandMaintainList(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:992
CommandSyntax * findUniqueSyntax(char *buffer, int len, bool &anyMatch)
Return unique syntax that buffer matches unique keyword.
ConfigSetMode
Definition: CommandLine.h:132
Supervisor & supervisor_
Definition: CommandLine.h:303
void initialize()
Provide a space for initialization before being run.
Definition: CommandLine.cpp:1638
void commandShowBest(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1411
void commandRestartHardware(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1197
void commandMaintainInvalid(ParsedCommand *parsedCommand, SyncComponent::CycleOrder cycleOrder)
Definition: CommandLine.cpp:975
A simple pthread Mutex abstraction.
Definition: Mutex.h:20
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
Definition: CommandLine.h:171
bool cmdQueued_
Definition: CommandLine.h:316
Definition: CommandLine.h:143
Mutex scheduleMutex_
Definition: CommandLine.h:313
void commandHelp(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:810
void commandMaintainUnavailable(ParsedCommand *parsedCommand, SyncComponent::CycleOrder cycleOrder)
Definition: CommandLine.cpp:958
void commandIbitMcp3553(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:842
void commandReportAdd(ParsedCommand *parsedCommand, ReportAddMode mode)
Definition: CommandLine.cpp:1058
void commandIbit(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:830
static void CommandSchedule(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1317
static void CommandMaintainClear(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:944
void commandQuick(ParsedCommand *parsedCommand, QuickMode mode)
Definition: CommandLine.cpp:1020
Definition: CommandLine.h:152
Definition: CommandLine.h:120
char doBuffer_[1024]
Definition: CommandLine.h:321
static void CommandGFscan(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:794
void commandSchedulePause(Syslog::Severity schedulePauseSeverity, Timestamp pauseTime)
static void CommandIbitMcp3553(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:838
static void CommandRun(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1297
static void CommandLoad(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:902
Contains the OutStream class declaration.
Timestamp burnStopTime_
Definition: CommandLine.h:320
void commandConversation(ParsedCommand *parsedCommand, ConversationMode mode)
Definition: CommandLine.cpp:552
struct termios newTermios_
Definition: CommandLine.h:302
void backspace()
Definition: CommandLine.cpp:1833
Definition: CommandLine.h:157
Definition: CommandLine.h:156
Str doSbd_
Definition: CommandLine.h:323
Definition: CommandLine.h:127
Provides a simple command line interface to the LRAUV.
Definition: CommandLine.h:38
Definition: CommandLine.h:196
void flush()
Definition: CommandLine.cpp:1726
static void CommandShowComponent(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1446
Definition: CommandLine.h:189
void commandRestartApplication(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1162
void commandRestartSystem(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1208
void completeArg(char *buffer, int len)
Normally called in response to a tab keypress.
Definition: CommandLine.cpp:1802
Definition: CommandLine.h:170
Contains the StrValue class definition.
UniversalDataReader * platformConversationReader_
Definition: CommandLine.h:340
static void CommandRestart(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1139
void commandShowState(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1547
void commandShowComponent(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1450
virtual bool isWritable()
indicates whether the stream can actually be written to.
Definition: CommandLine.cpp:1704
static Mutex QueueCommandMutex_
Definition: CommandLine.h:335
static void CommandShowBest(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1407
void commandRestartLogs(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1203
static void CommandMaintainAdd(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:921
These are enumerated to simplify sorting and ordering.
Definition: SyncComponent.h:42
static const size_t MAX_HOST_NAME_SIZE
Definition: CommandLine.h:307
CommandLine(Supervisor &supervisor)
Definition: CommandLine.cpp:57
ReportAddMode
Definition: CommandLine.h:167
Definition: CommandLine.h:169
Definition: CommandLine.h:164
static void CommandResume(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1237
void commandBurn(ParsedCommand *parsedCommand, BurnMode mode)
Definition: CommandLine.cpp:400
Definition: CommandLine.h:177
char hostname_[MAX_HOST_NAME_SIZE]
Definition: CommandLine.h:308
bool haveTermios_
Definition: CommandLine.h:300
static char OutputBuffer_[BUFF_SIZE]
Definition: CommandLine.h:291
void commandLoad(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:906
Replacement for standard template class string.
Definition: Str.h:12
void getLines()
Definition: CommandLine.cpp:1951
static void CommandShowVariable(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1553
static char ConsoleBuffer_[BUFF_SIZE]
Definition: CommandLine.h:289
size_t doBytes_
Definition: CommandLine.h:322
Definition: CommandLine.h:163
void commandScheduleShowPaused()
QuickMode
Definition: CommandLine.h:160
static void CommandReportClear(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1101
static void CommandBurn(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:396
static void CommandQuick(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1016
void run()
The actual "payload" of the component.
Definition: CommandLine.cpp:1645
void commandConfigSet(ParsedCommand *parsedCommand, ConfigSetMode mode)
Definition: CommandLine.cpp:432
static char QueuedCommand_[BUFF_SIZE]
Definition: CommandLine.h:334
FailComponentMode
Definition: CommandLine.h:140
void commandScheduleResume()
void commandRestart(ParsedCommand *parsedCommand, RestartType mode)
Definition: CommandLine.cpp:1143
static void CommandConfigSet(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:428
void commandGFscan(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:798
struct termios originalTermios_
Definition: CommandLine.h:301
ConversationMode
Definition: CommandLine.h:125
FailVariableMode
Definition: CommandLine.h:150
Contains the Mutex, ThreadCondition, and MutexLocker class declarations.
static void CommandShowDependencies(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1485
void clearParsed()
Definition: CommandLine.cpp:1941
Abstract Base class for software components that run independently from the computation cycle...
Definition: AsyncComponent.h:20
virtual ~CommandLine()
Definition: CommandLine.cpp:1625
void commandQuit(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1047
Contains the FastMap class declaration.
Definition: Command.h:188
bool findSyntax(char *buffer, int len)
If the buffer equals a unique syntax keyword, set parsedSyntax_ to that syntax.
static void DoCommand(const char *command, bool forceRun)
Definition: CommandLine.cpp:1658
void uninitialize()
Provide a space for uninitialization.
Definition: CommandLine.cpp:1655
Command & addCommand(const char *keyword, const char *description, bool advanced=false)
Definition: CommandLine.h:85
char * nextWord(char **line)
Definition: CommandLine.cpp:2104
BurnMode
Definition: CommandLine.h:118
static const Timespan BANG_TIMEOUT
Definition: CommandLine.h:298
static void CommandShowStack(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1533
Definition: CommandLine.h:184
static void CommandMaintainRemove(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:998
Definition: CommandLine.h:195
RetransmitType
Definition: CommandLine.h:182
int parsedCommandCount_
Definition: CommandLine.h:83
static int OutputIndex_
Definition: CommandLine.h:292
Definition: CommandLine.h:128
static void CommandMaintainInvalid(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:971
Definition: Command.h:292
bool parseBufferEnd()
If the last word in buffer is a valid arg, deal with it.
Definition: CommandLine.cpp:1757
void commandRetransmit(ParsedCommand *parsedCommand, RetransmitType retransmitType)
Definition: CommandLine.cpp:1261
static void CommandGet(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:756
Severity
An attempt to define different levels of syslog severity.
Definition: Syslog.h:28
Definition: CommandLine.h:191
static void DoScheduleResume()
Definition: CommandLine.cpp:1680
void setChar(const char theChar)
Definition: CommandLine.cpp:1891
RestartType
Definition: CommandLine.h:174
static void CommandRetransmit(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1256
virtual OutStream & write(const char *buffer, size_t num)
writes num bytes from buffer to the output buffer/stream
Definition: CommandLine.cpp:1710
static void DoScheduled()
Definition: CommandLine.cpp:1692
This is a very abstract class that can be implemented by classes that want to send stream output...
Definition: OutStream.h:41
FILE * out_
Definition: CommandLine.h:305
Definition: CommandLine.h:179
Definition: CommandLine.h:194
Contains the Timestamp and Timespan class declarations.
static bool AtMode_
Definition: CommandLine.h:296
The supervisor is the "main" component in the vehicle software.
Definition: Supervisor.h:65
static void CommandMaintainUnavailable(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:954
static void CommandIbit(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:826
static void CommandReportRemove(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1121
void commandReportList(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1115
void completeSyntax(char *buffer, int len)
Normally called in response to a tab keypress.
DataReader * ibitRunningReader_
Definition: CommandLine.h:338
static void CommandFailVariable(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:669
Definition: CommandLine.h:145
Definition: CommandLine.h:134
void commandShowDependencies(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1489
void commandGet(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:760
FILE * getOutFile()
Definition: CommandLine.h:71
static int InputIndex_
Definition: CommandLine.h:290
Definition: CommandLine.h:137
bool gettingLines_
Definition: CommandLine.h:315
Definition: CommandLine.h:147
size_t cmdHistoryIndex_
Definition: CommandLine.h:311
static CommandLine * Instance_
Definition: CommandLine.h:336
static void CommandFailComponent(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:599
Wraps a string (see Str) as a DataValue, so strings can be written to and read from the slate...
Definition: StrValue.h:34
Definition: CommandLine.h:155
void commandFailVariable(ParsedCommand *parsedCommand, FailVariableMode mode)
Definition: CommandLine.cpp:673
void commandStop(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1619
Definition: CommandLine.h:129
static void CommandReportList(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1111
Contains the Command class declaration.
static void CommandQuit(ParsedCommand *parsedCommand, int mode)
Definition: CommandLine.cpp:1043
void commandSet(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1366
Definition: CommandLine.h:162
void clearLine()
Definition: CommandLine.cpp:1843
void setLine(const char *line, bool allowExec)
Definition: CommandLine.cpp:1851
Represents absolute times.
Definition: Timestamp.h:31
void commandBang(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:336
Definition: CommandLine.h:153
void commandShowVariable(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:1557
Definition: CommandLine.h:135
StrValue keyText_
Definition: CommandLine.h:318
void commandDo(ParsedCommand *parsedCommand)
Definition: CommandLine.cpp:576
Contains the AsyncComponent class definition.