|
From: | Peter Kubelka |
Subject: | [lwip-users] UDP server callback |
Date: | Thu, 29 Nov 2018 16:00:59 +0000 |
Hello, I created UDP server with LwIP stack on STM32F407. I tried example udp_echo _server. It
works. Now I need send from server my own answer data in callback function. The program hangs in callback function. void
udp_echoserver_receive_callback(void *arg,
struct
udp_pcb *upcb,
struct
pbuf *p,
const
ip_addr_t *addr,
u16_t port) {
unsigned
char buffer[80] =
"my name is
xxxxxxx"; p->payload
= buffer; p->len
= p->tot_len = 20;
/* Connect to the remote client */
udp_connect(upcb, addr, UDP_CLIENT_PORT);
/* Tell the client that we have accepted it */ udp_send(upcb, p);
/* free the UDP connection, so we can accept new clients */ udp_disconnect(upcb); /* Free the p buffer */ pbuf_free(p); } What is wrong ? Is somewhere on web LwIP stack guide? Thank you Peter |
[Prev in Thread] | Current Thread | [Next in Thread] |