int __stdcall SME_SetNetworkConfig ( SME_HANDLE  handle,
char *  ipAddress,
char *  netmask,
char *  gateway 

Sets the currently selected Sealevel I/O module's network configuration.

[in]handleValid handle returned by SME_Initialize().
Return values
0Successful completion.
-1Invalid SME_Initialize handle.
-2No module selected. Call SME_SearchForModules() first.
-3Invalid IP address string format. String should be in dotted notation.
-4Invalid netmask string format. String should be in dotted notation.
-5Invalid gateway string format. String should be in dotted notation.
-6Invalid netmask.
-7Invalid IP address. IP address must not be a home or broadcast address.
-8Error getting current configuration.
-9Error 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.

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.

Referenced by CCEthernet::set_information().

Generated on Mon Nov 26 2018.