28 int main(
int argc,
char * argv[])
30 GReturn rc = GALIL_EXAMPLE_OK;
31 char buf[G_SMALL_BUFFER];
37 cerr <<
"Incorrect number of arguments provided\n";
38 cerr <<
"Usage: ipassigner_example.exe <SERIAL #> <1 Byte Address>\n";
39 return GALIL_EXAMPLE_ERROR;
43 char* serial_num = argv[1];
47 int address = strtol(argv[2], &end, 10);
48 if (*end !=
'\0' || address < 0 || address > 255)
50 cerr <<
"Please enter a number between 0 and 255 for the address." 51 " This will be used as the last number in the IP Address\n";
52 "Usage: ipassigner_example.exe <SERIAL #> <1 Byte Address>\n";
53 return GALIL_EXAMPLE_ERROR;
61 GError(gr, buf, G_SMALL_BUFFER);
63 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 IP Assigner Example.