User manual
536
mikoC PRO for dsPIC
MikroElektronika
SPI_Ethernet_24j600_getIpMask
SPI_Ethernet_24j600_confNetwork
Prototype
unsigned char * SPI_Ethernet_24j600_getDnsIpAddress();
Description This routine should be used when DHCP server is present on the network to fetch assigned DNS IP 
address.
Parameters None.
Returns Pointer to the global variable holding DNS IP address.
Requires Ethernet module has to be initialized. See SPI_Ethernet_24j600_Init.
Example
unsigned char dnsIpAddr[4]; // user DNS IP address buffer
... 
memcpy(dnsIpAddr,  SPI_Ethernet_24j600_getDnsIpAddress(),  4);  //  fetch  DNS 
server address 
Notes User should always copy the IP address from the RAM location returned by this routine into it’s own 
DNS IP address buffer. These locations should not be altered by the user in any case!
Prototype
void  SPI_Ethernet_24j600_confNetwork(char  *ipMask,  char  *gwIpAddr,  char 
*dnsIpAddr);
Description Congures network parameters (IP subnet mask, gateway IP address, DNS IP address) when DHCP 
is not used.
Parameters - ipMask: IP subnet mask. 
- gwIpAddr gateway IP address. 
- dnsIpAddr: DNS IP address. 
Returns Nothing.
Requires Ethernet module has to be initialized. See SPI_Ethernet_24j600_Init.
Example
char ipMask[4]    = {255, 255, 255,  0 };  // network mask (for example : 
255.255.255.0)
char gwIpAddr[4] = {192, 168, 1, 1 }; // gateway (router) IP address
char dnsIpAddr[4] = {192, 168, 1, 1 }; // DNS server IP address
... 
SPI_Ethernet_24j600_confNetwork(ipMask, gwIpAddr, dnsIpAddr); // set network 
conguration parameters
Notes The above mentioned network parameters should be set by this routine only if DHCP module is not 
used. Otherwise DHCP will override these settings.










