Sets the currently selected module's network configuration.
|[in]||handle||Valid handle returned by SME_Initialize(). |
- Return values
|-1||Invalid SME_Initialize handle. |
|-2||No module selected. Call SearchForModules() first. |
|-3||Invalid netmask. |
|-4||Invalid IP address. IP address must not be a home or broadcast address. |
|-5||Error getting current configuration. |
|-6||Error writing new configuration.|
Any of the three parameters may be NULL if that part of the network configuration should not be changed. For instance, it is possible to only adjust the netmask of the currently selected module by supplying a valid second parameter, and NULL for the first and third parameters. Likewise, it is possible to set the IP address and netmask, without affecting the gateway.
Instead of populating the three parameters with string versions of the network configuration, the three parameters should each contain four byte equivalents of the network configuration.
- Setting a network configuration will automatically disable DHCP configuration, if it has been enabled. Calling SM_SetDHCPConfig() prior to this function is not required.
This function will delete the internal list of found modules and reset the internal current module pointer, resulting in "No module selected" errors on subsequent calls to SME_ functions. SME_SearchForModules() should be called immediately after calling this function if you wish to find or configure other modules.
- Care should be taken when setting the IP address and netmask. This method attempts to deny invalid combinations such as home and broadcast addresses, but it does not check for out of subnet addresses.
This function will cause the Ethernet to serial bridge to reset for a short time while the new parameters are enabled. For bridges with statically assigned IP addresses, the reset time is only momentary. However, for DHCP assigned IP addresses, the bridge will not respond until it's IP address is re-leased from the DHCP server.