| gclib 1.35.5 Communications API for Galil controllers and PLCs |

## ◆ GAddresses()

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 connection addresses.

Note
  Serial ports are listed, e.g. COM1. Upon open, it may be necessary to specify a baud rate for the controller, e.g. `--baud 19200`. Default baud is 115200. See GOpen().

Parameters

  addresses | Buffer to hold the output string. Buffer will be null terminated, even if the data must be truncated to do so. See below for more information.
  addresses_len | Length of buffer.

Returns
  The success status or error code of the function. See gclib_errors.h for possible values.

If gcaps is available, the listing will come from the server via G_UTIL_GCAPS_ADDRESSES. In the absence of the server, gclib will use G_UTIL_ADDRESSES to generate the list.

- Ethernet controllers will be listed as ip_address, revision_report, network_adapter_name, network_adapter_ip_address. If an IP address is unreachable via ping, the address will be in parentheses.
- PCI controllers will be listed by their identifier, e.g. GALILPCI1.
- Serial ports will be listed by their identifier, e.g. COM1.

    10.1.3.91, DMC4020 Rev 1.2e, LAN, 10.1.3.10
    192.168.0.63, DMC4040 Rev 1.2f, Static, 192.168.0.41
    (192.0.0.42), RIO47102 Rev 1.1j, Static, 192.168.0.41
    GALILPCI1
    COM1
    COM2

Note
  GAddresses() will take up to 1 second to look for gcaps.

See x_examples.cpp for an example.

Definition at line 54 of file gclibo.c.

References G_NO_ERROR, G_UTIL_ADDRESSES, G_UTIL_GCAPS_ADDRESSES, and GUtility().