Find which ip address was received from dhcp server

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Find which ip address was received from dhcp server

Jump to solution
539 Views
jesperevertsson
Contributor IV

Hi, I'm working on a program that requires network connectivity. I can use the RTCS without problem with both a static ip and by using dhcp. The only problem I have is that I don't know how to find what ip the dhcp server gave my program. If I check the dhcp server i can find it and confirm that my device is indeed hosted on that ip, but I figured there was also a way to find the ip inside the program, I just don't know how.

Labels (1)
Tags (2)
0 Kudos
1 Solution
414 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

I think you can try the function ifcfg_get_ip

/*FUNCTION*--------------------------------------------------------------

*

* Function Name  : ipcfg_get_ip()

* Returned Value : TRUE and IP, mask and gateway, if successful

* Comments       : Returns actual ip information from DHCP response, if any.

*

*END--------------------------------------------------------------------*/

Regards

Daniel

View solution in original post

0 Kudos
2 Replies
415 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

I think you can try the function ifcfg_get_ip

/*FUNCTION*--------------------------------------------------------------

*

* Function Name  : ipcfg_get_ip()

* Returned Value : TRUE and IP, mask and gateway, if successful

* Comments       : Returns actual ip information from DHCP response, if any.

*

*END--------------------------------------------------------------------*/

Regards

Daniel

0 Kudos
414 Views
jesperevertsson
Contributor IV

Works like a charm, thanks

0 Kudos