gclib 2.5.0
Galil Communications Library
Loading...
Searching...
No Matches
gclib Namespace Reference

Namespaces

namespace  internal

Classes

class  Controller
 Manages a connection to a controller. More...
struct  DataRecord
class  error
 Thrown when the underlying C library returns a nonzero gclib_result. More...
struct  Interrupt

Enumerations

enum  ConnectionType {
  Ethernet = GCLIB_ETHERNET ,
  Serial = GCLIB_SERIAL ,
  Pci = GCLIB_PCI
}
 Returned by Controller::connection_type(). More...

Functions

std::string version ()
 Installed gclib version.
std::string addresses ()
 Show address, model, and serial of detected controllers, where available. Detected controllers are newline-separated. Each line is comma-separated.
std::string ip_requests ()
 Show MAC address, model, and serial of all controllers requesting IP addresses. Detected controllers are newline-separated. Use assign_ip() to assign an IP address to controllers returned by this method.
void assign_ip (std::string mac, std::string ip)
void force_gcaps (bool on)
 Force future library calls to use either gcaps or direct connections.
std::string gcaps_version ()
 Installed gcaps version, as reported by current gcaps server.
std::string list_servers ()
 List available gcaps servers separated by newline.
std::string server ()
 Current gcaps server, or an empty string if connected to the local gcaps server.
void set_server (std::string name={})
std::string published ()
 Return name of local gcaps server, or an empty string if unpublished.
void set_published (std::string name={})
 Publish local gcaps server as name, or unpublish if name is empty.

Enumeration Type Documentation

◆ ConnectionType

Returned by Controller::connection_type().

Enumerator
Ethernet 
Serial 
Pci 

Definition at line 55 of file gclib.hpp.

Function Documentation

◆ version()

std::string version ( )
inline

Installed gclib version.

Definition at line 242 of file gclib.hpp.

◆ addresses()

std::string addresses ( )
inline

Show address, model, and serial of detected controllers, where available. Detected controllers are newline-separated. Each line is comma-separated.

Available information by connection type:

  • Ethernet connections show address, model, and serial.
  • USB connections show address and model.
  • Serial and PCI connections show address only.

Example output:

192.168.0.40, DMC4040 Rev 1.3i, 10601
COM5, DMC-41x3
GALILPCI0
Returns
std::string Newline-separated info on detected controllers.

Definition at line 261 of file gclib.hpp.

◆ ip_requests()

std::string ip_requests ( )
inline

Show MAC address, model, and serial of all controllers requesting IP addresses. Detected controllers are newline-separated. Use assign_ip() to assign an IP address to controllers returned by this method.

Example output:

00:50:4c:20:29:69, DMC4000, 10601
00:50:4c:58:12:34, DMC2105, 4660

Definition at line 273 of file gclib.hpp.

◆ assign_ip()

void assign_ip ( std::string mac,
std::string ip )
inline

Definition at line 274 of file gclib.hpp.

◆ force_gcaps()

void force_gcaps ( bool on)
inline

Force future library calls to use either gcaps or direct connections.

The default behavior of gclib is to prefer gcaps, but fall back to direct operations when gcaps is not running. This method allows disabling the default behavior process-wide, but cannot be undone.

Parameters
onIf true, all future gclib calls will fail if gcaps not found, rather than falling back to direct operations. If false, gcaps will not be used for any future gclib calls.

Definition at line 287 of file gclib.hpp.

◆ gcaps_version()

std::string gcaps_version ( )
inline

Installed gcaps version, as reported by current gcaps server.

Definition at line 289 of file gclib.hpp.

◆ list_servers()

std::string list_servers ( )
inline

List available gcaps servers separated by newline.

Definition at line 291 of file gclib.hpp.

◆ server()

std::string server ( )
inline

Current gcaps server, or an empty string if connected to the local gcaps server.

Definition at line 293 of file gclib.hpp.

◆ set_server()

void set_server ( std::string name = {})
inline

Use a gcaps server as reported by list_servers() for all future gcaps communications. Pass an empty string to use the local gcaps server.

Definition at line 296 of file gclib.hpp.

◆ published()

std::string published ( )
inline

Return name of local gcaps server, or an empty string if unpublished.

Definition at line 298 of file gclib.hpp.

◆ set_published()

void set_published ( std::string name = {})
inline

Publish local gcaps server as name, or unpublish if name is empty.

Definition at line 300 of file gclib.hpp.