Files
sdrpi-fpv-control/lib/port/udp.h

21 lines
586 B
C++

#ifndef SDRPI_FPV_CONTROL_GROUND_PORT_UDP_H
#define SDRPI_FPV_CONTROL_GROUND_PORT_UDP_H
#include "port/poller.h"
#include <string>
#include <vector>
#include <cstdint>
#include <span>
namespace drivers {
class UdpDriver : public poller::PollObject {
public:
// port - локальный порт
explicit UdpDriver(uint16_t port);
bool sendTo(std::span<const uint8_t> data, const std::string& addr, uint16_t port);
bool recvPacket(std::vector<uint8_t>& out);
~UdpDriver() override;
};
}
#endif //SDRPI_FPV_CONTROL_GROUND_PORT_UDP_H