26 lines
589 B
C++
26 lines
589 B
C++
#ifndef SDRPI_FPV_CONTROL_GROUND_PORT_UART_H
|
|
#define SDRPI_FPV_CONTROL_GROUND_PORT_UART_H
|
|
#include <cstdint>
|
|
|
|
#include "port/poller.h"
|
|
#include <string>
|
|
#include <vector>
|
|
#include <span>
|
|
|
|
namespace drivers {
|
|
class UartDriver : public poller::PollObject {
|
|
public:
|
|
UartDriver(const std::string& path, int baud);
|
|
bool writeData(std::span<const uint8_t> data);
|
|
size_t readChunk(std::vector<uint8_t>& out);
|
|
~UartDriver() override;
|
|
|
|
#if _WIN32
|
|
protected:
|
|
OVERLAPPED overlapped{};
|
|
#endif
|
|
};
|
|
}
|
|
|
|
#endif //SDRPI_FPV_CONTROL_GROUND_PORT_UART_H
|