gclib  307
Communications API for Galil controllers and PLCs
 All Data Structures Files Functions Variables Typedefs Macros Pages
GReturn GCALL GAssign ( char *  ip,
char *  mac 
)

Assigns IP address over the Ethernet to a controller at a given MAC address.

Parameters
ipThe null-terminated ip address to assign. The hardware should not yet have an IP address.
macThe null-terminated MAC address of the hardware.
Returns
The success status or error code of the function. See gclib_errors.h for possible values. The desired IP address will be pinged prior to the assigment. If the ping is returned, GAssign() will return G_GCLIB_UTILITY_IP_TAKEN.
Note
Linux/OS X users must be root to use GAssign() and have UDP access to send on port 68.
//example of assigning an IP address.
GAssign("10.1.3.178", "00:50:4c:40:10:58"); //Assign 10.1.3.178 to 00:50:4c:40:10:58

Definition at line 39 of file gclibo.c.

References G_UTIL_ASSIGN, and GUtility().