71 switch( samplingState )
76 return "S_WAITING_INITIAL_PROMPT";
78 return "S_PREPARING_SHOW_LOG";
80 return "S_PREPARING_SHOW_STATUS";
82 return "S_LOADING_CARTRIDGE";
86 return "S_WAITING_FOR_PAUSED";
88 return "S_PROCESSING";
90 return "S_WAITING_FOR_PROCESSED";
98 return "(invalid SamplingState)";
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
bool isSampling()
Advances the sampling interactions.
Definition: ESPClient.cpp:108
void setDebug(bool debugOn)
Definition: ESPClient.h:127
void logError(Str msg)
Definition: ESPClient.cpp:519
Definition: ESPClient.h:63
const Timespan filterCompleteTimeout_
Definition: ESPClient.h:144
const Timespan stopResultTimeout_
Definition: ESPClient.h:147
Definition: ESPClient.h:65
void issueCommand(Str cmd, Timespan resultTimeout, Timespan completionTimeout=10)
Issues a command to the ESP, setting a timeout for the result and, optionally, a timeout for the "com...
Definition: ESPClient.cpp:323
void checkCmdResultTimeout(bool issueStop=true)
Definition: ESPClient.cpp:340
Core logic for interactions with the ESP.
Definition: ESPClient.h:22
Definition: ESPClient.h:64
Definition: ESPClient.h:60
int getLine(Str &line, ESPComm::EspStream &stream)
Expects next line from the ESP.
Definition: ESPClient.cpp:443
Definition: ESPClient.h:61
const char * samplingStateName(SamplingState samplingState)
Definition: ESPClient.h:69
const Timespan processResultTimeout_
Definition: ESPClient.h:145
bool startSampling()
Definition: ESPClient.cpp:80
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
const Timespan processCompleteTimeout_
Definition: ESPClient.h:146
Base socket-level interface to the ESP.
Definition: ESPComm.h:26
void logDebug(Str msg)
Definition: ESPClient.cpp:513
void checkCmdCompleteTimeout(bool issueStop=true)
Definition: ESPClient.cpp:360
bool debug_
Definition: ESPClient.h:149
Timespan cmdResultTimeout_
Definition: ESPClient.h:157
ESPComm class declaration.
const char * currentSamplingStateName()
Definition: ESPClient.h:107
Str samplingError_
Definition: ESPClient.h:162
Logger logger_
Definition: ESPClient.h:139
void handleException(bool awaitingResult, bool issueStop=true)
Definition: ESPClient.cpp:400
Str * latestResult_
Definition: ESPClient.h:165
Str issuedCmd_
Definition: ESPClient.h:155
SamplingState
Definition: ESPClient.h:53
Replacement for standard template class string.
Definition: Str.h:12
Definition: ESPClient.h:59
Str getSamplingError()
Definition: ESPClient.cpp:318
Definition: ESPClient.h:57
Definition: ESPClient.h:55
ESPClient(ESPComm &espComm, Logger &logger, Timespan initialPromptTimeout, Timespan loadCartridgeTimeout, Timespan filterResultTimeout, Timespan filterCompleteTimeout, Timespan processResultTimeout, Timespan processCompleteTimeout, Timespan stopResultTimeout)
Constructor.
Definition: ESPClient.cpp:36
Timespan cmdCompleteTimeout_
Definition: ESPClient.h:158
EspStream
the ESP virtual streams
Definition: ESPComm.h:169
bool isSuccessfulSampling()
Checks for successful completion once isSampling returns false.
Definition: ESPClient.cpp:313
const Timespan filterResultTimeout_
Definition: ESPClient.h:143
~ESPClient()
Destructor.
Definition: ESPClient.cpp:68
void advanceInteraction()
Definition: ESPClient.cpp:121
const Timespan initialPromptTimeout_
Definition: ESPClient.h:141
Str partialLine_
Definition: ESPClient.h:160
Timestamp startTimeForInitialPrompt_
Definition: ESPClient.h:153
Definition: ESPClient.h:62
Timestamp cmdIssueTime_
Definition: ESPClient.h:156
void issueStopCommand()
Definition: ESPClient.cpp:334
void consumeResult()
Definition: ESPClient.cpp:380
const Timespan loadCartridgeTimeout_
Definition: ESPClient.h:142
SamplingState samplingState_
Definition: ESPClient.h:151
Str * latestException_
Definition: ESPClient.h:168
Definition: ESPClient.h:56
Definition: ESPClient.h:66
void setError(Str error)
Definition: ESPClient.cpp:429
void logFault(Str msg)
Definition: ESPClient.cpp:525
SamplingState currentSamplingState()
Definition: ESPClient.h:102
Definition: ESPClient.h:58
Represents absolute times.
Definition: Timestamp.h:31
ESPComm & espComm_
Definition: ESPClient.h:137