extern struct netif network_interfaces[1];
void interface_init_1(void)
{
for(int i = 0; i < 1; i++)
{
ip4_addr_t ipaddr, netmask, gw;
ip4_addr_set_zero(&gw);
ip4_addr_set_zero(&ipaddr);
ip4_addr_set_zero(&netmask);
/* network_interfaces[i] takes the IPV4 addresses from the respective configuration */
IP4_ADDR((&gw), 192,168, 0, 1);
IP4_ADDR((&ipaddr), 192, 168, 0, 200);
IP4_ADDR((&netmask), 255,255,255, 0);
netif_set_default( netif_add(&network_interfaces[i], &ipaddr, &netmask, &gw, NULL, enet_ethernetif_init, tcpip_input) );
netif_set_up(&network_interfaces[i]);
}
}
char msg[8192] = "MPC5748G";
void vInitTask(void* pvParamateres){
struct netconn *conn;
struct netbuf *buf;
ip_addr_t dst_addr;
int i;
err_t connection_err, send_err;
u16_t dst_port = 7000;
/* init the stack */
tcpip_init(NULL, NULL);
interface_init_
Free-RTOS 发送udp数据
最新推荐文章于 2024-05-29 15:16:16 发布