How to send packet on UDP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I am working on project where I required to send packet using UDP method.

I found one App in Wiced udp_transmit. But i'm not able to send my packet.

i,e .

     struct packet_data{

          char str[20];

          int data_length;

     };

     struct packet{

               int i;

               struct packet_data data;

               char c;

      };

so what is the API for sending this packet over UDP??

Thanks,

Prashant

0 Likes
1 Solution

Hi Prashant,

You will need to copy your data into udp_data after creating a UDP packet with the function

wiced_packet_create_udp( wiced_udp_socket_t* socket, uint16_t content_length, wiced_packet_t** packet, uint8_t** data, uint16_t* available_space )

Please refer to line 154 and after in WICED-SDK-2.4.1\Apps\snip\udp_transmit\udp_transmit.c. It shows an example of creating and sending a UDP packet.

Thanks,

Jaeyoung

View solution in original post

0 Likes
4 Replies