Find which ip address was received from dhcp server

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

Find which ip address was received from dhcp server

跳至解决方案
1,195 次查看
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.

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,070 次查看
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 项奖励
回复
2 回复数
1,071 次查看
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 项奖励
回复
1,070 次查看
jesperevertsson
Contributor IV

Works like a charm, thanks

0 项奖励
回复