Altera_Forum
Honored Contributor
17 years agoproblem changing static IP in socket server application
I'm trying to test simple sockect server example in Cyclone III NIOS II eval kit using NIOS IDE 8.0.
I checked this example in my old version 7.2 of Quartus and it worked fine!!! I tried to change static IP in simple_socket_server.h using # define IPADDR0 192 # define IPADDR1 168 # define IPADDR2 10 # define IPADDR3 11 and settind *use_dhcp=0 by making those changes my simple socket server application worked in 7.2. but in this 8.0 version the static IP never changes from the adress 0.10.10.11. I've debugged the code and I think htonl instruction doesn't work properly. # define IP4_ADDR(ipaddr, a,b,c,d) ipaddr = htonl(((alt_u32)(a & 0xff) << 24) | ((alt_u32)(b & 0xff) << 16) | ((alt_u32)(c & 0xff) << 8) | (alt_u32)(d & 0xff)) any suggestion??