Skip to content
CreativeRobotics edited this page Mar 4, 2020 · 21 revisions

Welcome to the Commander wiki!

Commander API:


Constructor and update

Commander()

begin()

update()


Configuration

setBuffer()

printCommandPrompt()

setCommentChar(char cmtChar)

setReloadChar(char reloadChar)

setEndOfLineChar(char eol)

setPromptChar(char eol)

echo(bool sState)

printComments(bool cState)

echoToAlt(bool sState)

copyRepyAlt(bool sState)

commandProcessor(bool state)

commandProcessor()

stripCR(bool sState)

stripCR()

multiCommander(bool enable)

multiCommander()

errorMessages(bool state)

errorMessages()

commandPrompt(bool state)

commandPrompt()

showHelp(bool state)

showHelp()

internalCommands(bool state)

internalCommands()

showInternalCommands(bool state)

showInternalCommands()

cmdSettings_t getSettings()

setSettings(cmdSettings_t newSet)

portSettings_t getPortSettings()

setPortSettings(portSettings_t newPorts)

printDiagnostics()

autoChain(bool state)

autoChain()

autoChainErrors(bool state)

autoChainErrors()

setPrintDelay(uint8_t dTime)

getPrintDelay()

setDelimiters(String myDelims)

getDelimiters()

addDelimiter(char newDelim)


Payload processing

containsTrue()

containsFalse()

containsOn()

containsOff()

hasPayload()

getPayload()

getPayloadString()

getInt(iType &myIvar)

getFloat(float &myFloat)

getDouble(double &myDouble)

getString(String &myString)


Print methods

println()

print(printType printableVariable)

print(printType printableVariable, int fmt)

println(printType printableVariable)

println(printType printableVariable, int fmt)

write(printType printableVariable)

write(printType printableVariable, int length)


Locking

Commander can be locked and unlocked. If an optional passphrase is set then it must be used to unlock the command system.

There are two lock levels, soft or hard. A soft lock allows internal commands to be used and will print help data. A hard lock prevents all internal commands except the unlock command. HARD_LOCK and SOFT_LOCK are defined as macros for true and false.

setPassPhrase(String& phrase)

printPassPhrase()

lock()

unlock()

setLockType(bool hlState)

isLocked()

getLockType()


Reloading the buffer

feed(Commander& Cmdr)

feedString(String newString)

loadString(String newString)

endLine()


Switching between command lists

attachCommands(const commandList_t *commands, uint32_t size)

transfer(Commander& Cmdr)

transferTo(const commandList_t *commands, uint32_t size, String newName)

transferBack(const commandList_t *commands, uint32_t size, String newName)


File streaming and number commands

startStream()

stopStream()

setStream(bool streamState)

isStreaming()

attachSpecialHandler(cmdHandler handler)


Stream objects

attachOutputPort(Stream *oPort)

getOutputPort()

attachAltPort(Stream *aPort)

getAltPort()

attachInputPort(Stream *iPort)

getInputPort()

deleteAltPort()

attachDefaultHandler(cmdHandler handler)

setStreamType(streamType_t newType)

getStreamType()


Quick set and get system

quickSetHelp()

quickSet(String cmd, int& var)

quickSet(String cmd, float& var)

quickSet(String cmd, double& var)

quickGet(String cmd, int var)

quickGet(String cmd, float var)


Prefix and Postfix methods

setPrefix(String prfx)

startPrefix()

setPostfix(String pofx)

startFormatting()

setAutoFormat(bool state)

getAutoFormat()


Help system

getCommandListLength()

getCommandItem(uint16_t commandItem)

getInternalCommandLength()

getInternalCommandItem(uint8_t internalItem)

printCommandList()

printCommanderVersion()

Clone this wiki locally