Ldv_close(), Ldv_free_device_info(), Syntax – Echelon OpenLDV User Manual

Page 26: Remarks

Advertising
background image

18

Using the OpenLDV API

See Structures and Enumerations for the Driver API on page 42 for descriptions

of the structures and enumerations used by the OpenLDV API. See OpenLDV

API Return Codes on page 44 for descriptions of the return codes.

ldv_close()

Call this function to close a network interface that has been previously opened

with the ldv_open() function.

Syntax

LDVCode ldv_close(

LdvHandle handle

)

Table 4. ldv_close() Parameters

Parameter

Direction Description

handle

Input

The network interface to be closed. This value was returned

as the handle parameter when you opened the network

interface with one of the open functions (ldv_open(),

ldv_open_cap(), or ldvx_open()).

Remarks

Use this function to close an OpenLDV session and end communication between

your application and the network interface involved in the session. This function

also frees any resources assigned to the network interface and the handle

assigned to the session. This function returns LDV_OK if the network interface

is successfully closed; if so, other processes on your computer can access the

network interface.
Each successful ldv_open(), ldv_open_cap(), or ldvx_open() call (including

nested ones) must have a matching ldv_close() call. The OpenLDV driver does

not close a network interface until the last ldv_close() function is called. See

also ldvx_shutdown() on page 37.
If you attempt to close a network interface that has not been previously opened,

or has already been closed, the LDV_NOT_OPEN code is returned. If the

handle parameter is not valid, the LDV_INVALID_DEVICE_ID code is

returned.
Recommendation: Add a delay of at least one second before you call the

ldv_open() function after calling ldv_close() for a particular network interface.

ldv_free_device_info()

Call this function to release resources allocated by the ldv_get_device_info()

function.

Advertising