error while using "IP4 ADDR"

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

error while using "IP4 ADDR"

1,418 次查看
wenya
Contributor II

The development board I use is MPC5748G.

When I use RAW API to set the local IP,like this:

IP4_ADDR(ipaddr, 192,168,0,200);
IP4_ADDR(netmask, 255, 255, 255, 0);
IP4_ADDR(gw, 192, 168, 0, 1);

there are two errors :

'struct ip_addr' has no member named 'addr'   ip4_addr.h 

invalid type argument of '->' (have 'struct ip_addr') ip4_addr.h 

Do you know how to solve it?

 

标记 (3)
0 项奖励
回复
2 回复数

1,367 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you should have rather

IP4_ADDR(&ipaddr, 192,168,0,200);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gw, 192, 168, 0, 1);

BR, Petr

0 项奖励
回复

1,332 次查看
wenya
Contributor II

Thank you, I'll have a try!

0 项奖励
回复