Also got udp broadcast messages working.
I noticed it takes a few seconds after calling lwipinit() until the driver is truly ready. If my app does not wait, the sendto() never succeeds.
Since open-loop sleeps are risky, I wrote a little wrapper around netif_is_link_up(), in lwipthread.c:
Code: Select all
bool lwipReady() {
return netif_is_link_up(&thisif);
}
in my app I then call:
Code: Select all
lwipInit(nullptr);
while (!lwipReady()) {
chThdSleepMilliseconds(50);
}
Is there already a way of checking if the driver is ready?