Skip to content

Commit c50d6ff

Browse files
committed
Merge pull request #2048 from hotchpotch/ota-gethostname
Add ArduinoOTA::getHostname() interface
2 parents a2d3649 + cffdd55 commit c50d6ff

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libraries/ArduinoOTA/ArduinoOTA.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ void ArduinoOTAClass::setHostname(const char * hostname) {
7777
}
7878
}
7979

80+
String ArduinoOTAClass::getHostname() {
81+
return _hostname;
82+
}
83+
8084
void ArduinoOTAClass::setPassword(const char * password) {
8185
if (!_initialized && !_password.length() && password) {
8286
_password = password;

libraries/ArduinoOTA/ArduinoOTA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ArduinoOTAClass
3131
~ArduinoOTAClass();
3232
void setPort(uint16_t port);
3333
void setHostname(const char *hostname);
34+
String getHostname();
3435
void setPassword(const char *password);
3536
void onStart(OTA_CALLBACK(fn));
3637
void onEnd(OTA_CALLBACK(fn));

0 commit comments

Comments
 (0)