File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,25 +57,28 @@ String ArduinoOTAClass::getHostname() {
57
57
}
58
58
59
59
ArduinoOTAClass &ArduinoOTAClass::setPassword (const char *password) {
60
- if (!_initialized && !_password. length () && password) {
60
+ if (_state == OTA_IDLE && password) {
61
61
MD5Builder passmd5;
62
62
passmd5.begin ();
63
63
passmd5.add (password);
64
64
passmd5.calculate ();
65
+ _password.clear ();
65
66
_password = passmd5.toString ();
66
67
}
67
68
return *this ;
68
69
}
69
70
70
71
ArduinoOTAClass &ArduinoOTAClass::setPasswordHash (const char *password) {
71
- if (!_initialized && !_password.length () && password) {
72
+ if (_state == OTA_IDLE && password) {
73
+ _password.clear ();
72
74
_password = password;
73
75
}
74
76
return *this ;
75
77
}
76
78
77
79
ArduinoOTAClass &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 ();
79
82
_partition_label = partition_label;
80
83
}
81
84
return *this ;
You can’t perform that action at this time.
0 commit comments