Tool/software: Code Composer Studio
Hello everyone!
I am learning the implementation of UDP. I have implemented a UDP receive function. For small data like "Hello" is successfully received by the controller but when I send large string like "Prateek-Client-UDP-Testing", I receive the following message:
Prateek-Client-UDP-Testing▒bJ▒▒bJ▒▒bJ▒.250:1900
ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
Man: "ssdp:discover"
MX: 3
▒▒▒▒"▒▒▒"▒▒▒"
My callback function is as follows:
void udp_recv_print(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port){
if (p != NULL) {
UARTprintf("Data Received --->> %s\n",p->payload);
pbuf_free(p);
}
}
Please suggest some solutions to get rid of the garbage data.