2 Replies Latest reply on Feb 15, 2019 3:18 AM by albac_1295646

    Is there any , udp or tcp , data sending and receiving  example , for FM4-176L-S6E2GM ?

    albac_1295646

      Hello ,

      I am modifying the ethernet example , but doesn't work .

      perhaps there is a working example .

      while (1)

          {

              if ( 0 != EmacGetFrameLength(&EMAC0) )  // Emac received data?

              {

                  LwIPInputHandle();    // Lwip handle the received data

              }

              LwipPeriodHandle();       // Lwip clears ARP table every 5 second

          if ( 0 != EmacGetFrameLength(&EMAC0) )  // Emac received data?

              {

                 

             

          err = udp_bind(upcb, IP_ADDR_ANY, UDP_SERVER_PORT);

              IP4_ADDR(&ip6,192,168,7,11);

             pb = pbuf_alloc(PBUF_TRANSPORT, 512, PBUF_REF);

              pb->payload = str;

              pb->len = pb->tot_len = 512;

              udp_connect(upcb, &ip6,5000);

              udp_send(upcb,  pb );

              udp_disconnect(upcb);

              pbuf_free( pb);

          }

          }

       

       

      I would appreciate any comment.