Remarks – Echelon OpenLDV User Manual

Page 34

Advertising
background image

26

Using the OpenLDV API

Table 13. ldv_open_cap() Parameters

Parameter

Direction Description

szDevice

Input

The network interface with which to establish

communication. For example, “LON1” could be used to

identify a U10, PCLTA-10, or PCLTA-21 network interface.

Or, “X.Default.1MainStreet” could be used to identify a

SmartServer that will be opened through xDriver.

pHandle

Output

A pointer to a variable that you can use to identify the

network interface with the other OpenLDV functions. This

handle is valid only if the function returns LDV_OK.

nDeviceCaps

Input

The requested operational mode for the network interface.

For example, a USB network interface can be opened as a

Layer 2 or a Layer 5 network interface by specifying the

appropriate LDVDeviceCaps value (LDV_DEVCAP_L2 or

LDV_DEVCAP_L5).

hWnd

Input

The Windows handle for the session state change or

attachment notification messages, where available (for

example, from an xDriver device or a USB network

interface).
If NULL, no notification messages are sent.

tag

Input

Correlates notification messages with sessions. This tag is

supplied as the LPARAM parameter of all session state

change messages.

Remarks

This function is an extended version of the ldv_open() and ldvx_open()

functions that additionally allows you to request the operational mode in which

to open the specified device. If supported by the network interface, this function

allows you to request Layer 2 or Layer 5 operational mode, or request that

communications with the device (the ldv_read() and ldv_write() functions) use

the SICB format or the extended LdvEx format (which includes the SICB data).

See Application Buffer Structure on page 58 for a description of the SICB and

LdvEx formats.
This function returns LDV_OK if the network interface is successfully opened.

In this case, the function also returns a handle that you can use to identify the

network interface with the other OpenLDV functions. Use the ldv_close()

function to close the session with the network interface.
If the device does not support the requested capability, the error

LDV_CAPABILITY_NOT_SUPPORTED is returned, and the device is not

opened. Note that remote network interfaces (RNIs) are Layer 5 only. Protocol

analyzer usage (supported by SmartServers and i.LON 600 RNI devices) is

similar to Layer 2 (but receive-only). IP-852 channels cannot be opened by an

OpenLDV application.

Advertising