User manual

510
mikoC PRO for dsPIC
MikroElektronika
SPI_Ethernet_getIpAddress
SPI_Ethernet_getDnsIpAddress
SPI_Ethernet_getIpMask
Prototype
unsigned char * SPI_Ethernet_getIpAddress();
Description This routine should be used when DHCP server is present on the network to fetch assigned IP
address.
Parameters None.
Returns Pointer to the global variable holding IP address.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
unsigned char ipAddr[4]; // user IP address buffer
...
memcpy(ipAddr, SPI_Ethernet_getIpAddress(), 4); // fetch IP address
Notes User should always copy the IP address from the RAM location returned by this routine into it’s own IP
address buffer. These locations should not be altered by the user in any case!
Prototype
unsigned char * SPI_Ethernet_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_Init.
Example
unsigned char dnsIpAddr[4]; // user DNS IP address buffer
...
memcpy(dnsIpAddr, SPI_Ethernet_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
unsigned char * SPI_Ethernet_getIpMask();
Description This routine should be used when DHCP server is present on the network to fetch assigned IP subnet
mask.
Parameters None.
Returns Pointer to the global variable holding IP subnet mask.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
unsigned char IpMask[4]; // user IP subnet mask buffer
...
memcpy(IpMask, SPI_Ethernet_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!