6,固定IP测试步骤
app_cfg.h/*
*********************************************************************************************************
* ADDITIONAL uC/MODULE ENABLES
*********************************************************************************************************
*/
#define APP_CFG_TCPIP_EN DEF_ENABLED
#define APP_CFG_HTTP_S_EN DEF_ENABLED
#define APP_CFG_DHCP_C_EN DEF_DISABLED
app_tcpip.c中的IP地址项:
#if APP_CFG_DHCP_C_EN == DEF_ENABLED
started = AppDHCPc_Init(if_nbr_ether);
if (started != DEF_YES) {
APP_TRACE_INFO(("App_DHCPc_Init() returned an error, uC/DHCPc is not started"));
return (DEF_FAIL);
}
#else
ip = NetASCII_Str_to_IPv4((CPU_CHAR *)"192.168.10.240", &net_err);
msk = NetASCII_Str_to_IPv4((CPU_CHAR *)"255.255.255.0", &net_err);
gateway = NetASCII_Str_to_IPv4((CPU_CHAR *)"192.168.10.1", &net_err);
(void)NetIPv4_CfgAddrAdd( if_nbr_ether,
ip,
msk,
gateway,
&net_err);
if (net_err != NET_IPv4_ERR_NONE) {
APP_TRACE_INFO(("NetIPv4_CfgAddrAdd() failed w/err = %d \r\n", net_err));
return (DEF_FAIL);
|