esp_transport_utils_ms_to_timeval() function
Convert milliseconds to timeval struct for valid timeouts, otherwise (if "wait forever" requested by timeout_ms=-1) timeval structure is not updated and NULL returned
Syntax
struct timeval* esp_transport_utils_ms_to_timeval(int timeout_ms,
struct timeval *tv);
Arguments
timeout_ms
The timeout value in milliseconds or -1 to waiting forever
tv
Pointer to timeval struct
Return value
- NULL if timeout_ms=-1 (wait forever) - pointer to the updated timeval structure (provided as "tv" argument) with recalculated timeout value