Skip to content

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.

1 participant