-->
Page 1 of 1

what type of parameter in the example of RTOS SDK?

PostPosted: Thu Oct 29, 2015 10:04 pm
by march_seven
Hi

i am new in learning UDP transmit test by (RTOS ESP8266 SDK)

why does it have not support the data type of those parameter

1. udp_msg
2.UDP_DATA_LEN
3.from
4. S0L_SOCKET


Code: Select allwhile(1){
memset(udp_msg, 0, UDP_DATA_LEN);
memset(&from, 0, sizeof(from));
setsockopt(sock_fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&nNetTimeout,
sizeof(int));
fromlen = sizeof(struct sockaddr_in);
ret = recvfrom(sock_fd, (uint8 *)udp_msg, UDP_DATA_LEN, 0,(struct sockaddr
*)&from,(socklen_t *)&fromlen);
if (ret > 0) {
printf("ESP8266 UDP task > recv %d Bytes from Port %d %s\n”,ret,
ntohs(from.sin_port), inet_ntoa(from.sin_addr));
sendto(sock_fd,(uint8*)udp_msg, ret, 0, (struct sockaddr *)&from,
fromlen);
}
}
if(udp_msg){
free(udp_msg);
udp_msg = NULL;
}
close(sock_fd);