| gclib 2.4.1 Galil Communications Library

Loading...
Searching...
No Matches
Macros | Typedefs | Functions
gclib_compat.h File Reference
`#include "gclib_record.h"`
`#include "gclib_errors.h"`

Go to the source code of this file.

## Macros
#define | GCLIB_DEPRECATED
#define | G_DR 1
| Value for GRecord() method variable for acquiring a data record via DR mode.
#define | G_QR 0
| Value for GRecord() method variable for acquiring a data record via QR mode.
#define | G_BOUNDS -1
| For functions that take range options, e.g. GArrayUpload(), use this value for full range.
#define | G_CR 0
| For GArrayUpload(), use this value in the delim field to delimit with carriage returns.
#define | G_COMMA 1
| For GArrayUpload(), use this value in the delim field to delimit with commas.
#define | G_PUBLISH_SERVER 1
| For GPublishServer(), use this value to publish server to local network.
#define | G_REMOVE_SERVER 0
| For GPublishServer(), use this value to remove server from local network.
#define | G_USE_INITIAL_TIMEOUT -1
| For GTimeout(), use this value to use initial GOpen() timeout (–timeout).
#define | G_SMALL_BUFFER 1024
| Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
#define | G_HUGE_BUFFER 524288
| Most reads from Galil hardware are small. This value will hold the largest array or program upload/download possible.
#define | G_LINE_BUFFER 80
| For writes, via command interpreter, to the Galil.
#define | G_UTIL_TIMEOUT 1
| GUtility(), Access to timeout.
#define | G_UTIL_TIMEOUT_OVERRIDE 2
| GUtility(), read/write access to timeout override.
#define | G_USE_INITIAL_TIMEOUT -1
| For GTimeout(), use this value to use initial GOpen() timeout (–timeout).
#define | G_UTIL_VERSION 128
| GUtility(), get a library version string.
#define | G_UTIL_INFO 129
| GUtility(), get a connection info string.
#define | G_UTIL_SLEEP 130
| GUtility(), specify an interval to sleep.
#define | G_UTIL_ADDRESSES 131
| GUtility(), get a list of available connections.
#define | G_UTIL_IPREQUEST 132
| GUtility(), get a list of hardware requesting IPs.
#define | G_UTIL_ASSIGN 133
| GUtility(), assign IP addresses over the network.
#define | G_UTIL_DEVICE_INITIALIZE 134
| GUtility(), sends CF, CW, EO etc. to initialize the connection. Useful after RS or other reset.
#define | G_UTIL_PING 135
| GUtility(), uses ICMP ping to determine if an IP address is reachable and assigned.
#define | G_UTIL_ERROR_CONTEXT 136
| GUtility(), provides additional error context, where available.
#define | G_UTIL_GCAPS_HOST 256
#define | G_UTIL_GCAPS_VERSION 257
| GUtility(), get the version of the gcaps server.
#define | G_UTIL_GCAPS_KEEPALIVE 258
| GUtility(), Deprecated 20210119. No longer functional.
#define | G_UTIL_GCAPS_ADDRESSES 259
| GUtility(), get a list of available connections from the gcaps server.
#define | G_UTIL_GCAPS_IPREQUEST 260
| GUtility(), get a list of hardware requesting IPs from the gcaps server.
#define | G_UTIL_GCAPS_ASSIGN 261
| GUtility(), assign IP addresses over the network from the gcaps server.
#define | G_UTIL_GCAPS_PING 262
| GUtility(), uses ICMP ping to determine if an IP address is reachable and assigned. Ping sent from the gcaps server.
#define | G_UTIL_GCAPS_LIST_SERVERS 263
| GUtility(), get a list of all available gcaps servers on the local network.
#define | G_UTIL_GCAPS_PUBLISH_SERVER 264
| GUtility(), make local gcaps server discoverable by other gcaps servers on the local network.
#define | G_UTIL_GCAPS_SET_SERVER 265
| GUtility(), set the new active gcaps server.
#define | G_UTIL_GCAPS_SERVER_STATUS 266
| GUtility(), get information on the local server's name and if it is published to the local network.
#define | G_UTIL_GCAPS_REMOTE_CONNECTIONS 267
| GUtility(), get a list of remote addresses connected to local server.
#define | G_UTIL_GCAPS_SERVER_INFO 268
#define | G_UTIL_GCAPS_ADDRESSES_GET_REMEMBERED 269
| GUtility(), returns true if gcaps is remembering ip assignments.
#define | G_UTIL_GCAPS_ADDRESSES_SET_REMEMBERED 270
| GUtility(), sets if gcaps should remember ip assignments.

## Typedefs
typedef int | GReturn
| Every function returns a value of type GReturn. See gclib_errors.h for possible values.
typedef struct Context * | GCon
| Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
typedef unsigned int | GSize
| Size of buffers, etc.
typedef int | GOption
| Option integer for various formatting, etc.
typedef char * | GCStringOut
| C-string output from the library. Implies null-termination.
typedef const char * | GCStringIn
| C-string input to the library. Implies null-termination.
typedef char * | GBufOut
| Data output from the library. No null-termination implied. Returned values may be null-terminated, see function documentation for details.
typedef const char * | GBufIn
| Data input to the library. No null-termination, function will have a GSize to indicate bytes to write .
typedef unsigned char | GStatus
| Interrupt status byte.
typedef void * | GMemory
| Pointer to untyped memory for use in GUtility().

## Functions
GCLIB_DEPRECATED GReturn | GOpen (GCStringIn connection_string, GCon *g)
| Open a connection to a Galil Controller.
GCLIB_DEPRECATED GReturn | GClose (GCon g)
| Closes a connection to a Galil Controller.
GCLIB_DEPRECATED GReturn | GCommand (GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize *bytes_returned)
| Performs a command-and-response transaction on the connection.
GCLIB_DEPRECATED GReturn | GProgramDownload (GCon g, GCStringIn program, GCStringIn preprocessor)
| Downloads a program to the controller's program buffer.
GCLIB_DEPRECATED GReturn | GProgramUpload (GCon g, GBufOut buffer, GSize buffer_len)
| Uploads a program from the controller's program buffer.
GCLIB_DEPRECATED GReturn | GArrayDownload (GCon g, const GCStringIn array_name, GOption first, GOption last, GCStringIn buffer)
| Downloads array data to a pre-dimensioned array in the controller's array table.
GCLIB_DEPRECATED GReturn | GArrayUpload (GCon g, const GCStringIn array_name, GOption first, GOption last, GOption delim, GBufOut buffer, GSize buffer_len)
| Uploads array data from the controller's array table.
GCLIB_DEPRECATED GReturn | GRecord (GCon g, union GDataRecord *record, GOption method)
| Provides a fresh copy of the controller's data record. Data is cast into a union, GDataRecord.
GCLIB_DEPRECATED GReturn | GMessage (GCon g, GCStringOut buffer, GSize buffer_len)
| Provides access to unsolicited messages from the controller.
GCLIB_DEPRECATED GReturn | GInterrupt (GCon g, GStatus *status_byte)
| Provides access to PCI and UDP interrupts from the controller.
GCLIB_DEPRECATED GReturn | GFirmwareDownload (GCon g, GCStringIn filepath)
| Upgrade firmware.
GCLIB_DEPRECATED GReturn | GRead (GCon g, GBufOut buffer, GSize buffer_len, GSize *bytes_read)
| Does nothing and returns G_GCLIB_ERROR.
GCLIB_DEPRECATED GReturn | GWrite (GCon g, GBufIn buffer, GSize buffer_len)
| Does nothing and returns G_GCLIB_ERROR.
GCLIB_DEPRECATED GReturn | GUtility (GCon g, GOption request, GMemory memory1, GMemory memory2)
| Does nothing and returns G_GCLIB_ERROR.

## Macro Definition Documentation

## ◆ GCLIB_DEPRECATED

#define GCLIB_DEPRECATED

Definition at line 35 of file gclib_compat.h.

## ◆ G_DR

#define G_DR 1

Value for GRecord() method variable for acquiring a data record via DR mode.

Definition at line 50 of file gclib_compat.h.

## ◆ G_QR

#define G_QR 0

Value for GRecord() method variable for acquiring a data record via QR mode.

Definition at line 51 of file gclib_compat.h.

## ◆ G_BOUNDS

#define G_BOUNDS -1

For functions that take range options, e.g. GArrayUpload(), use this value for full range.

Definition at line 52 of file gclib_compat.h.

## ◆ G_CR

#define G_CR 0

For GArrayUpload(), use this value in the delim field to delimit with carriage returns.

Definition at line 53 of file gclib_compat.h.

## ◆ G_COMMA

#define G_COMMA 1

For GArrayUpload(), use this value in the delim field to delimit with commas.

Definition at line 54 of file gclib_compat.h.

## ◆ G_PUBLISH_SERVER

#define G_PUBLISH_SERVER 1

For GPublishServer(), use this value to publish server to local network.

Definition at line 55 of file gclib_compat.h.

## ◆ G_REMOVE_SERVER

#define G_REMOVE_SERVER 0

For GPublishServer(), use this value to remove server from local network.

Definition at line 56 of file gclib_compat.h.

## ◆ G_USE_INITIAL_TIMEOUT [1/2]

#define G_USE_INITIAL_TIMEOUT -1

For GTimeout(), use this value to use initial GOpen() timeout (–timeout).

GUtility(), for timeout override. Set G_UTIL_TIMEOUT_OVERRIDE to this value to use initial GOpen() timeout (--timeout).

Definition at line 57 of file gclib_compat.h.

## ◆ G_SMALL_BUFFER

#define G_SMALL_BUFFER 1024

Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.

Definition at line 60 of file gclib_compat.h.

## ◆ G_HUGE_BUFFER

#define G_HUGE_BUFFER 524288

Most reads from Galil hardware are small. This value will hold the largest array or program upload/download possible.

Definition at line 61 of file gclib_compat.h.

## ◆ G_LINE_BUFFER

#define G_LINE_BUFFER 80

For writes, via command interpreter, to the Galil.

Definition at line 62 of file gclib_compat.h.

## ◆ G_UTIL_TIMEOUT

#define G_UTIL_TIMEOUT 1

GUtility(), Access to timeout.

Definition at line 65 of file gclib_compat.h.

## ◆ G_UTIL_TIMEOUT_OVERRIDE

#define G_UTIL_TIMEOUT_OVERRIDE 2

GUtility(), read/write access to timeout override.

Definition at line 66 of file gclib_compat.h.

## ◆ G_USE_INITIAL_TIMEOUT [2/2]

#define G_USE_INITIAL_TIMEOUT -1

For GTimeout(), use this value to use initial GOpen() timeout (–timeout).

GUtility(), for timeout override. Set G_UTIL_TIMEOUT_OVERRIDE to this value to use initial GOpen() timeout (--timeout).

Definition at line 57 of file gclib_compat.h.

## ◆ G_UTIL_VERSION

#define G_UTIL_VERSION 128

GUtility(), get a library version string.

Definition at line 68 of file gclib_compat.h.

## ◆ G_UTIL_INFO

#define G_UTIL_INFO 129

GUtility(), get a connection info string.

Definition at line 69 of file gclib_compat.h.

## ◆ G_UTIL_SLEEP

#define G_UTIL_SLEEP 130

GUtility(), specify an interval to sleep.

Definition at line 70 of file gclib_compat.h.

## ◆ G_UTIL_ADDRESSES

#define G_UTIL_ADDRESSES 131

GUtility(), get a list of available connections.

Definition at line 71 of file gclib_compat.h.

## ◆ G_UTIL_IPREQUEST

#define G_UTIL_IPREQUEST 132

GUtility(), get a list of hardware requesting IPs.

Definition at line 72 of file gclib_compat.h.

## ◆ G_UTIL_ASSIGN

#define G_UTIL_ASSIGN 133

GUtility(), assign IP addresses over the network.

Definition at line 73 of file gclib_compat.h.

## ◆ G_UTIL_DEVICE_INITIALIZE

#define G_UTIL_DEVICE_INITIALIZE 134

GUtility(), sends CF, CW, EO etc. to initialize the connection. Useful after RS or other reset.

Definition at line 74 of file gclib_compat.h.

## ◆ G_UTIL_PING

#define G_UTIL_PING 135

GUtility(), uses ICMP ping to determine if an IP address is reachable and assigned.

Definition at line 75 of file gclib_compat.h.

## ◆ G_UTIL_ERROR_CONTEXT

#define G_UTIL_ERROR_CONTEXT 136

GUtility(), provides additional error context, where available.

Definition at line 76 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_HOST

#define G_UTIL_GCAPS_HOST 256

Definition at line 78 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_VERSION

#define G_UTIL_GCAPS_VERSION 257

GUtility(), get the version of the gcaps server.

Definition at line 79 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_KEEPALIVE

#define G_UTIL_GCAPS_KEEPALIVE 258

GUtility(), Deprecated 20210119. No longer functional.

Definition at line 80 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_ADDRESSES

#define G_UTIL_GCAPS_ADDRESSES 259

GUtility(), get a list of available connections from the gcaps server.

Definition at line 81 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_IPREQUEST

#define G_UTIL_GCAPS_IPREQUEST 260

GUtility(), get a list of hardware requesting IPs from the gcaps server.

Definition at line 82 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_ASSIGN

#define G_UTIL_GCAPS_ASSIGN 261

GUtility(), assign IP addresses over the network from the gcaps server.

Definition at line 83 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_PING

#define G_UTIL_GCAPS_PING 262

GUtility(), uses ICMP ping to determine if an IP address is reachable and assigned. Ping sent from the gcaps server.

Definition at line 84 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_LIST_SERVERS

#define G_UTIL_GCAPS_LIST_SERVERS 263

GUtility(), get a list of all available gcaps servers on the local network.

Definition at line 85 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_PUBLISH_SERVER

#define G_UTIL_GCAPS_PUBLISH_SERVER 264

GUtility(), make local gcaps server discoverable by other gcaps servers on the local network.

Definition at line 86 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_SET_SERVER

#define G_UTIL_GCAPS_SET_SERVER 265

GUtility(), set the new active gcaps server.

Definition at line 87 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_SERVER_STATUS

#define G_UTIL_GCAPS_SERVER_STATUS 266

GUtility(), get information on the local server's name and if it is published to the local network.

Definition at line 88 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_REMOTE_CONNECTIONS

#define G_UTIL_GCAPS_REMOTE_CONNECTIONS 267

GUtility(), get a list of remote addresses connected to local server.

Definition at line 89 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_SERVER_INFO

#define G_UTIL_GCAPS_SERVER_INFO 268

Definition at line 90 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_ADDRESSES_GET_REMEMBERED

#define G_UTIL_GCAPS_ADDRESSES_GET_REMEMBERED 269

GUtility(), returns true if gcaps is remembering ip assignments.

Definition at line 91 of file gclib_compat.h.

## ◆ G_UTIL_GCAPS_ADDRESSES_SET_REMEMBERED

#define G_UTIL_GCAPS_ADDRESSES_SET_REMEMBERED 270

GUtility(), sets if gcaps should remember ip assignments.

Definition at line 92 of file gclib_compat.h.

## Typedef Documentation

## ◆ GReturn

typedef int GReturn

Every function returns a value of type GReturn. See gclib_errors.h for possible values.

Definition at line 94 of file gclib_compat.h.

## ◆ GCon

typedef struct Context* GCon

Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().

Definition at line 95 of file gclib_compat.h.

## ◆ GSize

typedef unsigned int GSize

Size of buffers, etc.

Definition at line 96 of file gclib_compat.h.

## ◆ GOption

typedef int GOption

Option integer for various formatting, etc.

Definition at line 97 of file gclib_compat.h.

## ◆ GCStringOut

typedef char* GCStringOut

C-string output from the library. Implies null-termination.

Definition at line 98 of file gclib_compat.h.

## ◆ GCStringIn

typedef const char* GCStringIn

C-string input to the library. Implies null-termination.

Definition at line 99 of file gclib_compat.h.

## ◆ GBufOut

typedef char* GBufOut

Data output from the library. No null-termination implied. Returned values may be null-terminated, see function documentation for details.

Definition at line 100 of file gclib_compat.h.

## ◆ GBufIn

typedef const char* GBufIn

Data input to the library. No null-termination, function will have a GSize to indicate bytes to write .

Definition at line 101 of file gclib_compat.h.

## ◆ GStatus

typedef unsigned char GStatus

Interrupt status byte.

Definition at line 102 of file gclib_compat.h.

## ◆ GMemory

typedef void* GMemory

Pointer to untyped memory for use in GUtility().

Definition at line 103 of file gclib_compat.h.

## Function Documentation

## ◆ GRead()

GCLIB_DEPRECATED GReturn GRead | ( | GCon | g,
|  | GBufOut | buffer,
|  | GSize | buffer_len,
|  | GSize * | bytes_read )

Does nothing and returns G_GCLIB_ERROR.

Deprecated
  This function only exists for ABI compatibility, and will be removed in a future gclib version.

## ◆ GWrite()

GCLIB_DEPRECATED GReturn GWrite | ( | GCon | g,
|  | GBufIn | buffer,
|  | GSize | buffer_len )

Does nothing and returns G_GCLIB_ERROR.

Deprecated
  This function only exists for ABI compatibility, and will be removed in a future gclib version.

## ◆ GUtility()

GCLIB_DEPRECATED GReturn GUtility | ( | GCon | g,
|  | GOption | request,
|  | GMemory | memory1,
|  | GMemory | memory2 )

Does nothing and returns G_GCLIB_ERROR.

Deprecated
  This function only exists for ABI compatibility, and will be removed in a future gclib version.