User manual

487
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
SPI_Ethernet_confNetwork
Prototype
procedure SPI_Ethernet_confNetwork(var ipMask, gwIpAddr, dnsIpAddr :
array[4] of byte);
Description Congures 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_Init.
Example
var
ipMask : array[4] of byte; // network mask (for example :
255.255.255.0)
gwIpAddr : array[4] of byte; // gateway (router) IP address
dnsIpAddr : array[4] of byte; // DNS server IP address
...
gwIpAddr[0] := 192;
gwIpAddr[1] := 168;
gwIpAddr[2] := 20;
gwIpAddr[3] := 6;
dnsIpAddr[0] := 192;
dnsIpAddr[1] := 168;
dnsIpAddr[2] := 20;
dnsIpAddr[3] := 100;
ipMask[0] := 255;
ipMask[1] := 255;
ipMask[2] := 255;
ipMask[3] := 0;
...
SPI_Ethernet_confNetwork(ipMask, gwIpAddr, dnsIpAddr); // set network
conguration 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.