256dpi / arduino-mqtt

MQTT library for Arduino
MIT License
1.02k stars 236 forks source link

setOptions non-optional parameters #185

Closed mcspr closed 4 years ago

mcspr commented 4 years ago

Hey,

When using setOptions for just keepalive setting, it is also required to change cleanSession and timeout: https://github.com/256dpi/arduino-mqtt/blob/5d6d29ef5e7c570acd7922f10931039c43b11423/src/MQTTClient.h#L82 https://github.com/256dpi/arduino-mqtt/blob/5d6d29ef5e7c570acd7922f10931039c43b11423/src/MQTTClient.h#L40-L42

While I can reference the source and see default values, perhaps those should be optional parameters or separate methods for each option? I would guess having any way to get existing values (through methods or directly) would also solve this, as one could just pass those as arguments.