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

Add note about timer behavior #279

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/include/core_mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ struct MQTTDeserializedInfo;
* @note The timer should be a monotonic timer. It just needs to provide an
* incrementing count of milliseconds elapsed since a given epoch.
*
* @note As the timer is supposed to be a millisecond timer returning a 32-bit
* value, it will overflow in just under 50 days. But it will not cause any issues
* in the library as the time function is only used for calculating durations for
* timeouts and keep alive periods. The difference in unsigned numbers is
* used where unsigned wrap around is defined. Unless the timeout is bigger than
* 100 days (50*2) where the numbers can wrap around more than once the code
* should work properly.
*
* @return The time elapsed in milliseconds.
*/
typedef uint32_t (* MQTTGetCurrentTimeFunc_t )( void );
Expand Down
Loading