#ifndef SERIAL_DRIVER_H
#define SERIAL_DRIVER_H

#include "commands.h"
#include "payload_specs.h"
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdint.h>
#include <string.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>

enum com_state { IDLE, COM_SENT, COM_RECEIVED };

extern unsigned char com_buf[buf_size];
extern int com_buf_len;

extern int init_comm(const char *);
extern void close_comm();
extern int sendCom();

extern void IMU_DATA_PUBLISH(unsigned char *);
extern void ODOM_DATA_PUBLISH(unsigned char *);

extern void set_CB(void (*)(unsigned char *));
#endif
