Feature request and bug report

11 Sep 2012

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

11 Sep 2012

Logged, thanks!

06 Aug 2018

Hello mbed team,

Assertion will occur if the following code is executed. It seems to be a problem to use PC5 for AD input. Just creating an instance does not matter. An assertion is generated when AD conversion is executed using that instance.

Assert message are: ++ MbedOS Error Info ++ Error Status: 0x80010130 Code: 304 Module: 1 Error Message: pinmap not found for peripheral

Board is: Nucleo F302R8

Code is: AnalogIn ADC_foo(PC_5); var = ADC_foo.read_u16();