是否可以通过UDP发送大数组?
我想用STM32F767和LAN8720A发送大型阵列(阵列[1600])。 当我的数组大于1319字节时,MCU无法发送(我不会使用我的终端软件(udpclientserver.exe)收到任何内容) 我的阵列充满了“字符
”''
void my_udpsenddata(void) {
uint16_t i=0;
uint16_t BufferSize=0;
struct pbuf *p;
while(array[i]=='A')
{
i++;
BufferSize++;
}
p = pbuf_alloc(PBUF_TRANSPORT, BufferSize, PBUF_RAM);
pbuf_take(p, array, sizeof(array[0])*BufferSize);
udp_send(udp_send_pcb, p);
pbuf_free(p);
}
///////////(1)
while(1) {
MX_LWIP_Process();
cntr++;
if(cntr > 200000)
{
cntr=0;
MY_UdpSendData();
}
}
'''
i want to send large array (array[1600]) with stm32f767 and lan8720a with udp.
when my array biger than 1319 byte the mcu can not send(i don't receive anything with my terminal software(UdpClientServer.exe) )
my array is full of 'A' character
'''
void MY_UdpSendData(void)
{
uint16_t i=0;
uint16_t BufferSize=0;
struct pbuf *p;
while(array[i]=='A')
{
i++;
BufferSize++;
}
p = pbuf_alloc(PBUF_TRANSPORT, BufferSize, PBUF_RAM);
pbuf_take(p, array, sizeof(array[0])*BufferSize);
udp_send(udp_send_pcb, p);
pbuf_free(p);
}
//////////while(1)
while (1)
{
MX_LWIP_Process();
cntr++;
if(cntr > 200000)
{
cntr=0;
MY_UdpSendData();
}
}
'''
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论