#ifndef _COMM_UART_H_
#define _COMM_UART_H_

#include "myComm.h"
#include "comm.h"

typedef struct 
{
    stru_uart_para *p_para;
    int uart_fd;

    CommDebugShow debug_show;

    comm_state_cb state_cb;
    comm_recv_cb recv_cb;
    comm_debug_show_cb debug_show_cb;

    int (*uart_state_register)(void *p_this, comm_state_cb cb);
    int (*uart_recv_register)(void *p_this, comm_recv_cb cb);
    int (*uart_debug_show_register)(void *p_this, comm_debug_show_cb cb);

    int (*uart_connect)(int id,  void *p_this);

    int (*uart_send)(void *p_this, const uint8_t *tx, uint16_t tx_len);

    int (*uart_close)(void *p_this);
}stru_comm_uart;

int comm_uart_create(stru_comm_uart *p_uart);

#endif /* _COMM_UART_H_ */