Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getters for IP, Domain, and Port. #996

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AdamJHowell
Copy link

I wanted a way to query the PubSubClient object, for cases where I attempt to connect to multiple different brokers with one PubSubClient object, and for cases where I have multiple PubSubClient objects which are passed around to helper functions.

This has been tested on an ESP32 WROOM with the following block:

if( mqttClient.connected() )
{
	Serial.print( "MQTT broker domain: " );
	Serial.println( mqttClient.getServerDomain() );
	Serial.print( "MQTT broker IP: " );
	Serial.println( mqttClient.getServerIP() );
	Serial.print( "MQTT broker port: " );
	Serial.println( mqttClient.getServerPort() );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant