Update serial info

This commit is contained in:
George Fu
2020-04-21 17:26:40 +08:00
parent 0cea8d6ba9
commit 8d9dea5f3e
3 changed files with 26 additions and 8 deletions

View File

@@ -102,7 +102,8 @@ void Gcode::get_serial_commands() {
void Gcode::gcode_M50() {
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
config.ssid(parser.string_arg);
SERIAL_ECHO(config.ssid());
SERIAL_ECHO("ssid:");
SERIAL_ECHOLN(config.ssid());
}
/**
@@ -111,7 +112,8 @@ void Gcode::gcode_M50() {
void Gcode::gcode_M51() {
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
config.password(parser.string_arg);
SERIAL_ECHO(config.password());
SERIAL_ECHO("password:");
SERIAL_ECHOLN(config.password());
}
/**
@@ -119,8 +121,11 @@ void Gcode::gcode_M51() {
*/
void Gcode::gcode_M52() {
if(!network.start()) {
SERIAL_ECHOLN("");
SERIAL_ECHOLN("Connect fail, please set the wifi config and connect again");
SERIAL_ECHOLN("- M50: Set the wifi ssid , 'M50 ssid-name'");
SERIAL_ECHOLN("- M51: Set the wifi password , 'M51 password'");
SERIAL_ECHOLN("- M52: Start to connect the wifi");
SERIAL_ECHOLN("- M53: Check the connection status");
}
}
@@ -130,7 +135,10 @@ void Gcode::gcode_M52() {
void Gcode::gcode_M53() {
if(WiFi.status() != WL_CONNECTED) {
SERIAL_ECHOLN("Wifi not connected");
SERIAL_ECHOLN("Please set the wifi ssid with M50 and password with M51 , and start connection with M52");
SERIAL_ECHOLN("- M50: Set the wifi ssid , 'M50 ssid-name'");
SERIAL_ECHOLN("- M51: Set the wifi password , 'M51 password'");
SERIAL_ECHOLN("- M52: Start to connect the wifi");
SERIAL_ECHOLN("- M53: Check the connection status");
}
else {
SERIAL_ECHOLN("");