This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using UDP

Hello,

i would like  to send via UDP (lwIp & Hercules Develpoment Kit TMS570) Data my Host-PC. I write the following code. But it doesn't work correctly. Instead of mac of my Host-PC i see always the 0xFFFFFFFFFFFF for Broadcasting see please the screnshot below.

what is the reason for that. I hope you can help me.

Best regards...

lwIPInit(0, macArray, STATIC_IP_ADDRESS, 0, 0, IPADDR_USE_STATIC);

void udp_sender_init(void)
{

   struct ip_addr ipaddr_dest;

   IP4_ADDR(&ipaddr_dest, 192,168,0,5);

   struct ip_addr src;
   IP4_ADDR(&src, 192, 168, 0, 147);
   pcb = udp_new();

   if(pcb == NULL)
   {
       printf("\udp_new(): udp_new failed\n");
       return;
   }

   /* bind to any IP address on port 61234 */
   if (udp_bind(pcb, &src, 0) != ERR_OK)
   {
       printf("\udp_bind(): Fatal error...\n");
       return;
   }

   if (udp_connect(pcb,&ipaddr_dest,14534) != ERR_OK)
   {
       printf("\udp_connect(): Fatal error -> Connection.\n");
       return;
   }

   /* set udp_echo_recv() as callback function for received packets */
   udp_recv(pcb, udp_echo_recv, NULL);

}

void udp_sender_sent()
{
    struct pbuf *p;

    char msg[]="Empfangen...";

    p = pbuf_alloc(PBUF_TRANSPORT,sizeof(msg),PBUF_RAM);

    memcpy (p->payload, msg, sizeof(msg));

    udp_send(pcb, p);

    pbuf_free(p); //De-allocate packet buffer

}