File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,25 +57,28 @@ String ArduinoOTAClass::getHostname() {
5757}
5858
5959ArduinoOTAClass &ArduinoOTAClass::setPassword (const char *password) {
60- if (!_initialized && !_password. length () && password) {
60+ if (_state == OTA_IDLE && password) {
6161 MD5Builder passmd5;
6262 passmd5.begin ();
6363 passmd5.add (password);
6464 passmd5.calculate ();
65+ _password.clear ();
6566 _password = passmd5.toString ();
6667 }
6768 return *this ;
6869}
6970
7071ArduinoOTAClass &ArduinoOTAClass::setPasswordHash (const char *password) {
71- if (!_initialized && !_password.length () && password) {
72+ if (_state == OTA_IDLE && password) {
73+ _password.clear ();
7274 _password = password;
7375 }
7476 return *this ;
7577}
7678
7779ArduinoOTAClass &ArduinoOTAClass::setPartitionLabel (const char *partition_label) {
78- if (!_initialized && !_partition_label.length () && partition_label) {
80+ if (_state == OTA_IDLE && partition_label) {
81+ _partition_label.clear ();
7982 _partition_label = partition_label;
8083 }
8184 return *this ;
You can’t perform that action at this time.
0 commit comments