Windows registry entries – Echelon OpenLDV User Manual

Page 158

Advertising
background image

150

Custom Network Interface

OR of the LDV_DEVCAP_L5 and LDV_DEVCAP_SICB

enumeration values.

g. Set the capsMask to suitable current capabilities of the device.

When creating the device, you generally set this parameter to the

same values as the caps parameter.

h. Set the transId to the transceiver ID of the custom network

interface, as appropriate.

i. Set the driverId to the driver specified in the

ldv_set_driver_info() function in step 2 on page 149.

LDVDeviceInfo myDevice =

{ (DWORD)sizeof(LDVDeviceInfo),

(LDVDriverInfo)NULL,

(LPCSTR)myDeviceName,

(LPCSTR)myDevicePhysName,

(LDVDeviceCaps)LDV_DEVCAP_L5 | LDV_DEVCAP_SICB,

(LDVDeviceCaps)LDV_DEVCAP_L5 | LDV_DEVCAP_SICB,

(BYTE)myTransID,

(LDVDriverID)myDriver

};

5. Call the ldv_set_device_info() function:

LDVCode rc = ldv_set_device_info(

myDevice.name,

*myDevice);

After completing these steps, OpenLDV applications can use the other OpenLDV

API functions to communicate with the custom network interface.

Windows Registry Entries

The installation program for the custom network interface must create a subkey

for the device driver within the \HKEY_LOCAL_MACHINE

\SOFTWARE\LonWorks\DeviceDrivers Windows registry path. The name

of this subkey must be the logical name for the custom network interface; this

logical name is what is displayed to the user (for example, within the L

ON

W

ORKS

Interfaces Control Panel application) or to the application. You can use any

name that identifies the custom network interface, or you can follow the legacy

“LON1” naming convention.
Within the custom network interface’s subkey, you must create the following

registry entry:

Value name — device name

Data type — REG_SZ (a string value)

Value — The custom network interface’s physical device name, as set by

Windows for the device driver, with the format \\.\name.0

You must ensure that the value for the device name matches the logical name

that you assign for the device.
Example: If the installed device driver for the custom network interface is

assigned the physical device name \\.\MyCustomLON1.0, then the logical name

Advertising