FNET Change Static IP

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

FNET Change Static IP

跳至解决方案
922 次查看
pcpro178
Contributor III

My application uses a static IP address, but it needs the ability to change the IP address and subnet mask through software. Is there a way to do this without modifying the FNET stack?

标记 (2)
1 解答
784 次查看
pcpro178
Contributor III

I found that I could set the IP addresses during run-time using `fnet_netif_set_ip4_addr` and `fnet_netif_set_ip4_gateway`.  I mapped some memory space in flash to store the addresses while powered-down, and my application restores them using those two API calls at power-up.

在原帖中查看解决方案

2 回复数
785 次查看
pcpro178
Contributor III

I found that I could set the IP addresses during run-time using `fnet_netif_set_ip4_addr` and `fnet_netif_set_ip4_gateway`.  I mapped some memory space in flash to store the addresses while powered-down, and my application restores them using those two API calls at power-up.

784 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Jim:

According to Fnet Quick start:

You are able to change the default network pararmeters

 

  • By using Shell commands:
  • set address <default-if IPv4 address>
  • set gateway <default-if IPv4 gateway address>
  • set netmask <default-if IPv4 netmask address>
  • By changing the default values in the fapp_user_config.h source file. 
    Your local system administrator is able to assign a unique IPv4 address for the board, and also provide you with the IPv4 addresses of the gateway and the netmask.

Regards

Daniel

0 项奖励