完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
原子哥:
LWIP+ENC60J+STM32(MINI)V3.0 发送回调函数中,发送变量多了不行,常量再多也可以,在论坛中都没发现过讨论这个问题的, 注释掉的发15个就有接收不到的,常量发90个可以, 我的项目是把TCP/IP,网关,掩码发给上位机显示,而后,手工配置TCP/IP,网关,掩码等 代码如下: err_t tcp_client_poll(void *arg, struct tcp_PCB *tpcb) { u8 i=0; err_t ret_err; struct tcp_client_struct *es; es=(struct tcp_client_struct*)arg; if(es!=NULL) //????????????????·??????? { if(tcp_client_sta&(1<<7))//??????·?????????·??? { memset(tcp_udp_demo_sendbuf,0,TCP_UDP_DEMO_TX_BUFSIZE); //????·???????????0 if(key_flag) //·????????????????????? { tcp_udp_demo_sendbuf[0]=0x0a; tcp_udp_demo_sendbuf[1]=0x0b; tcp_udp_demo_sendbuf[2]=0x0c; tcp_udp_demo_sendbuf[3]=0x0d; tcp_udp_demo_sendbuf[4]=0x0e; key_flag=0; } if( read_ip_ok) //±à??×???·???IP????????±à???í?? { // tcp_udp_demo_sendbuf[0]=NET_ID_FLG; // tcp_udp_demo_sendbuf[1]=eeprom_net_num[0]; //?????? // tcp_udp_demo_sendbuf[2]=eeprom_net_num[1]; // tcp_udp_demo_sendbuf[3]=eeprom_net_num[2]; // tcp_udp_demo_sendbuf[1]=USER_ID_FLG; //tcp_udp_demo_sendbuf[5]=eeprom_user_id[0]; //???§???? // tcp_udp_demo_sendbuf[6]=eeprom_user_id[1]; // tcp_udp_demo_sendbuf[7]=eeprom_user_id[2]; // tcp_udp_demo_sendbuf[8]=eeprom_user_id[3]; // tcp_udp_demo_sendbuf[2]=REMOTEIP_FLG; //tcp_udp_demo_sendbuf[3]=lwipdev.remoteip[0]; //????IP // tcp_udp_demo_sendbuf[4]=lwipdev.remoteip[1]; // tcp_udp_demo_sendbuf[5]=lwipdev.remoteip[2]; // tcp_udp_demo_sendbuf[6]=lwipdev.remoteip[3]; // tcp_udp_demo_sendbuf[3]=HEREIP_FLG; //tcp_udp_demo_sendbuf[4]=lwipdev.ip[0]; //±???IP // tcp_udp_demo_sendbuf[5]=lwipdev.ip[1]; // tcp_udp_demo_sendbuf[6]=lwipdev.ip[2]; // tcp_udp_demo_sendbuf[7]=lwipdev.ip[3]; // tcp_udp_demo_sendbuf[8]=NETMASK_FLG; //tcp_udp_demo_sendbuf[9]=lwipdev.netmask[0]; //×??????? // tcp_udp_demo_sendbuf[10]=lwipdev.netmask[1]; // tcp_udp_demo_sendbuf[11]=lwipdev.netmask[2]; // tcp_udp_demo_sendbuf[12]=lwipdev.netmask[3]; // tcp_udp_demo_sendbuf[13]=GATWAY_FLG; //tcp_udp_demo_sendbuf[14]=lwipdev.gateway[0]; //???????? // tcp_udp_demo_sendbuf[15]=lwipdev.gateway[1]; // tcp_udp_demo_sendbuf[16]=lwipdev.gateway[2]; // tcp_udp_demo_sendbuf[17]=lwipdev.gateway[3]; // tcp_udp_demo_sendbuf[22]=TCP_UDP_PORT_FLG; tcp_udp_demo_sendbuf[0]=0x0a; tcp_udp_demo_sendbuf[1]=0x0b; tcp_udp_demo_sendbuf[2]=0x0b; tcp_udp_demo_sendbuf[3]=0x0c; tcp_udp_demo_sendbuf[4]=0x0d; tcp_udp_demo_sendbuf[5]=0x0e; tcp_udp_demo_sendbuf[6]=0x0a; tcp_udp_demo_sendbuf[7]=0x0b; tcp_udp_demo_sendbuf[8]=0x0c; tcp_udp_demo_sendbuf[9]=0x0d; tcp_udp_demo_sendbuf[10]=0x0e; tcp_udp_demo_sendbuf[11]=0x0a; tcp_udp_demo_sendbuf[12]=0x0b; tcp_udp_demo_sendbuf[13]=0x0c; tcp_udp_demo_sendbuf[14]=0x0d; tcp_udp_demo_sendbuf[15]=0x0e; tcp_udp_demo_sendbuf[16]=0x0a; tcp_udp_demo_sendbuf[17]=0x0b; tcp_udp_demo_sendbuf[18]=0x0c; tcp_udp_demo_sendbuf[19]=0x0d; tcp_udp_demo_sendbuf[20]=0x0e; tcp_udp_demo_sendbuf[21]=0x0a; tcp_udp_demo_sendbuf[22]=0x0b; tcp_udp_demo_sendbuf[23]=0x0c; tcp_udp_demo_sendbuf[24]=0x0d; tcp_udp_demo_sendbuf[25]=0x0e; tcp_udp_demo_sendbuf[26]=0x0c; tcp_udp_demo_sendbuf[27]=0x0d; tcp_udp_demo_sendbuf[28]=0x0e; tcp_udp_demo_sendbuf[29]=0x0a; tcp_udp_demo_sendbuf[30]=0x0b; tcp_udp_demo_sendbuf[31]=0x0c; tcp_udp_demo_sendbuf[32]=0x0d; tcp_udp_demo_sendbuf[33]=0x0e; tcp_udp_demo_sendbuf[34]=0x0c; tcp_udp_demo_sendbuf[35]=0x0d; tcp_udp_demo_sendbuf[36]=0x0e; tcp_udp_demo_sendbuf[37]=0x0c; tcp_udp_demo_sendbuf[38]=0x0d; tcp_udp_demo_sendbuf[39]=0x0e; tcp_udp_demo_sendbuf[40]=0x0a; tcp_udp_demo_sendbuf[41]=0x0b; tcp_udp_demo_sendbuf[42]=0x0c; tcp_udp_demo_sendbuf[43]=0x0d; tcp_udp_demo_sendbuf[44]=0x0e; tcp_udp_demo_sendbuf[45]=0x0a; tcp_udp_demo_sendbuf[46]=0x0b; tcp_udp_demo_sendbuf[47]=0x0b; tcp_udp_demo_sendbuf[48]=0x0c; tcp_udp_demo_sendbuf[49]=0x0d; tcp_udp_demo_sendbuf[50]=0x0e; tcp_udp_demo_sendbuf[51]=0x0a; tcp_udp_demo_sendbuf[52]=0x0b; tcp_udp_demo_sendbuf[53]=0x0c; tcp_udp_demo_sendbuf[54]=0x0d; tcp_udp_demo_sendbuf[55]=0x0e; tcp_udp_demo_sendbuf[56]=0x0a; tcp_udp_demo_sendbuf[57]=0x0b; tcp_udp_demo_sendbuf[58]=0x0c; tcp_udp_demo_sendbuf[59]=0x0d; tcp_udp_demo_sendbuf[60]=0x0e; tcp_udp_demo_sendbuf[61]=0x0a; tcp_udp_demo_sendbuf[62]=0x0b; tcp_udp_demo_sendbuf[63]=0x0c; tcp_udp_demo_sendbuf[64]=0x0d; tcp_udp_demo_sendbuf[65]=0x0e; tcp_udp_demo_sendbuf[66]=0x0a; tcp_udp_demo_sendbuf[67]=0x0b; tcp_udp_demo_sendbuf[68]=0x0c; tcp_udp_demo_sendbuf[69]=0x0d; tcp_udp_demo_sendbuf[70]=0x0e; tcp_udp_demo_sendbuf[71]=0x0c; tcp_udp_demo_sendbuf[72]=0x0d; tcp_udp_demo_sendbuf[73]=0x0e; tcp_udp_demo_sendbuf[74]=0x0a; tcp_udp_demo_sendbuf[75]=0x0b; tcp_udp_demo_sendbuf[76]=0x0c; tcp_udp_demo_sendbuf[77]=0x0d; tcp_udp_demo_sendbuf[78]=0x0e; tcp_udp_demo_sendbuf[79]=0x0c; tcp_udp_demo_sendbuf[80]=0x0d; tcp_udp_demo_sendbuf[81]=0x0e; tcp_udp_demo_sendbuf[82]=0x0c; tcp_udp_demo_sendbuf[83]=0x0d; tcp_udp_demo_sendbuf[84]=0x0e; tcp_udp_demo_sendbuf[85]=0x0a; tcp_udp_demo_sendbuf[86]=tcp_client_porth; //这个能接收到, tcp_udp_demo_sendbuf[87]=tcp_client_portl; //这个能接收到, tcp_udp_demo_sendbuf[88]=udp_porth; //这里就收不到了 tcp_udp_demo_sendbuf[89]=udp_portl; //这里也收不到了 LCD_ShowString(30,270,200,16,16,"send ok"); readip_send_ok=1; read_ip_ok=0; } es->p=pbuf_alloc(PBUF_TRANSPORT, strlen((char*)tcp_udp_demo_sendbuf),PBUF_POOL);//?ê?????? pbuf_take(es->p,(char*)tcp_udp_demo_sendbuf,strlen((char*)tcp_udp_demo_sendbuf));//??tcp_udp_demo_sentbuf[] //??????????±???es->p_tx?? tcp_client_senddata(tpcb,es);//??tcp_udp_demo_sentbuf[]??????????pbuf??????·??????? tcp_client_sta&=~(1<<7);//????????·???±ê?? if(es->p)pbuf_free(es->p);//??·????? }else if(es->state==ES_TCPCLIENT_CLOSING) { tcp_client_connection_close(tpcb,es);//??±?TCP???? } ret_err=ERR_OK; }else { tcp_abort(tpcb);//????????,????pcb?????é ret_err=ERR_ABRT; } return ret_err; } |
|
相关推荐
2个回答
|
|
|
|
|
|
用sprintf打包成 字符串试试
|
|
|
|
只有小组成员才能发言,加入小组>>
如何使用STM32+nrf24l01架构把有线USB设备无线化?
2444 浏览 7 评论
请问能利用51单片机和nRF24L01模块实现实时语音无线传输吗?
2217 浏览 5 评论
2979 浏览 3 评论
2671 浏览 8 评论
为什么ucosii上移植lwip后系统进入了HardFault_Handler?
2638 浏览 4 评论
请教各位大咖:有没有接收频率32M左右的芯片推荐的?先感谢啦!
420浏览 1评论
684浏览 0评论
759浏览 0评论
468浏览 0评论
277浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-22 20:23 , Processed in 0.964850 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191