Пример #1
0
void SerialConsole::handleConsoleCmd() {
	handlingEvent = true;

	if (state == STATE_ROOT_MENU) {
		if (ptrBuffer == 1) { //command is a single ascii character
			handleShortCmd();
		} else { //if cmd over 1 char then assume (for now) that it is a config line
			handleConfigCmd();
		}
	}
	handlingEvent = false;
}
Пример #2
0
void handleConsoleCmd() {
    if (ptrBuffer == 1)
    {   //command is a single ascii character
        handleShortCmd();
    }
    else //at least two bytes
    {
        boolean equalSign = false;
        for (int i = 0; i < ptrBuffer; i++) if (cmdBuffer[i] == '=') equalSign = true;
        if (equalSign) handleConfigCmd();
    }
    ptrBuffer = 0; //reset line counter once the line has been processed
}