= i + 1;
}
for(i = 0;i < len; i ++)
{
UART0_SendByte(buf_in);
}
UART0_SendByte(iptab[3]);
UART0_SendByte(iptab[2]);
UART0_SendByte(iptab[1]);
UART0_SendByte(iptab[0]);
memcpy((uint8_t*)&udp_header.buffer,(uint8_t*)&buf_in,8);//eba header 8byte
if( udp_header.buff.eba_id != EBA_ID ||
(udp_header.buff.protocol_idh <<8 | udp_header.buff.protocol_idl) != IEMPROTOCOL_ID ||
udp_header.buff.protocol_v != IEMPROTOCOL_V ||
(udp_header.buff.length0 + 8) != len )
{
UART0_SendByte(0x99);
return;
}
udp_buf[0] = EBA_ID;
udp_buf[1] = 0x00;
udp_buf[2] = (uint8_t)SEARCHPROTOCOL_ID;
udp_buf[3] = SEARCHPROTOCOL_V;
udp_buf[4] = 0x00; // length-field
udp_buf[5] =
该博客详细介绍了如何在STM32F207上使用LwIP库处理UDP广播包的接收和发送。内容包括通过UART发送接收到的数据、验证UDP头信息以及构建并发送响应报文的过程。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



