Improve:UartDevice include cleaner.

This commit is contained in:
Fancy code 2024-06-17 14:54:45 +08:00
parent d9dfbd5f9a
commit cc98adc8fe
2 changed files with 11 additions and 2 deletions

View File

@ -16,6 +16,9 @@
#include "ILog.h" #include "ILog.h"
#include "StatusCode.h" #include "StatusCode.h"
#include "UartDeviceImpl.h" #include "UartDeviceImpl.h"
#include <cstddef>
// #include <sys/types.h>
void *CreateUartDevice(const UartInfo info) void *CreateUartDevice(const UartInfo info)
{ {
return NewUartDeviceImpl(info); return NewUartDeviceImpl(info);

View File

@ -15,15 +15,21 @@
#include "UartDeviceImpl.h" #include "UartDeviceImpl.h"
#include "ILog.h" #include "ILog.h"
#include "LinuxApi.h" #include "LinuxApi.h"
#include "StatusCode.h"
#include "UartDevice.h"
#include <chrono>
#include <cstddef>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <memory>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/select.h>
// #include <sys/time.h>
#include <termios.h> #include <termios.h>
#include <thread> #include <thread>
#include <unistd.h> #include <unistd.h>
constexpr int INVALID_FD = -1; constexpr int INVALID_FD = -1;
static const char *UART_DEVICE_NAME = "uart_device"; static const char *UART_DEVICE_NAME = "uart_device";
const char *GetUartDeviceModuleName(void) const char *GetUartDeviceModuleName(void)