#pragma once #include "Participants/ParticipantUDP.h" #if defined(IDF_VER) #include "lwip/sockets.h" #endif namespace RoboidControl { namespace EspIdf { class ParticipantUDP : public RoboidControl::ParticipantUDP { public: void Setup(int localPort, const char* remoteIpAddress, int remotePort); void Receive(); bool Send(Participant* remoteParticipant, int bufferSize); bool Publish(IMessage* msg); protected: #if defined(IDF_VER) char broadcastIpAddress[INET_ADDRSTRLEN]; int sockfd; struct sockaddr_in dest_addr; struct sockaddr_in src_addr; #endif void GetBroadcastAddress(); }; } // namespace EspIdf } // namespace RoboidControl