Mikroelektronika MIKROE-738 Datenbogen

Seite von 682
mikroC PRO for PIC32
MikroElektronika
479
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 IP subnet mask.
Requires
Ethernet module has to be initialized. See SPI_Ethernet_24j600_Init.
Example
unsigned char IpMask[4];  // user IP subnet mask buffer
... 
memcpy(IpMask,  SPI_Ethernet_24j600_getIpMask(),  4);  //  fetch  IP  subnet 
mask
Notes
User should always copy the IP address from the RAM location returned by this routine into it’s own IP 
subnet mask 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 Configures 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 
configuration 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.