24void print_client_message(
const char*
message)
27 std::cout <<
message << std::endl;
34void print_servers_list(
const std::vector<std::string>&
server_list)
41 print_client_message(
"none");
49 print_client_message(
buf);
63 while (index <
servers.length())
96 char instructions[] =
"<s> List available servers on the network\n"
97 "<h> List available hardware on currently connected server\n"
98 "<0-9> Enter numbers 0-9 to connect to a server by index\n"
99 "<l> Set active server back to local server\n"
121 else if (
input ==
's')
123 print_client_message(
"Available Servers:");
132 int index =
input -
'0';
137 print_client_message(
buf);
140 else if (
input ==
'l')
143 print_client_message(
"Server set to: Local");
145 else if (
input ==
'h')
148 print_client_message(
buf);
156 return GALIL_EXAMPLE_OK;
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
GCLIB_DLL_EXPORTED GReturn GCALL GListServers(GCStringOut servers, GSize servers_len)
Uses GUtility(), G_UTIL_GCAPS_LIST_SERVERS to provide a list of all available gcaps services on the l...
GCLIB_DLL_EXPORTED GReturn GCALL GSetServer(GCStringIn server_name)
Uses GUtility(), G_UTIL_GCAPS_SET_SERVER to set the new active server.
GCLIB_DLL_EXPORTED GReturn GCALL GAddresses(GCStringOut addresses, GSize addresses_len)
Uses GUtility(), G_UTIL_GCAPS_ADDRESSES or G_UTIL_ADDRESSES to provide a listing of all available con...
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
GReturn remote_client()
Lists available remote servers and allows connection to remote server.
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.