diff --git a/lib/APPTurtle/src/App.cpp b/lib/APPTurtle/src/App.cpp index 0c1c9ab4..ef77fa05 100644 --- a/lib/APPTurtle/src/App.cpp +++ b/lib/APPTurtle/src/App.cpp @@ -109,7 +109,8 @@ void App::setup() /* If the robot name is empty, use the wifi MAC address as robot name. */ if (true == settings.getRobotName().isEmpty()) { - String robotName = WiFi.macAddress(); + String robotName("MAC"); + robotName += WiFi.macAddress(); /* Remove MAC separators from robot name. */ robotName.replace(":", ""); diff --git a/lib/MainNative/src/main.cpp b/lib/MainNative/src/main.cpp index 112f19d1..d8c00a64 100644 --- a/lib/MainNative/src/main.cpp +++ b/lib/MainNative/src/main.cpp @@ -33,6 +33,7 @@ * Includes *****************************************************************************/ +#include #include #include #include @@ -111,6 +112,7 @@ static const struct option LONG_OPTIONS[] = {{"help", no_argument, nullptr, 0}, {"xPosition", required_argument, nullptr, 0}, {"yPosition", required_argument, nullptr, 0}, {"heading", required_argument, nullptr, 0}, + {"cwd", required_argument, nullptr, 0}, {nullptr, no_argument, nullptr, 0}}; /* Marks the end. */ /** Program argument default value of the robot name. */ @@ -377,6 +379,10 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char { prgArguments.heading = optarg; } + else if (0 == strcmp(LONG_OPTIONS[optionIndex].name, "cwd")) + { + chdir(optarg); + } else { status = -1; @@ -433,6 +439,7 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char printf(" Default: %s\n", PRG_ARG_Y_POS); /* Initial Y position default value */ printf("\t--heading \t\tSet initial heading in mrad."); /* Initial heading in mrad */ printf(" Default: %s\n", PRG_ARG_HEADING); /* Initial heading default value */ + printf("\t--cwd \t\tSpecify working directory."); /* Set process working directory */ } return status;