Allow multiple command per line separated by ;
This commit is contained in:
@@ -384,8 +384,15 @@ void loop()
|
|||||||
last_cmd=cmd;
|
last_cmd=cmd;
|
||||||
|
|
||||||
if (cmd.substr(0,3)!="set") replaceVars(cmd);
|
if (cmd.substr(0,3)!="set") replaceVars(cmd);
|
||||||
|
|
||||||
while(cmd.length())
|
while(cmd.length())
|
||||||
{
|
{
|
||||||
|
std::string cmd_end;
|
||||||
|
if (cmd.find(';') != std::string::npos)
|
||||||
|
{
|
||||||
|
cmd_end = cmd;
|
||||||
|
cmd = getword(cmd_end,"",';');
|
||||||
|
}
|
||||||
MqttError retval = MqttOk;
|
MqttError retval = MqttOk;
|
||||||
|
|
||||||
std::string s;
|
std::string s;
|
||||||
@@ -619,7 +626,7 @@ void loop()
|
|||||||
Serial << "IP: " << WiFi.localIP() << endl;
|
Serial << "IP: " << WiFi.localIP() << endl;
|
||||||
else if (compare(s,"help"))
|
else if (compare(s,"help"))
|
||||||
{
|
{
|
||||||
Serial << "syntax:" << endl;
|
Serial << "syntax: instr; instr; ..." << endl;
|
||||||
Serial << " MqttBroker:" << endl;
|
Serial << " MqttBroker:" << endl;
|
||||||
Serial << " broker {name} {port} : create a new broker" << endl;
|
Serial << " broker {name} {port} : create a new broker" << endl;
|
||||||
Serial << endl;
|
Serial << endl;
|
||||||
@@ -654,6 +661,11 @@ void loop()
|
|||||||
{
|
{
|
||||||
Serial << "## ERROR " << retval << endl;
|
Serial << "## ERROR " << retval << endl;
|
||||||
}
|
}
|
||||||
|
if (cmd_end.length())
|
||||||
|
{
|
||||||
|
cmd = cmd_end;
|
||||||
|
cmd_end = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user