Hello,
i have a stupid problem,
i have write a udp serveur software for linux,
i want port my project to stm 32 with liwp,
but stupide problem.
can you say how i can convert udp buffer receive to sring ?

best regards
patrice

my code source test

void udp_echoserver_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
{

  /* Connect to the remote client */
  udp_connect(upcb, addr, UDP_CLIENT_PORT);

  /* Tell the client that we have accepted it */
 // udp_send(upcb, p);
    LCD_DisplayStringLine(Line6, (uint8_t*)"Renvoi UDP OK");

    udp_send(upcb, p);


memcpy (p->payload, udpmsg, sizeof(udpmsg)); //copy d'un message dans buffer d'envoi




/* refernce the string */

    udp_send(upcb, p);


    LCD_DisplayStringLine(Line7, (uint8_t*) p);

  /* free the UDP connection, so we can accept new clients */
  udp_disconnect(upcb);

  /* Free the p buffer */
  pbuf_free(p);

}

--
Patrice GERBET

Email : pger...@gp-land.com


Reply via email to