FactbirdHQ / mqttrust

MQTT client for embedded devices, written in rust
50 stars 5 forks source link

Switch timers to use embedded-time #10

Closed MathiasKoch closed 3 years ago

MathiasKoch commented 4 years ago

Currently we rely on a timer implementing embedded_hal::Countdown for keeping track of keep-alive, but this means that we cannot use the same timer for retry handling, as there is no way of obtaining the current timer value, rather than just checking if it has reached the timeout value.

Replacing the Countdown requirement with a Clock from https://github.com/FluenTech/embedded-time/, allows us to use a single timer for multiple things, including keep-alive, packet timeout, retry and delays.

This will make it much easier to approach #7, #3 and #6