#ifndef __SYSTEM_TC_H__
#define __SYSTEM_TC_H__

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>           // close()
#include <string.h>           // strcpy, memset(), and memcpy()
#include <stdarg.h>
#include <errno.h>            // errno, perror()
#include <stdbool.h>
#include <pthread.h>
#include <semaphore.h>
#include <math.h>
#include <dirent.h> 
#include <fcntl.h>
#include <signal.h>
#include <getopt.h>
#include <termios.h>
#include <netdb.h>            // struct addrinfo
#include <sys/stat.h>
#include <sys/ioctl.h>        // macro ioctl is defined
#include <bits/ioctls.h>      // defines values for argument "request" of ioctl.
#include <sys/syscall.h>
#include <sys/types.h>        // needed for socket(), uint8_t, uint16_t, uint32_t
#include <sys/select.h>
#include <sys/socket.h>       // needed for socket()
#include <sys/time.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <libgen.h>
#include <netinet/in.h>       // IPPROTO_ICMP, INET_ADDRSTRLEN
#include <netinet/ip.h>       // struct ip and IP_MAXPACKET (which is 65535)
#include <netinet/ip_icmp.h>  // struct icmp, ICMP_ECHO
#include <arpa/inet.h>        // inet_pton() and inet_ntop()
#include <net/if.h>           // struct ifreq
#include <net/ethernet.h>
#include <linux/if_ether.h>   // ETH_P_IP = 0x0800, ETH_P_IPV6 = 0x86DD
#include <linux/if_packet.h>  // struct sockaddr_ll (see man 7 packet)
#include <linux/serial.h>
#include <linux/can.h>
#include <linux/can/raw.h>

#include "logger.h"

int64_t systime_ms(void);

char* format_local_time(char* buff, int bsize);

char* format_utc_time(char* buff, int bsize);

int printline(const char* title, uint8_t* buff, int len);

void msleep(int milliseconds);

void dumpReg2String(uint8_t *dst, uint16_t *src, int N);

void dumpString2Reg(uint16_t *dst, uint8_t *src, int N);

#endif//__SYSTEM_TC_H__
