¡@

VxComm 016

back

 Q:How to enable DHCP protocol for the I-7188E series module?

 Ans:

  1. I-7188E series standard firmware
  2. I-7188E Xserver-based program
  3. I-7188E user's own program

1. DHCP function for I-7188E series standard firmware (Vcomnnnn.exe, nnnn indicates the version number)

i. Modify the autoexec.bat


  1. Download the autoexec.bat and the firmware to the I-7188E.


 

 

  1. Reboot the I-7188E and the I-7188E will get the valid IP address from the DHCP server of the LAN through DHCP protocol.

Note:

  • The '/DHCP' command line option must be uppercase.
  • The firmware must be Vcom3223.exe or later.

2. DHCP function for I-7188E Xserver-based program

Please set the global variable, bUseDhcp to 1 (Enable DHCP function)

void UserInit(void)
{

bUseDhcp=1;
/*
Note:
bUseDhcp can only be set in the Userinit(). */

}

Note:

  • bUseDhcp variable can only be set in the Userinit()
  • The related library must be tcpip.lib dated on 2005/7/29 or later and vcom3223.lib dated on  2005/7/29 or later
  • The related library files are located on http://www.icpdas.com/download/7188sdk.htm

3. DHCP function for I-7188E user's own program

lhip("I7188EX",&host_ip);          

        if(bUseDhcp){      // bUseDhcp is a global variable defined on the tcpip.lib

                     extern struct NETDATA netdata[];

                     // for using DHCP, Set the IP address/MASK to 0 before call Ninit().

                     *(long *)netdata[0].Iaddr.c=

                     *(long *)netdata[0].Imask.c=

                     *(long *)netdata[1].Iaddr.c=

                     *(long *)netdata[1].Imask.c=0L;

                    

                     netdata[0].name=(char *)sHostName;

                     strcpy(netdata[0].name,"7188E01"); //Host name

                     // DhcpLeaseTime=xxxx;  // by default DhcpLeaseTime=0,

                     DhcpLeaseTime=20;

                                                                                     // that is the time is assigned by the DHCP server.

                                                                                     // the time unit is second.

                     Install_DHCP();   // must call Install_DHCP() for DHCP function to work.

           }

          

           err = Ninit();          /* initiate host environment */

           if (err < 0) {

                     ¡K¡K¡K¡K.

           }

          

           err = Portinit( "*" );  /* initiate network device */

           if (err < 0) { //Portinit() failed! error

                      ¡K¡K¡K¡K.

           }

 

In the TCP/IP library, the kernel will detect whether the IP/mask address of netdata structure are 0 or not.

If the addresses are zero, the kernel will send the DCHCP request to DHCP server.

If the addresses aren¡¦t zero, the IP/MASK address will be obtained from the EEPROM, not from DHCP server.

Note:

        Demo location: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/7188e/tcp/demo/bc/dhcp/

 

back

Written by Sean Hsu  

Date:2005/8/31