1 #include <string.h> 2 #include <ctype.h> 3 #include <stdlib.h> 4 #include <stdio.h> 5 #include <assert.h> 6 7 #include "esp_transport_utils.h" 8 esp_transport_utils_ms_to_timeval(int timeout_ms,struct timeval * tv)9struct timeval* esp_transport_utils_ms_to_timeval(int timeout_ms, struct timeval *tv) 10 { 11 if (timeout_ms == -1) { 12 return NULL; 13 } 14 tv->tv_sec = timeout_ms / 1000; 15 tv->tv_usec = (timeout_ms - (tv->tv_sec * 1000)) * 1000; 16 return tv; 17 } 18