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

Make MQTT_KEEPALIVE modifiable at runtime #175

Closed
richjoyce opened this issue Jun 30, 2016 · 2 comments
Closed

Make MQTT_KEEPALIVE modifiable at runtime #175

richjoyce opened this issue Jun 30, 2016 · 2 comments

Comments

@richjoyce
Copy link

It's well known that the Arduino IDE doesn't support changing defines at compile time in libraries. Issue #110 addresses this for another define, but I think the cons brought up in that conversation don't apply to the MQTT_KEEPALIVE define. It is only used in connect so I believe this would be simple to add as an optional argument to connect, and wouldn't take up any additional memory space.

I'm happy to submit a PR if this would theoretically get accepted.

This argument also mostly applies to MQTT_SOCKET_TIMEOUT, but it would need to be stored in the class for readByte to use it. I could make this change at the same time.

@knolleary
Copy link
Owner

Agreed - making this dynamic is a significantly smaller overhead than the buffer size.

Happy to look at a PR for it

@knolleary
Copy link
Owner

Have just pushed a fix that adds setKeepAlive. Thanks for proposing this change - sorry it took so long to come to a resolution.

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

No branches or pull requests

2 participants