19 int main(
int argc,
char * argv[])
28 cerr <<
"Incorrect number of arguments provided\n";
29 cerr <<
"Usage: ipassigner_example.exe <SERIAL #> <1 Byte Address>\n";
30 return GALIL_EXAMPLE_ERROR;
34 char* serial_num = argv[1];
38 int address = strtol(argv[2], &end, 10);
39 if (*end !=
'\0' || address < 0 || address > 255)
41 cerr <<
"Please enter a number between 0 and 255 for the address." 42 " This will be used as the last number in the IP Address\n" 43 "Usage: ipassigner_example.exe <SERIAL #> <1 Byte Address>\n";
44 return GALIL_EXAMPLE_ERROR;
54 return GALIL_EXAMPLE_ERROR;
GReturn ip_assigner(char *serial_num, int address)
Assigns controller an IP Adress given a serial number and a 1 byte address.
int main(int argc, char *argv[])
Main function for Commands Example.
GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len)
Provides a human-readable description string for return codes.
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.