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

More accurately determine if MQTT uses the default server #5663

Merged
merged 3 commits into from
Dec 25, 2024

Conversation

esev
Copy link
Contributor

@esev esev commented Dec 24, 2024

This avoids needing to use strcmp each time a packet is sent as well.

Tested with the following values for moduleConfig.mqtt.address:

  • An empty string (isDefaultMqttServer=true)
  • mqtt.meshtastic.org (isDefaultMqttServer=true)
  • mqtt.meshtastic.org:1883 (isDefaultMqttServer=true)
  • 192.168.1.10:1883 (isDefaultMqttServer=false)

@fifieldt
Copy link
Contributor

Is it worth also adding this to Channels.cpp ( Channels::anyMqttEnabled() ) to keep it consistent across the code base?

@esev
Copy link
Contributor Author

esev commented Dec 24, 2024

Nice catch! It makes sense to me.

I checked all the callers of Channels::anyMqttEnabled(), and they each checked to see that mqtt was valid too (or the caller was MQTT). So I don't expect the behavior to change by adding the same mqtt && check inside Channels::anyMqttEnabled().

@thebentern thebentern merged commit a7d9e81 into meshtastic:master Dec 25, 2024
48 checks passed
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.

3 participants