Exemple #1
0
/**
 * @brief This function takes care of one command line once we have it
 */
void handleConsoleLine(char *line) {
	line = validateSecureLine(line);
	if (line == NULL)
		return; // error detected

	int lineLength = strlen(line);
	if (lineLength > 100) {
		// todo: better max size logic
		// todo: better reaction to excessive line
		print("Long line?\r\n");
		return;
	}

	strcpy(confirmation, "confirmation_");
	strcat(confirmation, line);
	strcat(confirmation, ":");

#if EFI_PROD_CODE || EFI_SIMULATOR
	sendOutConfirmation(confirmation, lineLength);
#endif

	bool isKnownComman = handleConsoleLineInternal(line, lineLength);

	if (!isKnownComman) {
		scheduleMsg(logging, "unknown [%s]", line);
		helpCommand();
	}
}
Exemple #2
0
/**
 * @brief This function takes care of one command line once we have it
 */
void handleConsoleLine(char *line) {
	line = validateSecureLine(line);
	if (line == NULL)
		return; // error detected

	int lineLength = strlen(line);
	if (lineLength > 100) {
		// todo: better max size logic
		// todo: better reaction to excessive line
		print("Long line?\r\n");
		return;
	}

	strcpy(confirmation, "confirmation_");
	strcat(confirmation, line);
	strcat(confirmation, ":");

	bool_t isKnownComman = handleConsoleLineInternal(line, lineLength);

	// confirmation happens after the command to avoid conflict with command own output
	sendOutConfirmation(confirmation, lineLength);

	if (!isKnownComman)
		helpCommand();
}