Echelon OpenLDV Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Oprogramowanie Echelon OpenLDV. Echelon OpenLDV User Manual Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 194
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów

Podsumowanie treści

Strona 1 - Programmer’s Guide

OpenLDV Programmer’s Guide078-0275-01D

Strona 2

2 Introduction Introduction to OpenLDV Networking The OpenLDV driver allows a Windows application to communicate with a LONWORKS network through a lo

Strona 3 - Audience

92 The OpenLDV Developer Example Developer Example Diagram Figure 7 shows the hierarchy of the classes described in this chapter. ldv32.dllldv_open

Strona 4 - Related Documentation

OpenLDV Programmer’s Guide 93 5 Using the xDriver Default Profile This chapter describes how to use the xDriver default profile. It also

Strona 5 - Table of Contents

94 Using the xDriver Default Profile Configuring an xDriver Profile You can edit an xDriver profile to configure a number of parameters that impact h

Strona 6

OpenLDV Programmer’s Guide 95 Figure 9. xDriver Profile General Tab You can edit the description of the xDriver profile by modifying the tex

Strona 7

96 Using the xDriver Default Profile Figure 10. xDriver Profile Downlink Sessions Tab 4. Select the Uplink Sessions tab to configure how xDriver ma

Strona 8

OpenLDV Programmer’s Guide 97 For xDriver to receive these requests for connection, the xDriver Connection Broker must be running. For infor

Strona 9 - Introduction

98 Using the xDriver Default Profile Figure 13. xDriver Profile Recovery Options Tab You can configure xDriver to automatically attempt reconnection

Strona 10 - ONWORKS network:

OpenLDV Programmer’s Guide 99 6 Extending xDriver You can extend xDriver by creating custom xDriver lookup extension components, and addi

Strona 11 - Client Applications

100 Extending xDriver Extending xDriver The OpenLDV driver software includes the LONWORKS Interfaces application, which you can use to create entrie

Strona 12 - Network Interfaces

OpenLDV Programmer’s Guide 101 of the downlink lookup key. Chapter 7, LNS Programming with xDriver, on page 137, provides programming samples

Strona 13

OpenLDV Programmer’s Guide 3 Client Applications OpenLDV applications, such as the LNS Server and the LonScanner Protocol Analyzer, use the O

Strona 14 - Installing the OpenLDV SDK

102 Extending xDriver Figure 15 on page 103 shows the flow of events that occur when a downlink session is initiated within the session-initiating LN

Strona 15

OpenLDV Programmer’s Guide 103 Call ObjectServer.open()Does the networkexist?Get the network from Local network collectionAdd the network to

Strona 16

104 Extending xDriver The events shown in Figure 15 that occur within the LNS application represent a typical LNS application that opens a downlink s

Strona 17 - Using the OpenLDV API

OpenLDV Programmer’s Guide 105 identification message from the RNI that requested the uplink session. From this message, the Connection Brok

Strona 18 - ONWORKS network

106 Extending xDriver on page 142. You can also use the xDriver Profile Editor to specify a command to run each time that the listener port for that

Strona 19

OpenLDV Programmer’s Guide 107 Call ObjectServer.open()AcceptIncoming Call?Get network from Local network collectionYesCall myNetwork.open()O

Strona 20 - Application Layer

108 Extending xDriver The events shown in Figure 17 that occur within the LNS application represent a typical LNS application that registers for upli

Strona 21 - Overview of the OpenLDV API

OpenLDV Programmer’s Guide 109 Field Description Uplink Lookup Key The uplink lookup key is an ASCII string (105 characters maximum) passed

Strona 22

110 Extending xDriver Field Description Next Authentication Key This field represents the next authentication key to be used by the RNI. The next

Strona 23 - The OpenLDV API

OpenLDV Programmer’s Guide 111 Field Description Remote TCP Address The TCP/IP address of the RNI to which to connect. For an uplink sessi

Strona 24 - ONWORKS name (such as

4 Introduction Network Interfaces A local network interface (one that is physically connected to the computer running the OpenLDV driver) uses its ow

Strona 25

112 Extending xDriver unique, 32-character hexadecimal string representing the 128-bit MD5 key that is used by the RNI. The xDriver lookup interface

Strona 26

OpenLDV Programmer’s Guide 113 Table 36. Changing Authentication Keys Phase One, Lookup Extension Component Is Called Initially, the current

Strona 27

114 Extending xDriver Prerequisite: You must install the OpenLDV 4.0 SDK and Microsoft Visual Studio 2008 SP1 (or later). Important: If you use t

Strona 28

OpenLDV Programmer’s Guide 115 Figure 19. Visual Studio New Project Dialog In the New Project dialog: • Expand the C++ category and select

Strona 29

116 Extending xDriver Figure 20. Visual Studio ATL Project Wizard Click Finish to close the ATL Project Wizard and create the project. Add a COM Obj

Strona 30

OpenLDV Programmer’s Guide 117 Figure 21. Visual Studio Add Class Dialog From the Add Class dialog, select the ATL category, select the ATL

Strona 31

118 Extending xDriver Figure 22. Visual Studio ATL Simple Object Wizard – Names Page From the ATL Simple Object Wizard Names page, enter a name for

Strona 32

OpenLDV Programmer’s Guide 119 From the ATL Simple Object Wizard, select the Options page, as shown in Figure 23. Figure 23. Visual Studio A

Strona 33

120 Extending xDriver Figure 24. Visual Studio Implement Interface Wizard Within the Implement Interface wizard, select Echelon OpenLDV xDriver 1.0

Strona 34

OpenLDV Programmer’s Guide 121 } STDMETHOD(SetOptions)(BSTR options) { return E_NOTIMPL; } // ILdvxLookup Methods public: ST

Strona 35

OpenLDV Programmer’s Guide 5 connections with a group of remote networks. For example, you could have hundreds of remote networks, each of w

Strona 36

122 Extending xDriver Project : error PRJ0050: Failed to register output. Please try enabling Per-user Redirection or register the component from a

Strona 37

OpenLDV Programmer’s Guide 123 Figure 26. OpenLDV xDriver Profile Properties – General Tab 6. For the Lookup tab of the OpenLDV xDriver Pr

Strona 38

124 Extending xDriver Figure 27. OpenLDV xDriver Profile Properties – Lookup Tab 7. Make any other changes that are appropriate for your custom pr

Strona 39

OpenLDV Programmer’s Guide 125 interface ILdvxConfigure; // add to coclass SampleLookupCsv • Add additional private methods and properties t

Strona 40

126 Extending xDriver Figure 28. Visual Studio New Project Dialog In the New Project dialog: • Expand the Visual Basic category and select Class Li

Strona 41

OpenLDV Programmer’s Guide 127 Click OK to create the project. Add a Reference to the xDriver Type Library From the Visual Studio main window

Strona 42

128 Extending xDriver Figure 30. Visual Studio Add New Item Dialog Select COM Class as the template. This template generates the proper GUIDs and t

Strona 43

OpenLDV Programmer’s Guide 129 Figure 31. Delete Class1.vb Import xDriver Types to Your System Namespace Add the following lines to the begi

Strona 44

130 Extending xDriver Figure 32. Visual Studio Object Browser View Your class must implement the DownlinkLookup, UpdateLookup, and UplinkLookup memb

Strona 45

OpenLDV Programmer’s Guide 131 2. Click Add to open the New Profile dialog, as shown in Figure 33. Figure 33. xDriver Profile Editor New P

Strona 46 - LDVDevices Structure

6 Introduction See the OpenLDV 4.0 ReadMe document for updates to the OpenLDV driver documentation. To develop an OpenLDV application or xDriver exte

Strona 47 - LdvCombineFlags Enumeration

132 Extending xDriver 6. For the Lookup tab of the OpenLDV xDriver Profile Properties dialog for the new profile, select the newly built profile fro

Strona 48 - LdvDeviceCaps Enumeration

OpenLDV Programmer’s Guide 133 • Windows Vista or Windows 7: \Users\Public\Documents \LonWorks\OpenLDV SDK\xDriver API Examples • Windows

Strona 49

134 Extending xDriver these fields should only be updated from the UpdateLookup function. The database configuration interface that you create must

Strona 50 - LDVDriverInfo Structure

OpenLDV Programmer’s Guide 135 installing the software does not return the default values to these profiles. However, the xDriver Profile Ed

Strona 51 - LdvDriverID Enumeration

136 Extending xDriver Figure 36. Services Administrative Control Panel Applet 3. To start the Connection Broker, right-click Echelon xDriver Connec

Strona 52 - LdvDriverType Enumeration

OpenLDV Programmer’s Guide 137 7 LNS Programming with xDriver This chapter describes sample programs to assist you when creating LNS appl

Strona 53 - OpenLDV API Return Codes

138 LNS Programming with xDriver Downlink Sample Applications LNS applications that manage downlink sessions operate like any other type of network

Strona 54

OpenLDV Programmer’s Guide 139 lcaOS.Open 'Add a new network object and open the 'network database. “Network1” represents the nam

Strona 55

140 LNS Programming with xDriver Figure 37. Downlink Application Form This application can open either of the two remote LONWORKS networks by clicki

Strona 56

OpenLDV Programmer’s Guide 141 Set curRNI = NIs.Item("X.Default.RNI-0001") 'Set the variable curRNI as the 'network

Strona 57 - ONWORKS Interfaces

OpenLDV Programmer’s Guide 7 information about xDriver extensions, see Chapter 6, Extending xDriver, on page 99. Getting Started with the Ope

Strona 58

142 LNS Programming with xDriver Private Sub CloseNetB_Click() OpenNetB.Enabled = True CloseNetB.Enabled = False g_SystemB.Close g_N

Strona 59

OpenLDV Programmer’s Guide 143 be called from the Timer1_Timer() function after the next timer control interval expires. The StartButton_Cli

Strona 60

144 LNS Programming with xDriver 'local. m_cOS.SingleUserMode = False 'Allow multiple applications to access

Strona 61

OpenLDV Programmer’s Guide 145 ByVal DataPoint As Object, ByVal srcaddr As Object) Dim src_addr As LcaSourceAddress Set src_addr = sr

Strona 62 - msgSize);

146 LNS Programming with xDriver 'event and will now close the monitor points 'and the network. m_gbIn

Strona 63

OpenLDV Programmer’s Guide 147 A Custom Network Interfaces This appendix provides high-level guidance for working with a custom network inte

Strona 64

148 Custom Network Interface Overview Echelon and other manufacturers provide a wide selection of network interfaces for different LONWORKS channel t

Strona 65

OpenLDV Programmer’s Guide 149 close calls. The OpenLDV driver calls these driver functions to interact with the custom network interface. Y

Strona 66 - Application Buffer Structure

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

Strona 67

OpenLDV Programmer’s Guide 151 for the custom network interface should be “MyCustomLON1”. The subkey for the device within the registry shou

Strona 68

8 Introduction Table 1. NI Application Settings Network Interface NI Application Setting for Layer 2 Image NI Application Setting for Layer 5 Image P

Strona 70 - Message Header

OpenLDV Programmer’s Guide 153 B LNS Methods and Events for xDriver Support This appendix describes the methods and events that are included

Strona 71 - ExpMsgHdr

154 LNS Methods and Events for xDriver Support xDriver Methods and Events This appendix describes the LNS methods and events you use when creating an

Strona 72

OpenLDV Programmer’s Guide 155 automatically. The session establishment time for a profile can be configured using the xDriver Profile Edito

Strona 73 - NetVarHdr

156 LNS Methods and Events for xDriver Support Syntax objServer.EndIncomingSessionEvents xDriverProfileName Table 39. EndIncomingSessionEvents Parame

Strona 74 - ONWORKS transceivers

OpenLDV Programmer’s Guide 157 Element Description stringExpression A string type specifying the name of the object to retrieve. For xDriv

Strona 75 - Network Address

158 LNS Methods and Events for xDriver Support Element Description netName A string that represents the LNS network name of the network that reques

Strona 76

OpenLDV Programmer’s Guide 159 Recommendation: Open the network in server-independent mode when you plan to use this method, because using t

Strona 78 - RcvAddrDtl

OpenLDV Programmer’s Guide 161 C Custom Lookup Extension Component Programming This appendix describes the interfaces and methods that your

Strona 79

OpenLDV Programmer’s Guide 9 2 Using the OpenLDV API This chapter describes the OpenLDV API functions and types, including the input and ou

Strona 80 - RespAddrDtl

162 Custom Lookup Extension Component Programming Overview This appendix describes the interfaces and methods that your custom lookup extension compo

Strona 81 - Message Data

OpenLDV Programmer’s Guide 163 Syntax C++ STDMETHOD(SetInstance)(BSTR instance) Visual Basic Sub SetInstance(ByVal instance As String) Tab

Strona 82 - ExplicitMsg

164 Custom Lookup Extension Component Programming ILdvxLookup Interface The lookup interface is the primary interface implemented by an xDriver looku

Strona 83

OpenLDV Programmer’s Guide 165 E_HANDLE, LDVX_E_INVALID_DOWNLINK_KEY, or LDVX_E_LOOKUP_FAILURE. UpdateLookup Method Applies to: xDriver Look

Strona 84 - Downlink Commands

166 Custom Lookup Extension Component Programming The ILdvxSCO interface provides methods that you can use to obtain the uplink lookup key and fill i

Strona 85 - Network Interface Commands

OpenLDV Programmer’s Guide 167 Field Name Called From DownlinkLookup UplinkLookup UpdateLookup Uplink Key Read/Write Read Only Read Only

Strona 86

168 Custom Lookup Extension Component Programming Syntax C++ STDMETHOD(GetAdditionalDownlinkPacketTrailer)(BSTR * hexBytes) Visual Basic Function G

Strona 87

OpenLDV Programmer’s Guide 169 Syntax C++ STDMETHOD(GetCurrentAuthenticationKey)(BSTR * authKey) Visual Basic Function GetCurrentAuthentica

Strona 88

170 Custom Lookup Extension Component Programming GetEncryptionType Method Applies to: Session Control Object This method obtains the type of encryp

Strona 89

OpenLDV Programmer’s Guide 171 GetNextAuthenticationKey Method Applies to: Session Control Object This method obtains the next xDriver authe

Strona 90

10 Using the OpenLDV API Introduction to OpenLDV Programming An application that uses the OpenLDV API is called an OpenLDV application. The communic

Strona 91

172 Custom Lookup Extension Component Programming GetUplinkKey Method Applies to: Session Control Object This method obtains the xDriver uplink look

Strona 92

OpenLDV Programmer’s Guide 173 Table 59. SetAdditionalDownlinkPacketHeader Parameters Parameter Description hexBytes Hexadecimal string con

Strona 93

174 Custom Lookup Extension Component Programming For more information about how the xDriver lookup extension component handles authentication, see A

Strona 94

OpenLDV Programmer’s Guide 175 Table 62. SetCurrentAuthenticationKey Parameters Parameter Description authKey xDriver authentication key fo

Strona 95

176 Custom Lookup Extension Component Programming must set this value appropriately depending on the RNI used. The default value is LDVX_ENCRYPTION_

Strona 96

OpenLDV Programmer’s Guide 177 Table 65. SetLNSNetworkName Parameters Parameter Description lnsNetwork LNS network name as String (a maximu

Strona 97

178 Custom Lookup Extension Component Programming SetUplinkKey Method Applies to: Session Control Object This method sets the uplink lookup key. Th

Strona 98 - Dispatchers

OpenLDV Programmer’s Guide 179 GetRemoteTCPAddress Method Applies to: Session Control Object This method obtains the remote TCP address of t

Strona 99 - Toolkits and User Interface

180 Custom Lookup Extension Component Programming Table 70. GetRemoteTCPPort Parameters Parameter Description tcpPort Integer variable that stores

Strona 100 - Developer Example Diagram

OpenLDV Programmer’s Guide 181 This method sets the remote TCP port that the RNI at the other end of the connection uses to receive connectio

Strona 101 - ONWORKS

OpenLDV Programmer’s Guide 11 the seven layers of the OSI Model and which OSI layers a Layer 2 or Layer 5 network interface handles. Physical

Strona 102

182 Custom Lookup Extension Component Programming Table 73. GetNeuronID Parameters Parameter Description nNeuronID String variable that stores the

Strona 103

OpenLDV Programmer’s Guide 183 Index A AcceptIncomingSession, 154 ANSI/CEA 709.1-B, 10 API devices and drivers, 16 enumerations, 37, 42 examp

Strona 104

184 Index GetRemoteTCPPort, 179 GetSessionControlObjectID, 171 GetUplinkKey, 172 H hardware requirements, 5

Strona 105

OpenLDV Programmer’s Guide 185 N NetVarHdr, 65 network address, 67 network interface application settings, 7 command interface, 76 custom, 14

Strona 107 - Extending xDriver

Echelon, i.LON, LonMaker, LONMARK, LonTalk, LONWORKS, LNS, Neuron, NodeBuilder, 3120, 3150, and the Echelon logo are trademarks of Echelon Corporation

Strona 108 - Downlink Sessions

12 Using the OpenLDV API Application LayerOpenLDV APIPresentation LayerOpenLDV ApplicationOpenLDV Driver (Ldv32.dll)SLTA Link LayerPCLTA Link LayerPC

Strona 109

OpenLDV Programmer’s Guide 13 The OpenLDV API does not include an application layer. However, the OpenLDV Developer Example demonstrates how

Strona 110 - 102 Extending xDriver

14 Using the OpenLDV API Referencing the OpenLDV Component You can develop applications that use the OpenLDV API with any Windows application develop

Strona 111 - Typical Downlink Scenario

OpenLDV Programmer’s Guide 15 The OpenLDV API This section describes the functions included in the OpenLDV API. Table 3 summarizes these fun

Strona 112 - Uplink Sessions

16 Using the OpenLDV API Function Description Added in OpenLDV Version ldv_read() Reads a message from an open session. 1.0 ldv_register_event() R

Strona 113

OpenLDV Programmer’s Guide 17 • The ldv_set_device_info() function allows you to modify certain information for a device. • The ldv_get_m

Strona 114 - ONWORKS network, in a

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 th

Strona 115 - Typical Uplink Scenario

OpenLDV Programmer’s Guide 19 Syntax LDVCode ldv_free_device_info( const LDVDeviceInfo* pDeviceInfo ) Table 5. ldv_free_devi

Strona 116 - Session Control Object

20 Using the OpenLDV API ldv_free_matching_devices() Call this function to release resources allocated by the ldv_get_matching_devices() function. Sy

Strona 117

OpenLDV Programmer’s Guide 21 Remarks Use this function to retrieve device information about a LONWORKS interface device. This function r

Strona 118

OpenLDV Programmer’s Guide iii Welcome This document describes Echelon’s OpenLDV™ Release 4.0 Network Driver and Software Development Kit (SDK

Strona 119 - Authentication Key Handling

22 Using the OpenLDV API ldv_get_matching_devices() Call this function to retrieve information about all LONWORKS interface devices that match a set

Strona 120

OpenLDV Programmer’s Guide 23 Remarks This function returns a string for the version number of the OpenLDV driver being used: • OpenLDV 1.0

Strona 121

24 Using the OpenLDV API along with other data, such as timestamp data, that could be useful for some applications). See Application Buffer Structur

Strona 122

OpenLDV Programmer’s Guide 25 the network interface enters an initial quiet mode (flush state) after a reset. To start using such a network

Strona 123 - ONWORKS \xDriver\Components

26 Using the OpenLDV API Table 13. ldv_open_cap() Parameters Parameter Direction Description szDevice Input The network interface with which to

Strona 124 - Add a COM Object

OpenLDV Programmer’s Guide 27 For local network interfaces, after the ldv_open_cap() function returns the LDV_OK success code, the network in

Strona 125

28 Using the OpenLDV API Table 14. ldv_read() Parameters Parameter Direction Description handle Input The network interface device to be read. T

Strona 126

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 byt

Strona 127

30 Using the OpenLDV API To de-register a current event and register a new event, call ldv_register_event()with a new event parameter. You can also

Strona 128

OpenLDV Programmer’s Guide 31 specify the Windows device path, for example, \\.\MYLON1.0. See Appendix A, Custom Network Interfaces, on page

Strona 129

iv Examples Throughout this guide, C++, Visual Basic, and other language programming samples are used to illustrate concepts. To make these samples m

Strona 130

32 Using the OpenLDV API Table 17. ldv_set_driver_info() Parameters Parameter Direction Description nDriverId Input The driver ID of the driver t

Strona 131

OpenLDV Programmer’s Guide 33 Table 18. ldv_write() Parameters Parameter Direction Description handle Input The LONWORKS interface devic

Strona 132 - Optional Steps

34 Using the OpenLDV API Syntax LDVCode ldv_xlate_device_name( LPCSTR device_name, LPSTR driver_name, int* driver_name_len ) Tabl

Strona 133

OpenLDV Programmer’s Guide 35 Table 20. ldvx_open() Parameters Parameter Direction Description id Input The LONWORKS interface device wi

Strona 134

36 Using the OpenLDV API information. If you do not specify a valid network interface name as the id parameter when you call this function, or if th

Strona 135 - Add a COM Class

OpenLDV Programmer’s Guide 37 Parameter Direction Description tag Input Correlates notification messages with sessions. This tag is supp

Strona 136

38 Using the OpenLDV API /* (read-only) */ typedef const LDVDeviceInfo* LDVDeviceInfoPtr; The LDVDeviceInfo structure contains info

Strona 137

OpenLDV Programmer’s Guide 39 typedef struct LDVDevices { DWORD nInfos; LDVDeviceInfoPtr* pInfos;

Strona 138

40 Using the OpenLDV API 1. Set the nCaps to LDV_DEVCAP_PA to specify protocol analyzer capability. 2. Set nCombine to LDV_COMBINE_DEFINITELY_ALL (

Strona 139

OpenLDV Programmer’s Guide 41 Device Capability Numeric Value Description LDV_DEVCAP_XDRIVER 0x00000040 The device is an xDriver-based dev

Strona 140

OpenLDV Programmer’s Guide v Table of Contents Welcome ...

Strona 141

42 Using the OpenLDV API Device Capability Numeric Value Description LDV_DEVCAP_CURRENTLY_AVAILABLE 0x40000000 The device is currently not in use

Strona 142

OpenLDV Programmer’s Guide 43 See the following functions for their use of this structure: ldv_get_driver_info() on page 21, ldv_set_driver_

Strona 143

44 Using the OpenLDV API LdvDriverType Enumeration Table 28 describes the enumerated values for the LdvDriverType driver type. The driver type descr

Strona 144

OpenLDV Programmer’s Guide 45 OpenLDV API Return Codes Table 30 describes the return codes that can be returned by the OpenLDV API functions.

Strona 145 - LNS Programming with xDriver

46 Using the OpenLDV API Return Code Numeric Value Description LDV_DEVICE_ERR 4 This code is returned if a function fails to execute as a result o

Strona 146

OpenLDV Programmer’s Guide 47 Return Code Numeric Value Description LDV_NO_RESOURCES 8 No resources are available. This code is returned

Strona 147 - ONWORKS networks

48 Using the OpenLDV API Return Code Numeric Value Description LDVX_OPEN_FAILED 12 The remote network interface (RNI) could not be opened. LDVX_CL

Strona 148 - ONWORKS networks by

OpenLDV Programmer’s Guide 49 Return Code Numeric Value Description LDVX_INVALID_XDRIVER 17 This code is returned if you attempt to open a

Strona 149

50 Using the OpenLDV API Return Code Numeric Value Description LDV_CAPABILITY_NOT_SUPPORTED 22 The capability specified for the ldv_open_cap() fun

Strona 150 - Uplink Sample Application

OpenLDV Programmer’s Guide 51 Return Code Numeric Value Description LDV_DEVICE_UPDATE_FAILED 33 The device information specified for the l

Strona 151

vi LdvCombineFlags Enumeration ... 39 LdvDeviceCaps Enumeration ...

Strona 152

52 Using the OpenLDV API Return Code Numeric Value Description LDV_BUFFER_CONFIGURATION_TOO_LARGE 45 The specified buffer configuration is too lar

Strona 153

OpenLDV Programmer’s Guide 53 // Include the header file from the OpenLDV API Example // (contains definitions for ExpMsgHdr, ExpAppBuffer

Strona 154

54 Using the OpenLDV API if (ldvCmdOk) { // Build message to send to NI m_msgOut.ni_hdr.q.queue = niNTQ; m_msgOut.ni_hdr.q.q_cmd

Strona 155 - Custom Network Interfaces

OpenLDV Programmer’s Guide 55 // Perform the following tasks regardless of ldvCmdOk value: // Deregister event for NI ldv_register_event(m_O

Strona 157

OpenLDV Programmer’s Guide 57 3 Sending and Receiving Messages with the OpenLDV API This chapter describes the network interface message co

Strona 158 - Windows Registry Entries

58 Sending and Receiving Messages with the OpenLDV API Constructing Messages You can construct outgoing messages for OpenLDV application using applic

Strona 159

OpenLDV Programmer’s Guide 59 Extended HeaderExtended Data TypeExtended Data VersionExtended DataBFPacket SizeFlagsExtended Header SizeAbsolu

Strona 160

60 Sending and Receiving Messages with the OpenLDV API SICB application buffer structure is defined as a structure of type ExpAppBuffer in the OpenLD

Strona 161 - LNS Methods and Events for

OpenLDV Programmer’s Guide 61 Layer 2 Buffer Structure The following sections provide an overview of the Layer 2 buffer structure shown in Fi

Strona 162 - Remarks

OpenLDV Programmer’s Guide vii Implement the ILdvxLookup Interface ... 119 Add the Extension to th

Strona 163 - EndIncomingSessionEvents

62 Sending and Receiving Messages with the OpenLDV API • Domain length (2 bits) • Data (variable length, depending on the packet type and the data)

Strona 164 - Syntax

OpenLDV Programmer’s Guide 63 • NetVarHdr — for sending and receiving network variables that are processed by the network interface ExpMsgH

Strona 165 - OnIncomingSessionEvent

64 Sending and Receiving Messages with the OpenLDV API For an uplink message (read from a network interface), the tag field indicates the index into

Strona 166 - ReleasePendingUpdates

OpenLDV Programmer’s Guide 65 alternate path If the alternate path bit is set, the message is delivered on the path specified in the path bit

Strona 167

66 Sending and Receiving Messages with the OpenLDV API and request messages. When the OpenLDV application generates a response to an uplink request

Strona 168

OpenLDV Programmer’s Guide 67 turnaround If the turnaround bit is set, the message is a turnaround message, that is, a message sent from one

Strona 169 - Component Programming

68 Sending and Receiving Messages with the OpenLDV API msb lsbFormatSendAddrDtlDestination Address For BroadcastAddressing0Domaintx_timerRetryrpt_tim

Strona 170 - SetInstance Method

OpenLDV Programmer’s Guide 69 msb lsbFormatSendAddrDtlDestination Address For Subnet/NodeAddressing0Domain Nodetx_timerRetryrpt_timerSubnetRe

Strona 171 - SetOptions Method

70 Sending and Receiving Messages with the OpenLDV API 0 1 1 111 1 1msb lsbFormatReservedSendAddrDtlDestination Address For LocalAddressingDestinatio

Strona 172 - DownlinkLookup Method

OpenLDV Programmer’s Guide 71 msb lsbFormatRcvAddrDtlReceived Address For BroadcastAddressingDomainNodeSubnetReservedSourceAddress0 0 0 0 0

Strona 173 - UplinkLookup Method

viii GetEncryptionType Method ... 170 GetLNSNetworkName Method ...

Strona 174 - ILdvxSCO Interface

72 Sending and Receiving Messages with the OpenLDV API msb lsbFormatRcvAddrDtlReceived Address For Subnet/NodeAddressingDomainNodeSubnetReservedSourc

Strona 175

OpenLDV Programmer’s Guide 73 msb lsbFormatRespAddrDtlResponse Address For GroupAddressingDomainNodeSubnetReservedSourceAddressflex_domainDes

Strona 176

74 Sending and Receiving Messages with the OpenLDV API UnprocessedNV 7 6 5 4 3 2 1 0 1 dir NV selector hi NV selector lo

Strona 177 - GetDownlinkKey Method

OpenLDV Programmer’s Guide 75 Message Type Message Codes (Hex) Foreign responder offline 4F Network diagnostic message 50 .. 5F Network ma

Strona 178

76 Sending and Receiving Messages with the OpenLDV API Message Code Comments Set Node Mode 0x6C On-line and off-line only. OpenLDV application s

Strona 179

OpenLDV Programmer’s Guide 77 Uplink Commands An uplink command is a message read from a network interface by an OpenLDV application with the

Strona 180 - GetUplinkKey Method

78 Sending and Receiving Messages with the OpenLDV API enumeration type definition NI_QueueCmd used in the field NI_Hdr.q.q_cmd of the application la

Strona 181 - SetAuthenticationFlag Method

OpenLDV Programmer’s Guide 79 Network Interface Command Value Direction Description niCOMM + niTQ_P 0x13 Downlink Used for downlink pri

Strona 182

80 Sending and Receiving Messages with the OpenLDV API Network Interface Command Value Direction Description niCOMM + niINCOMING 0x18 Uplink Us

Strona 183 - SetEncryptionType Method

OpenLDV Programmer’s Guide 81 Network Interface Command Value Direction Description niNETMGMT + niNTQ_P 0x25 Downlink Used for downlink

Strona 184 - SetLNSNetworkName Method

OpenLDV Programmer’s Guide 1 1 Introduction This chapter introduces the OpenLDV driver and how you can use it to send and receive LonTalk

Strona 185

82 Sending and Receiving Messages with the OpenLDV API Network Interface Command Value Direction Description niL2_PRE_SHORT 0x34 Uplink Specifi

Strona 186 - ILdvxSCO_TCP Interface

OpenLDV Programmer’s Guide 83 Network Interface Command Value Direction Description niONLINE 0x70 Downlink Requests that the network in

Strona 187 - GetRemoteTCPPort Method

84 Sending and Receiving Messages with the OpenLDV API Network Interface Command Value Direction Description niFLUSH 0x90 Downlink Requests tha

Strona 188 - SetRemoteTCPPort Method

OpenLDV Programmer’s Guide 85 Network Interface Command Value Direction Description niSERVICE 0xE6 Downlink Requests that the network i

Strona 189 - GetNeuronID Method

86 Sending and Receiving Messages with the OpenLDV API Table 34. xDriver Specific Commands xDriver Command Description LDVX_NICMD_ENCRYPTION_ON_SEN

Strona 190

OpenLDV Programmer’s Guide 87 xDriver Command Description LDVX_NICMD_ENCRYPTION_OFF_RECEIVE=0x05 Use this command to disable RC4 encryption

Strona 192 - 184 Index

OpenLDV Programmer’s Guide 89 4 The OpenLDV Developer Example This chapter describes the OpenLDV Developer Example introduced with Open

Strona 193

90 The OpenLDV Developer Example Overview The OpenLDV Developer Example is an example application that uses the OpenLDV API. The example application

Strona 194

OpenLDV Programmer’s Guide 91 NiSendImmediate(), NiGetNextResponse(), NiSendResponse(), NiClose(), and NiEncryption(). The OpenLDVni.h heade

Komentarze do niniejszej Instrukcji

Brak uwag