Did you configure your MAC to receive multicasts/boradcasts? lwIP cannot do this!
Ciao Dirk On Thu, Feb 7, 2019 at 3:39 PM Pekub <kube...@regonik.sk> wrote: > Hello, > > I have this problem. I need to receive UDP Broadcast, but The "callback" > function is never called. > > I use LwIP 2.0.3. > > /*----- Default Value for IP_SOF_BROADCAST: 0 ---*/ > #define IP_SOF_BROADCAST 1 > /*----- Default Value for IP_SOF_BROADCAST_RECV: 0 ---*/ > #define IP_SOF_BROADCAST_RECV 1 > > void udp_server_init(void) > { > struct udp_pcb *upcb; > err_t err; > > upcb = udp_new(); > ip_set_option(upcb, SOF_BROADCAST); > > if (upcb) > { > err = udp_bind(upcb, IP_ADDR_BROADCAST, 8000); > > if(err == ERR_OK) > { > udp_recv(upcb, udp_receive_callback, NULL); > } > } > } > > void udp_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p, > const ip_addr_t *addr, u16_t port) > { > HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_2); > > pbuf_free(p); // Free the p buffer > > //udp_transmit(upcb, addr, udp2_tx_data, udp2_tx_len); > } > > What is wrong ? > > Peter > > > > -- > Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html > > _______________________________________________ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/lwip-users >
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users