#ifndef SDRPI_FPV_CONTROL_GROUND_UDP_DRIVER_H #define SDRPI_FPV_CONTROL_GROUND_UDP_DRIVER_H #include #include #include #ifdef _WIN32 #include #include #pragma comment(lib, "ws2_32.lib") #else #include #include #include #include #endif class UDPSocket { public: UDPSocket(const std::string& ip, uint16_t port); ~UDPSocket(); bool sendFrame(const std::vector& data); private: #ifdef _WIN32 SOCKET sockfd; WSADATA wsaData; #else int sockfd; #endif sockaddr_in dest_addr; bool initialize(); }; #endif //SDRPI_FPV_CONTROL_GROUND_UDP_DRIVER_H