Ldv_register_event(), Syntax, Remarks – Echelon OpenLDV User Manual

Page 37

Advertising
background image

OpenLDV Programmer’s Guide

29

format, the maximum length of a message is 257 bytes, and so you should use a

buffer length of at least 257 bytes to guarantee that any message can be buffered.

If your device uses the LdvEx format, you must allocate additional buffer space.
If the handle parameter is not valid, the LDV_INVALID_DEVICE_ID code is

returned. If the network interface referenced by the handle parameter has not

been opened by your process, then the LDV_NOT_OPEN code is returned if the

handle references a local network interface. If the handle references a failed

remote network interface, or if the session has failed, the

LDVX_READ_FAILED code is returned.

ldv_register_event()

Call this function to register a Windows event object to be signaled whenever a

message is available to be read from a network interface.

Syntax

LDVCode ldv_register_event(

LdvHandle handle,

HANDLE event

)

Table 15. ldv_register_event() Parameters

Parameter

Direction Description

handle

Input

The network interface device that will cause the Windows

event object to be signaled. 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()).

event

Input

The Windows event object to be signaled each time a

message is received. You can use the Windows

CreateEvent() and CloseHandle() functions to create and

destroy a Windows event object suitable for use with the

ldv_register_event() function.

Remarks

Use this function to register for notification of incoming messages from the

network interface. When the network interface receives a message, the Windows

event object referenced by the event parameter is signaled.
This event signals the availability of one or more messages to be read. When the

Windows event object is signaled, the OpenLDV application should call the

ldv_read() function repeatedly until all available uplink messages have been

read.

Advertising