CYW954907AEVAL1F switch ip settings

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
EnPa_4771801
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

hi, i'm using cyw95407aeval and i want do a tcp client but in this case i want to changethe mask, gateway and ip, as shown below   but this not working .

unsigned long rn[]={255,255,0,  0};

    unsigned long ri[]={172,10,  85,  0};

    unsigned long rg[]={172,168,  100,  4};

     unsigned long ip_address1 = MAKE_IPV4_ADDRESS(ri[0],ri[1],ri[2],ri[3]);

     unsigned long netmask1 = MAKE_IPV4_ADDRESS(rn[0],rn[1],rn[2],rn[3]);

     unsigned long gateway1 = MAKE_IPV4_ADDRESS(rg[0],rg[1],rg[2],rg[3]);

     //const wiced_ip_address_t SET_IPV4_ADDRESS(ip_address,);

     static  wiced_ip_setting_t device_init_ip_settings1 ={

        INITIALISER_IPV4_ADDRESS( .ip_address, ip_address1),

        INITIALISER_IPV4_ADDRESS( .netmask,    netmask1 ),

        INITIALISER_IPV4_ADDRESS( .gateway,gateway1     ),

     };

the log is INITIALISER_IPV4_ADDRESS is not a constant, how i can make it work ?

0 Likes
1 Solution
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

EnPa_4771801  the issue is because, MAKE_IPV4_ADDRESS() expects the arguments passed to it to be a constant, rather than a variable.

Pass the address as MAKE_IPV4_ADDRESS(172,10,85,0); and the compilation should go through.

Thanks

View solution in original post

0 Likes
1 Reply
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

EnPa_4771801  the issue is because, MAKE_IPV4_ADDRESS() expects the arguments passed to it to be a constant, rather than a variable.

Pass the address as MAKE_IPV4_ADDRESS(172,10,85,0); and the compilation should go through.

Thanks

0 Likes