【Feedback】请教:UDP接收数据问题
Re: 【Feedback】请教:UDP接收数据问题
Postby yangtao » Fri Jul 01, 2016 3:57 pm
Code: Select all
LOCAL void ICACHE_FLASH_ATTR
user_udp_config_recv(void *arg, char *pusrdata, unsigned short length)
{
if (pusrdata == NULL)
{
os_printf("invalid UDP Data. size=%d\n", length);
return;
}
os_printf("UDP Received: len %d, data=%s\n", length, pusrdata);
//ir_ctrl_test_by_json(&ptrespconn, pusrdata, length);
}
/*
Initialize UDP Service
*/
void ICACHE_FLASH_ATTR service_udp_init(void)
{
ptrespconn.type = ESPCONN_UDP;
ptrespconn.proto.udp = (esp_udp *)os_zalloc(sizeof(esp_udp));
ptrespconn.proto.udp->local_port = UDP_CONFIG_PORT; //5678
espconn_regist_recvcb(&ptrespconn, user_udp_config_recv);
espconn_create(&ptrespconn);
}
" os_printf("UDP Received: len %d, data=%s\n", length, pusrdata);" 发送后,没有输出数据。
Who is online
Users browsing this forum: No registered users and 15 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.