OVMS3-idf/components/tcp_transport/transport_utils.c
David Cermak 23345d2021 MQTT: Integrate esp-mqtt library into idf
added docs and tests for mqtt library, small fixes (removed warnings, option for custom outbox, websocket bug fixed for longer transports). refactored to use common tcp_transport component, support for CMake build system.
Closes #2108
2018-09-12 08:00:59 +02:00

13 lines
No EOL
300 B
C

#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "transport_utils.h"
void transport_utils_ms_to_timeval(int timeout_ms, struct timeval *tv)
{
tv->tv_sec = timeout_ms / 1000;
tv->tv_usec = (timeout_ms - (tv->tv_sec * 1000)) * 1000;
}