Skip to content

Commit

Permalink
imlemented setting name, unit and password via serial. implements #317
Browse files Browse the repository at this point in the history
  • Loading branch information
psy0rz committed Jul 16, 2017
1 parent 2b567f5 commit d49a91c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,24 @@ void ExecuteCommand(byte source, const char *Line)
success = true;
}

if (strcasecmp_P(Command, PSTR("Unit")) == 0)
{
success = true;
Settings.Unit=Par1;
}

if (strcasecmp_P(Command, PSTR("Name")) == 0)
{
success = true;
strcpy(Settings.Name, Line + 5);
}

if (strcasecmp_P(Command, PSTR("Password")) == 0)
{
success = true;
strcpy(SecuritySettings.Password, Line + 9);
}


if (strcasecmp_P(Command, PSTR("Reboot")) == 0)
{
Expand Down Expand Up @@ -521,6 +539,7 @@ void ExecuteCommand(byte source, const char *Line)
sprintf_P(str, PSTR("%u.%u.%u.%u"), ip[0], ip[1], ip[2], ip[3]);
Serial.print(F(" IP Address : ")); Serial.println(str);
Serial.print(F(" Build : ")); Serial.println((int)BUILD);
Serial.print(F(" Name : ")); Serial.println(Settings.Name);
Serial.print(F(" Unit : ")); Serial.println((int)Settings.Unit);
Serial.print(F(" WifiSSID : ")); Serial.println(SecuritySettings.WifiSSID);
Serial.print(F(" WifiKey : ")); Serial.println(SecuritySettings.WifiKey);
Expand Down

0 comments on commit d49a91c

Please sign in to comment.