Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hello mbed team,
Feature request, please add
int set_broadcast(bool bBroadcast = true) { int val = (bBroadcast != 0); return lwip_setsockopt(_sock_fd,SOL_SOCKET,SO_BROADCAST,&val,sizeof(val)); }to UDPSocket
Also, bug ?
Endpoint ep; ep.set_address("255.255.255.255",0);set_address fails with a return value of -1, but
class Endpoint2 : public Endpoint { public: int set_address(uint32_t ip, uint16_t port) { reset_address(); _remoteHost.sin_addr.s_addr = htonl(ip); _remoteHost.sin_family = AF_INET; _remoteHost.sin_port = htons(port); return 0; } }; Endpoint2 ep ep.set_address(0xFFFFFFF,0);works as expected when used with UDPSocket.set_broadcast()
Thanks