OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when...

214
© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 1 OpenDevice Device Translator Template Guide

Transcript of OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when...

Page 1: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 1

OpenDevice Device Translator Template Guide

Page 2: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 2

Table of Contents Device Translator Template ......................................................................................................... 8

CDeviceTranslator .................................................................................................................... 15 ~CDeviceTranslator .................................................................................................................. 16 DecodeSegmentValue ............................................................................................................... 17 GetCmd ..................................................................................................................................... 18 SetCmd ...................................................................................................................................... 19 SetCmdEvent ............................................................................................................................ 20 IsDBLoggingEvents .................................................................................................................. 21 SetDistributeEvent .................................................................................................................... 22 SetSendingEvents ..................................................................................................................... 23 SetPanelOffline ......................................................................................................................... 24 GetSendingEvents ..................................................................................................................... 25 IncrementMonitorReq ............................................................................................................... 26 DecrementMonitorReq ............................................................................................................. 27 GetMonitorReqCount ............................................................................................................... 28 SetPollingCmdReq .................................................................................................................... 29 SendPollingCmdReq ................................................................................................................. 30 SetLineError .............................................................................................................................. 31 GetLineError ............................................................................................................................. 32 SetPanelState............................................................................................................................. 33 GetPanelState ............................................................................................................................ 34 SetPanelID ................................................................................................................................ 35 GetPanelID ................................................................................................................................ 36 SetComPort ............................................................................................................................... 37 GetComPort .............................................................................................................................. 38 SetPanelType ............................................................................................................................ 39 GetPanelType ............................................................................................................................ 40 SetComPort2 ............................................................................................................................. 41 GetComPort2 ............................................................................................................................ 42 SetBaudRate .............................................................................................................................. 43 GetBaudRate ............................................................................................................................. 44 SetCardExType ......................................................................................................................... 45 GetCardExType ........................................................................................................................ 46 SetPanelAddress ....................................................................................................................... 47 GetPanelAddress ....................................................................................................................... 48 SetPrimaryIP ............................................................................................................................. 49 GetPrimaryIP ............................................................................................................................ 50 SetUseTwoWireRS485 ............................................................................................................. 51 GetUseTwoWireRS485 ............................................................................................................ 52 SetSecondaryIP ......................................................................................................................... 53 GetSecondaryIP ........................................................................................................................ 54 SetCommunicationType ........................................................................................................... 55 GetCommunicationType ........................................................................................................... 56

Page 3: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 3

SetPanelName ........................................................................................................................... 57 SetTapiName............................................................................................................................. 58 GetTapiName ............................................................................................................................ 59 SetHostNumber ......................................................................................................................... 60 GetHostNumber ........................................................................................................................ 61 SetHostNumber2 ....................................................................................................................... 62 GetHostNumber2 ...................................................................................................................... 63 SetPanelNumber ....................................................................................................................... 64 GetPanelNumber ....................................................................................................................... 65 SetDialupTZ .............................................................................................................................. 66 GetDialupTZ ............................................................................................................................. 67 SetDialupTZ2 ............................................................................................................................ 68 GetDialupTZ2 ........................................................................................................................... 69 SetDST ...................................................................................................................................... 70 GetDST ..................................................................................................................................... 71 SetIsDialupDriver ..................................................................................................................... 72 GetIsDialupDriver..................................................................................................................... 73 SetCardRecCfg ......................................................................................................................... 74 SetDownloadInProgressState .................................................................................................... 75 GetDownloadInProgressState ................................................................................................... 76 SetEventCounter ....................................................................................................................... 77 GetPanelEventSerialNumber .................................................................................................... 78 SetEventDialBackThreshold ..................................................................................................... 79 GetEventDialBackThreshold .................................................................................................... 80 SendCommand .......................................................................................................................... 81 WriteCommand ......................................................................................................................... 82 WriteResponse .......................................................................................................................... 83 IdleLine ..................................................................................................................................... 84 ConvertFromLocalToGMT ....................................................................................................... 85 ConvertFromGMTToLocal ....................................................................................................... 86 GetPanelTZInfo ........................................................................................................................ 87 ConnectCommunicationTransporter ......................................................................................... 88 LogEvent ................................................................................................................................... 89 RegisterApplication .................................................................................................................. 90 GetReplyPacket ......................................................................................................................... 91 SendCommandPacket ............................................................................................................... 92 GetReply ................................................................................................................................... 93 SetReply .................................................................................................................................... 94 IsLanConnected ........................................................................................................................ 95 ForwardAsyncMsg .................................................................................................................... 96 WriteOfflineEvent ..................................................................................................................... 97 WriteOnlineEvent ..................................................................................................................... 98 Read .......................................................................................................................................... 99 Write ....................................................................................................................................... 100 InitCommunication ................................................................................................................. 101 InitPanel .................................................................................................................................. 102

Page 4: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 4

PollPanel ................................................................................................................................. 103 SendForLastReportedEvent .................................................................................................... 104 GetLastReportedEvent ............................................................................................................ 105 UnsolicitedEventRequest ........................................................................................................ 106 ReadClock ............................................................................................................................... 107 AreEventsPresent .................................................................................................................... 108 SendPanelNextCmdFromPipe ................................................................................................ 109 SendPanelNextDirectCmd ...................................................................................................... 110 PollPanelForEvents ................................................................................................................. 111 InitiateEventRequest ............................................................................................................... 112 IssuePrimaryPortCmd ............................................................................................................. 113 SetPortTimingCfg ................................................................................................................... 114 IsDatabaseSet .......................................................................................................................... 115 SetDialBackRPCCount ........................................................................................................... 116 WaitForAppCommandEvent .................................................................................................. 117 WriteEventsToClients ............................................................................................................. 118 IsWinNT ................................................................................................................................. 119 CreateCommunicationObject .................................................................................................. 120 DistributeDisplayTextMessage ............................................................................................... 121 DetermineDirectCmdReplyType ............................................................................................ 122 AsciiHexCharToInt ................................................................................................................. 123 DebugDisplayBufferHex ........................................................................................................ 124 DebugDisplayBufferChar ....................................................................................................... 125 CheckCOMStatus ................................................................................................................... 126 InitializePanel ......................................................................................................................... 127 StartDatabaseThread ............................................................................................................... 128 IsTimezoneActive ................................................................................................................... 129 StartReaderDownload ............................................................................................................. 130 SetCommunicationType2 ....................................................................................................... 131 GetCommunicationType2 ....................................................................................................... 132 SetTapiName2......................................................................................................................... 133 GetTapiName2 ........................................................................................................................ 134 SetPanelNumber2 ................................................................................................................... 135 GetPanelNumber2 ................................................................................................................... 136 SetEventDialBackThreshold2 ................................................................................................. 137 GetEventDialBackThreshold2 ................................................................................................ 138 Lnl_CreateCommunicationObject .......................................................................................... 139 Lnl_ConnectCommunicationManager .................................................................................... 140 Lnl_RequireCTManager ......................................................................................................... 141 Lnl_InitCommunication .......................................................................................................... 142 Lnl_GetSystemStatus .............................................................................................................. 143 Lnl_CloseCommunication ...................................................................................................... 144 Lnl_GetPanelEventSerialNumber ........................................................................................... 145 Lnl_UnsolicitedEventRequest ................................................................................................ 146 Lnl_PollPanelForEvents ......................................................................................................... 147 Lnl_IncrementMonitorReq ..................................................................................................... 148

Page 5: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 5

Lnl_DecrementMonitorReq .................................................................................................... 149 Lnl_GetPanelID ...................................................................................................................... 150 Lnl_SetEventCounter .............................................................................................................. 151 Lnl_SetPanelID ....................................................................................................................... 152 Lnl_InitializePanel .................................................................................................................. 153 Lnl_SetPanelOffline ............................................................................................................... 154 Lnl_ReadClock ....................................................................................................................... 155 Lnl_SendPanelNextDirectCmd ............................................................................................... 156 Lnl_SetClock .......................................................................................................................... 157 Lnl_SetDBEnabledFlag .......................................................................................................... 158 Lnl_IssueColdStartCmd .......................................................................................................... 159 Lnl_ResetPowerUpFlag .......................................................................................................... 160 Lnl_DownloadFirmware ......................................................................................................... 161 Lnl_ConnectToPanel .............................................................................................................. 162 Lnl_IsDownloadFinished ........................................................................................................ 163 Lnl_SetDST ............................................................................................................................ 164 Lnl_GetDST ............................................................................................................................ 165 Lnl_SetIsDialupDriver ............................................................................................................ 166 Lnl_GetIsDialupDriver ........................................................................................................... 167 Lnl_SetDownloadInProgressState .......................................................................................... 168 Lnl_SetLineError .................................................................................................................... 169 Lnl_GetLineError ................................................................................................................... 170 Lnl_SetPanelState ................................................................................................................... 171 Lnl_GetPanelState .................................................................................................................. 172 Lnl_SetDirectCmd .................................................................................................................. 173 Lnl_SetPanelName ................................................................................................................. 174 Lnl_SetPanelType ................................................................................................................... 175 Lnl_GetPanelType .................................................................................................................. 176 Lnl_SetPanelTZInfo ............................................................................................................... 177 Lnl_GetPanelTZInfo ............................................................................................................... 178 Lnl_SetCommunicationType .................................................................................................. 179 Lnl_GetCommunicationType ................................................................................................. 180 Lnl_IsPanelOnline .................................................................................................................. 181 Lnl_GetVersionInfo ................................................................................................................ 182 Lnl_GetComPort ..................................................................................................................... 183 Lnl_SetComPort ..................................................................................................................... 184 Lnl_SetComPort2 ................................................................................................................... 185 Lnl_GetComPort2 ................................................................................................................... 186 Lnl_SetBaudRate .................................................................................................................... 187 Lnl_GetBaudRate ................................................................................................................... 188 Lnl_SetPanelAddress .............................................................................................................. 189 Lnl_GetPanelAddress ............................................................................................................. 190 Lnl_SetPrimaryIP ................................................................................................................... 191 Lnl_GetPrimaryIP ................................................................................................................... 192 Lnl_SetSecondaryIP ............................................................................................................... 193 Lnl_GetSecondaryIP ............................................................................................................... 194

Page 6: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 6

Lnl_SetPanelPassword ............................................................................................................ 195 Device Translator Template Member Variables ................................................................... 196

lb_WinNT ............................................................................................................................... 196 ci_ComPort ............................................................................................................................. 196 m_PanelID .............................................................................................................................. 196 m_GeneralBuffer .................................................................................................................... 196 cl_EventCounter ..................................................................................................................... 196 m_CardExType ....................................................................................................................... 197 m_BaudRate ............................................................................................................................ 197 m_PanelAddress ..................................................................................................................... 197 m_ComPort2 ........................................................................................................................... 197 m_PrimaryIP ........................................................................................................................... 197 m_TwoWireRS485 ................................................................................................................. 198 m_SecondaryIP ....................................................................................................................... 198 m_ConnectionType ................................................................................................................. 198 m_dwGeneralSize ................................................................................................................... 198 m_bSendingEvents ................................................................................................................. 198 m_DaylightSavings ................................................................................................................. 199 m_CardRecCfg ....................................................................................................................... 199 m_DataCS ............................................................................................................................... 199 m_LastInitTime....................................................................................................................... 199 si_TapiName ........................................................................................................................... 199 si_PanelName ......................................................................................................................... 200 si_HostNumber ....................................................................................................................... 200 si_HostNumber2 ..................................................................................................................... 200 si_PanelNumber ...................................................................................................................... 200 si_DialupTZ ............................................................................................................................ 200 si_DialupTZ2 .......................................................................................................................... 201 sl_DialBackThreshold............................................................................................................. 201 sl_DialBackRPCCount ........................................................................................................... 201 m_bIsDialupDriver ................................................................................................................. 201 ci_PanelState ........................................................................................................................... 201 cb_LineError ........................................................................................................................... 202 m_IsDownloadInProgress ....................................................................................................... 202 m_bEnablePanelStorage ......................................................................................................... 202 pTransport ............................................................................................................................... 202 pRs232 .................................................................................................................................... 202 pComTranMgr ........................................................................................................................ 203 co_EventLog ........................................................................................................................... 203 m_pDistributeEvent ................................................................................................................ 203 m_PanelType .......................................................................................................................... 203 m_WorldTZ ............................................................................................................................ 203 co_CmdPipe ............................................................................................................................ 204 ci_MonitorReqNum ................................................................................................................ 204 m_IsDBLoggingEvents........................................................................................................... 204 ch_PollCmdEvent ................................................................................................................... 204

Page 7: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 7

ch_AppCmdEvent ................................................................................................................... 204 ch_AppRspEvent .................................................................................................................... 205 cb_CommandStatus ................................................................................................................ 205 cb_CommandBuffer ................................................................................................................ 205 cb_ReplyBuffer ....................................................................................................................... 205 cl_CommandLength ................................................................................................................ 205 cl_ReplyLength ....................................................................................................................... 206 ch_CmdBufferEvent ............................................................................................................... 206 cb_RspBuffer .......................................................................................................................... 206 cb_CmdBuffer......................................................................................................................... 206 cw_ComLength ....................................................................................................................... 206 ci_DataLength ......................................................................................................................... 207 cb_Sequence ........................................................................................................................... 207 m_PossibleChecksumError ..................................................................................................... 207 m_DatabaseDownloadArray ................................................................................................... 207 s_PanelPassword ..................................................................................................................... 207 m_SecondaryConnectionType ................................................................................................ 208 si_PanelNumber2 .................................................................................................................... 208 si_SecondaryTapiName2 ........................................................................................................ 208 si_DialbackThreshold2 ........................................................................................................... 208 m_EventIndex ......................................................................................................................... 208

Device Translator Template Error Codes .............................................................................. 210 Index ........................................................................................................................................... 211

Page 8: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 8

Device Translator Template Overview The Device Translator Template can be used when developing Device Translators. The device translator template was created to make creating new device translators easier. Many of the common functionality used by the device translators are implemented inside of the template so that there is no need for duplicate code. It is very easy to create a new Device Translator that can run with the Lenel Communication Server using this template, but it will not do much until the hardware specific code is put in place. When the Lenel Communication Server is started up or when it detects that a new device has been added, it goes through the process of creating and initializing a Device Translator to be used. The CLSID (GUID) of the Device Translator COM object is stored in the database based on the device type. This is done so that Device Translators for new devices or Device Translators that replace existing Device Translators can be changed without modifying any code. When a Device Translator needs to be loaded, the Communication Server looks into the database, grabs the CLSID and creates an instance of the particular Device Translator that was requested. Once the Device Translator has been created, a set of calls are made to it from the Communication Server to set the Device Translator’s parameters. These are mainly communication parameters, but also include other parameters that may be specific to the type of device. The calls that are made are listed below. See the interface documentation for more information about these functions. Lnl_SetPanelID Lnl_SetPanelName Lnl_SetPanelType Lnl_SetCommunicationType Lnl_SetPanelTZInfo Lnl_SetDST Lnl_SetEventCounter // Set communication parameters (IComConfig) Lnl_SetComPort Lnl_SetBaudRate Lnl_SetPanelAddress Lnl_SetComPort2 Lnl_SetPrimaryIP Lnl_SetSecondaryIP

Page 9: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 9

// Set Access Control parameters (IAccessControl) Lnl_SetCardExType Lnl_SetUseTwoWireRS485 Lnl_SetCardRecCfg // Set Offline Lock parameters Lnl_SetLowBatteryClearCard // Set the dialup parameters (IDialup) Lnl_SetTapiName Lnl_SetHostNumber Lnl_SetHostNumber2 Lnl_SetPanelNumber Lnl_SetTimeZones Lnl_SetDialupTZ Lnl_SetDialupTZ2 Lnl_SetEventDialBackThreshold // Set Video parameters (IVideo) Lnl_SetVideoEventsThreshold After the Device Translator’s parameters have been set, the Communication Server checks to see if it needs a communication manager to handle communication to the hardware. Communication methods that share communication channels require a manager to handle the communication. For this type of communication there only needs to be one communication per Communication Server. One example where a communication manager is used is for hardware that share modems. After determining if a communication manager is required, the Lnl_CreateCommunicationObject() method is called. The main use of this function is to have the Device Translator create an instance of a Communication Transporter object that will be used to handle the communication to the hardware. It is not necessary to use a Communication Transporter, but it is recommended. If you do not wish to use a communication object, override this method so that one will not be created. All communication can then be handled from within your Device Translator. After the call to Lnl_CreateCommunicationObject(), the Lnl_InitCommunication() method is called, which tells the Device Translator to perform any required communication initialization. A typical operation that would be performed by the Device Translator in this function would be opening up a serial port and configuring the port (timeouts, baud rate, parity, etc.). After the above initialization steps have been taken, the Lenel Communication Server is ready to check the device for events. The Lenel Communication Server maintains a set of threads that loop through a set of devices assigned to the thread polling for events. The Lenel Communication Server can be configured to handle the number of devices that reside in a

Page 10: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 10

particular thread. Inside one of these threads, it grabs the next device in the list of devices and checks to see if the device is ready (online). If the device is not ready then the Lnl_InitializePanel() method is made to the Device Translator to have it attempt to establish communication with the device. If the panel is still not ready, the thread goes on to the next device in the list. If a device happens to be ready, then the thread calls the method Lnl_PollPanelForEvents(). If this function succeeds then the thread will tell the Device Translator to send any command(s) that it is ready to send by calling the Lnl_SendPanelNextDirectCmd() method. When events are received from the hardware by the Device Translator, they are translated and placed into a structure that is then passed back to the Lenel Communication Server using the DistributeLnlMessage method. This function sends back a structure of type LNLMESSAGE filled in with the information that was received by the Device Translator. When the Lenel Communication Server receives this message, it will log the message to the database as well as send it off to client applications interested in these messages such as Lenel OnGuard AlarmMonitoring. The Device Translator Template can be used when developing Device Translators. The device translator template was created to make creating new device translators easier. Many of the common functionality used by the device translators are implemented inside of the template so that there is no need for duplicate code.

List of Device Translator Template functions:

• CDeviceTranslator • ~CDeviceTranslator • DecodeSegmentValue • GetCmd • SetCmd • SetCmdEvent • IsDBLoggingEvents • SetDistributeEvent • SetSendingEvents • SetPanelOffline • GetSendingEvents • IncrementMonitorReq • DecrementMonitorReq • GetMonitorReqCount • SetPollingCmdReq • SendPollingCmdReq • SetLineError • GetLineError • SetPanelState • GetPanelState • SetPanelID

Page 11: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 11

• GetPanelID • SetComPort • GetComPort • SetPanelType • GetPanelType • SetComPort2 • GetComPort2 • SetBaudRate • GetBaudRate • SetCardExType • GetCardExType • SetPanelAddress • GetPanelAddress • SetPrimaryIP • GetPrimaryIP • SetUseTwoWireRS485 • GetUseTwoWireRS485 • SetSecondaryIP • GetSecondaryIP • SetCommunicationType • GetCommunicationType • SetPanelName • SetTapiName • GetTapiName • SetHostNumber • GetHostNumber • SetHostNumber2 • GetHostNumber2 • SetPanelNumber • GetPanelNumber • SetDialupTZ • GetDialupTZ • SetDialupTZ2 • GetDialupTZ2 • SetDST • GetDST • SetIsDialupDriver • GetIsDialupDriver • SetCardRecCfg • SetDownloadInProgressState • GetDownloadInProgressState • SetEventCounter • GetPanelEventSerialNumber

Page 12: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 12

• SetEventDialBackThreshold • GetEventDialBackThreshold • SendCommand • WriteCommand • WriteResponse • IdleLine • ConvertFromLocalToGMT • ConvertFromGMTToLocal • GetPanelTZInfo • ConnectCommunicationTransporter • LogEvent • RegisterApplication • GetReplyPacket • SendCommandPacket • GetReply • SetReply • IsLanConnected • ForwardAsyncMsg • WriteOfflineEvent • WriteOnlineEvent • Read • Write • InitCommunication • InitPanel • PollPanel • SendForLastReportedEvent • GetLastReportedEvent • UnsolicitedEventRequest • ReadClock • AreEventsPresent • SendPanelNextCmdFromPipe • SendPanelNextDirectCmd • PollPanelForEvents • InitiateEventRequest • IssuePrimaryPortCmd • SetPortTimingCfg • IsDatabaseSet • SetDialBackRPCCount • WaitForAppCommandEvent • WriteEventsToClients • IsWinNT • CreateCommunicationObject • DistributeDisplayTextMessage

Page 13: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 13

• DetermineDirectCmdReplyType • AsciiHexCharToInt • DebugDisplayBufferHex • DebugDisplayBufferChar • CheckCOMStatus • InitializePanel • StartDatabaseThread • IsTimezoneActive • StartReaderDownload • SetCommunicationType2 • GetCommunicationType2 • SetTapiName2 • GetTapiName2 • SetPanelNumber2 • GetPanelNumber2 • SetEventDialBackThreshold2 • GetEventDialBackThreshold2

ITranslate methods

• Lnl_CreateCommunicationObject • Lnl_ConnectCommunicationManager • Lnl_RequireCTManager • Lnl_InitCommunication • Lnl_GetSystemStatus • Lnl_CloseCommunication • Lnl_GetPanelEventSerialNumber • Lnl_UnsolicitedEventRequest • Lnl_PollPanelForEvents • Lnl_IncrementMonitorReq • Lnl_DecrementMonitorReq • Lnl_GetPanelID • Lnl_SetEventCounter • Lnl_SetPanelID • Lnl_InitializePanel • Lnl_SetPanelOffline • Lnl_ReadClock • Lnl_SendPanelNextDirectCmd • Lnl_SetClock • Lnl_SetDBEnabledFlag • Lnl_IssueColdStartCmd • Lnl_ResetPowerUpFlag • Lnl_DownloadFirmware

Page 14: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 14

• Lnl_ConnectToPanel • Lnl_IsDownloadFinished • Lnl_SetDST • Lnl_GetDST • Lnl_SetIsDialupDriver • Lnl_GetIsDialupDriver • Lnl_SetDownloadInProgressState • Lnl_SetLineError • Lnl_GetLineError • Lnl_SetPanelState • Lnl_GetPanelState • Lnl_SetDirectCmd • Lnl_SetPanelName • Lnl_SetPanelType • Lnl_GetPanelType • Lnl_SetPanelTZInfo • Lnl_GetPanelTZInfo • Lnl_SetCommunicationType • Lnl_GetCommunicationType • Lnl_IsPanelOnline • Lnl_GetVersionInfo • Lnl_SetPanelPassword

IComConfig interface methods

• Lnl_GetComPort • Lnl_SetComPort • Lnl_SetComPort2 • Lnl_GetComPort2 • Lnl_SetBaudRate • Lnl_GetBaudRate • Lnl_SetPanelAddress • Lnl_GetPanelAddress • Lnl_SetPrimaryIP • Lnl_GetPrimaryIP • Lnl_SetSecondaryIP • Lnl_GetSecondaryIP

Device Translator Template Revision History Date Author Notes 03/27/2003 M. Serafin • Added the revision history.

Page 15: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 15

CDeviceTranslator Purpose: Constructor used by the template. This performs the initialization tasks required by the device translator template. Many of the variables are initialized here.

Syntax: CDeviceTranslator ();

Page 16: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 16

~CDeviceTranslator Purpose: Destructor used by the Device Translator template.

Syntax: ~CDeviceTranslator ();

Page 17: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 17

DecodeSegmentValue Purpose: This method is used to decode a value for the particular segment. In order to allow segmentation of certain items a scheme was used to map certain values into a new number so that they would be unique when stored in the database. But when these values are sent to the hardware they need to be decoded and this method performs this task.

Syntax: long DecodeSegmentValue ( long vl_Value );

Input Parameters:

Parameter Description vl_Value Value to decode based on the segment.

Return Values:

Parameter Description long Decoded value for the segment.

Page 18: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 18

GetCmd Purpose: Copies the command to send into the command buffer.

Syntax: void GetCmd ( BYTE *prz_Buffer, DWORD *pri_Size );

Output Parameters:

Parameter Description prz_Buffer The array of bytes of the command. pri_Size The number of bytes.

Page 19: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 19

SetCmd Purpose: Fills the cb_CommandBuffer with the command passed in and then signals the ch_CmdBufferEvent indicating that the command is ready to be sent. It then waits for the response event (ch_AppRspEvent) and returns the status of the command. This method is called from SendCommand when the vb_Wait parameter is TRUE.

Syntax: BOOL SetCmd ( BYTE *prz_Buffer, DWORD vi_Size );

Input Parameters:

Parameter Description prz_Buffer Array of bytes of the command. vi_Size The number of bytes.

Return Values:

Parameter Description BOOL Indicates if the command succeeded

(cb_CommandStatus).

Page 20: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 20

SetCmdEvent Purpose: Indicates that the command being sent by SetCmd has completed by releasing the ch_CmdBufferEvent Mutex. This function is called within SendCommand when the vb_Wait parameter is TRUE.

Syntax: void SetCmdEvent ( );

Page 21: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 21

IsDBLoggingEvents Purpose: Returns whether or not events are being logged to the database. One method that currently calls this function is UnsolicitedEventRequest.

Syntax: BOOL IsDBLoggingEvents ( );

Return Values:

Parameter Description BOOL Indicates if events are being logged to the

database (FALSE-no, TRUE-Yes).

Page 22: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 22

SetDistributeEvent Purpose: Assigns the interface pointer passed in to the m_pDistributeEvent interface pointer. This is done shortly after the Device Translator is created to create the means of passing information back to the Lenel Communication Server application.

Syntax: void SetDistributeEvent ( IDistributeEvent *pDistributeEvent );

Input Parameters:

Parameter Description pDistributeEvent Interface pointer.

Page 23: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 23

SetSendingEvents Purpose: Sets the flag (m_bSendingEvents) indicating if events are being sent.

Syntax: void SetSendingEvents ( BOOL vb_Value );

Input Parameters:

Parameter Description vb_Value The value to set the flag to.

Page 24: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 24

SetPanelOffline Purpose: Performs certain tasks when panel is determined to be offline. These include setting the panel state to being offline, setting the sending events flag to FALSE, sending the offline event, and setting the line error flag to TRUE.

Syntax: BOOL SetPanelOffline ( );

Return Values:

Parameter Description BOOL Status of function (FALSE – failure, TRUE

– Success).

Page 25: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 25

GetSendingEvents Purpose: Determines if the panel is sending events back. Returns the value of the m_bSendingEvents flag.

Syntax: BOOL GetSendingEvents ( );

Return Values:

Parameter Description BOOL Indicates if events are being sent (FALSE –

No, TRUE – Yes).

Page 26: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 26

IncrementMonitorReq Purpose: Increments the count of the number of "monitors" which are listening to this Device Translator. This is called from the Lnl_IncrementMonitorReq method.

Syntax: void IncrementMonitorReq ( );

Page 27: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 27

DecrementMonitorReq Purpose: Decrements the count of the number of "monitors" that are listening to this Device Translator. This is called from the Lnl_DecrementMonitorReq method.

Syntax: void DecrementMonitorReq ( );

Page 28: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 28

GetMonitorReqCount Purpose: Returns the number of "monitors" listening if the enable panel storage flag is set, otherwise the value 1 is returned. Enable event storage in the panel is an ACS.INI configuration flag that can be set so that when there are no monitors listening, all events remain in the panel.

Syntax: int GetMonitorReqCount ( );

Return Values:

Parameter Description int The number of “monitors” listening for

events.

Page 29: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 29

SetPollingCmdReq Purpose: This method is not used in the default implementation of the template Device Translator. Not all Device Translators will require this. This function sets an event (ch_PollCmdEvent) that the SendPollingCmdReq will check to see if it has been set. An example of how this can be used is that the SetPollingCmdReq can be called inside of UnsolicitedEventRequest when polling is to be started. Then inside the Lnl_SendPanelNextDirectCmd method, the function SendPollingCmdReq can be issued and if the ch_PollCmdEvent is set the InitiateEventRequest method can be called. This provides a two step approach to start polling (we must have the Communication Server request the next event then start polling).

Syntax: BOOL SetPollingCmdReq ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 30: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 30

SendPollingCmdReq Purpose: The default implementation of this function waits on the

Syntax: BOOL SetPollingCmdReq ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 31: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 31

SetLineError Purpose: Sets the variable cb_LineError to the value passed in to indicate the line error status.

Syntax: void SetLineError ( BOOL lineerror );

Input Parameters:

Parameter Description lineerror Line error status (FALSE – No line error,

TRUE – Line error).

Page 32: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 32

GetLineError Purpose: Returns the current line error state (cb_LineError).

Syntax: BOOL GetLineError ( );

Return Values:

Parameter Description BOOL Line error status (FALSE – No line error,

TRUE – Line error).

Page 33: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 33

SetPanelState Purpose: Sets the state of the panel with the value which is passed in (ci_PanelState).

Syntax: void SetPanelState ( int panelstate );

Input Parameters:

Parameter Description panelstate New panel state to set

(PANEL_STATE_OFFLINE, PANEL_STATE_READY).

Page 34: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 34

GetPanelState Purpose: Obtains the current state of the panel (ci_PanelState).

Syntax: int GetPanelState ( );

Return Values:

Parameter Description int Current panel state

(PANEL_STATE_OFFLINE, PANEL_STATE_READY).

Page 35: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 35

SetPanelID Purpose: Sets the Panel ID variable (m_PanelID) in the Device Translator.

Syntax: void SetPanelID ( int vi_PanelID );

Input Parameters:

Parameter Description vi_PanelID Panel ID.

Page 36: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 36

GetPanelID Purpose: Returns the Panel ID for what the Device Translator has been set with.

Syntax: int GetPanelID ( );

Return Values:

Parameter Description int Panel ID.

Page 37: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 37

SetComPort Purpose: Sets the com port variable (ci_ComPort) inside the Device Translator to the value which is passed in.

Syntax: void SetComPort ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Com port.

Page 38: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 38

GetComPort Purpose: Returns the value of the com port variable that the Device Translator is set with.

Syntax: int GetComPort ( );

Return Values:

Parameter Description int Com port value.

Page 39: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 39

SetPanelType Purpose: Sets the variable (m_PanelType) inside the Device Translator to the type of panel that it is.

Syntax: void SetPanelType ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Panel type.

Page 40: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 40

GetPanelType Purpose: Returns the value of the panel type variable (m_PanelType).

Syntax: int GetPanelType ( );

Return Values:

Parameter Description int Panel type.

Page 41: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 41

SetComPort2 Purpose: Sets the secondary com port value.

Syntax: void SetComPort2 ( int vi_Value, );

Input Parameters:

Parameter Description vi_Value Secondary Com port value.

Page 42: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 42

GetComPort2 Purpose: Gets the secondary com port value

Syntax: int GetComPort2 ( );

Return Values:

Parameter Description int Secondary Com port value.

Page 43: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 43

SetBaudRate Purpose: Sets the baud rate variable (m_BaudRate) to the value being passed in.

Syntax: void SetBaudRate ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Baud rate.

Page 44: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 44

GetBaudRate Purpose: Returns the baud rate the Device Translator variable is set to.

Syntax: HRESULT GetBaudRate ( );

Return Values:

Parameter Description int Baud rate.

Page 45: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 45

SetCardExType Purpose: Sets the record extension type used by the panel (m_CardExType). See Lnl_SetCardExType in the IAccessControl documentation for more information.

Syntax: void SetCardExType ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Record extension type.

Page 46: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 46

GetCardExType Purpose: Gets the record extension type used by the panel. See Lnl_GetCardExType in the IAccessControl documentation for more information.

Syntax: int GetCardExType ( );

Return Values:

Parameter Description int Record extension type.

Page 47: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 47

SetPanelAddress Purpose: Set the panel address (m_PanelAddress).

Syntax: void SetPanelAddress ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Panel address.

Page 48: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 48

GetPanelAddress Purpose: Get the panel address (m_PanelAddress).

Syntax: int GetPanelAddress ( );

Return Values:

Parameter Description int Panel address.

Page 49: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 49

SetPrimaryIP Purpose: Set the primary IP value (m_PrimaryIP).

Syntax: void SetPrimaryIP ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Primary IP.

Page 50: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 50

GetPrimaryIP Purpose: Get the primary IP value (m_PrimaryIP).

Syntax: int GetPrimaryIP ( );

Return Values:

Parameter Description int Primary IP.

Page 51: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 51

SetUseTwoWireRS485 Purpose: Sets the flag indicating if two wire RS-485 is being used.

Syntax: void SetUseTwoWireRS485 ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Sets the flag indicating if two wire RS-485

is being used (0 – No, 1 – Yes).

Page 52: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 52

GetUseTwoWireRS485 Purpose: Gets the flag indicating if two wire RS-485 is being used.

Syntax: int GetUseTwoWireRS485 ( );

Return Values:

Parameter Description int Value indicating if two wire RS-485 is

being used (0 – No, 1 – Yes).

Page 53: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 53

SetSecondaryIP Purpose: Set the secondary IP variable.

Syntax: void SetSecondaryIP ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Secondary IP value.

Page 54: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 54

GetSecondaryIP Purpose: Get the secondary IP variable.

Syntax: int GetSecondaryIP ( );

Return Values:

Parameter Description int Secondary IP value.

Page 55: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 55

SetCommunicationType Purpose: Set the communication type variable (m_ConnectionType).

Syntax: void SetCommunicationType ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Connection Type

(CONNECTTYPE_DIRECT = 0, CONNECTTYPE_LAN = 1, CONNECTTYPE_DIALUP=2).

Page 56: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 56

GetCommunicationType Purpose: Get the communication type variable (m_ConnectionType).

Syntax: int GetCommunicationType ( );

Return Values:

Parameter Description int Connection Type

(CONNECTTYPE_DIRECT = 0, CONNECTTYPE_LAN = 1, CONNECTTYPE_DIALUP=2).

Page 57: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 57

SetPanelName Purpose: Set the name of the panel. Copies the array of characters that is passed in into the si_PanelName variable.

Syntax: void SetPanelName ( CString prl_Value );

Input Parameters:

Parameter Description prl_Value Byte array containing panel name.

Page 58: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 58

SetTapiName Purpose: Set the TAPI name being used for dialup. Copies the name into si_TapiName.

Syntax: void SetTapiName ( CString prl_Value );

Input Parameters:

Parameter Description prl_Value The TAPI name.

Page 59: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 59

GetTapiName Purpose: Get the TAPI name being used for dialup.

Syntax: CString GetTapiName ( );

Return Values:

Parameter Description CString TAPI name being used.

Page 60: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 60

SetHostNumber Purpose: Set the host phone number used for dialup.

Syntax: void Lnl_Function1 ( CString prl_Value );

Input Parameters:

Parameter Description prl_Value Host phone number.

Page 61: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 61

GetHostNumber Purpose: Get the host phone number being used for dialup.

Syntax: CString GetHostNumber ( );

Return Values:

Parameter Description CString Host phone number.

Page 62: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 62

SetHostNumber2 Purpose: Set the second host phone number used for dialup.

Syntax: void SetHostNumber2 ( CString prl_Value );

Input Parameters:

Parameter Description prl_Value The secondary host phone number.

Page 63: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 63

GetHostNumber2 Purpose: Get the second host phone number being used for dialup.

Syntax: CString GetHostNumber2 ( );

Return Values:

Parameter Description CString The secondary host phone number.

Page 64: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 64

SetPanelNumber Purpose: Set the panel phone number being used for dialup.

Syntax: void SetPanelNumber ( CString prl_Value, );

Input Parameters:

Parameter Description prl_Value Panel phone number

Page 65: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 65

GetPanelNumber Purpose: Get the panel phone number being used for dialup.

Syntax: CString GetPanelNumber ( );

Return Values:

Parameter Description CString Panel phone number.

Page 66: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 66

SetDialupTZ Purpose: Set the dialup timezone used for dialup.

Syntax: void SetDialupTZ ( int vi_Value, );

Input Parameters:

Parameter Description vi_Value Dialup timezone.

Page 67: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 67

GetDialupTZ Purpose: Get the dialup timezone used for dialup.

Syntax: int GetDialupTZ ( );

Return Values:

Parameter Description int Dialup timezone.

Page 68: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 68

SetDialupTZ2 Purpose: Set the second dialup timezone used for dialup.

Syntax: void SetDialupTZ2 ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Second dialup timezone.

Page 69: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 69

GetDialupTZ2 Purpose: Get the second dialup timezone used for dialup.

Syntax: int GetDialupTZ2 ( );

Return Values:

Parameter Description int Second dialup timezone.

Page 70: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 70

SetDST Purpose: Set the flag indicating if daylight savings time is being used.

Syntax: void SetDST ( BOOL vi_Value );

Input Parameters:

Parameter Description vi_Value Indicates if DST is being used (FALSE –

No, TRUE – Yes).

Page 71: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 71

GetDST Purpose: Gets the value of the daylight savings variable which indicates if daylights savings is being used.

Syntax: BOOL GetDST ( );

Return Values:

Parameter Description BOOL Indicates if DST is being used (FALSE –

No, TRUE – Yes).

Page 72: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 72

SetIsDialupDriver Purpose: Sets the flag indicating that dialup is the means of communication.

Syntax: void SetIsDialupDriver ( BOOL vi_Value );

Input Parameters:

Parameter Description vi_Value 0 (FALSE) – Not using dialup, 1 (TRUE) –

Uses dialup.

Page 73: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 73

GetIsDialupDriver Purpose: Returns the value of the flag indicating if this is a dialup device translator.

Syntax: int GetIsDialupDriver ( );

Return Values:

Parameter Description int 0 – Not using dialup, 1 – Uses dialup.

Page 74: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 74

SetCardRecCfg Purpose: This method can be used along with the IAccessControl Interface. Refer to the IAccessControl Interface for more information.

Syntax: void SetCardRecCfg ( CARD_REC_CFG *prs_Cfg );

Input Parameters:

Parameter Description prs_Cfg Pointer to the CARD_REC_CFG structure.

Page 75: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 75

SetDownloadInProgressState Purpose: Sets the flag (m_IsDownloadInProgress) indicating if a database download is in progress.

Syntax: HRESULT SetDownloadInProgressState ( BOOL State );

Input Parameters:

Parameter Description State FALSE – Download not in progress.

TRUE – Download in progress.

Page 76: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 76

GetDownloadInProgressState Purpose: Determines if a database download is in progress.

Syntax: BOOL GetDownloadInProgressState ( );

Return Values:

Parameter Description BOOL FALSE – Download not in progress.

TRUE – Download in progress.

Page 77: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 77

SetEventCounter Purpose: Set the event serial number variable. When the Device Translator is loaded the Lenel Communication Server will make a call to set the initial event serial number to use when generating events. The event serial number along with the panel ID will be the unique key used when saving the event to the database.

Syntax: void SetEventCounter ( long vl_Counter, );

Input Parameters:

Parameter Description vl_Counter Event serial number.

Page 78: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 78

GetPanelEventSerialNumber Purpose: Get the event serial number from the variable and increment this value. The event serial number along with the panel ID will create a unique key used when saving the event to the database. This method will return the current value of the variable and then increment this variable so the next call to this method returns the new value.

Syntax: long GetPanelEventSerialNumber ( );

Return Values:

Parameter Description long Event serial number.

Page 79: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 79

SetEventDialBackThreshold Purpose: Set the event dialback threshold for dialup panels. This function is to be used with the IDialup Interface.

Syntax: void SetEventDialBackThreshold ( long vl_Counter, );

Input Parameters:

Parameter Description vl_Counter The number of events that the dialback

threshold is set for.

Page 80: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 80

GetEventDialBackThreshold Purpose: Get the value that the event dialback threshold is set for. This function is to be used with the IDialup Interface.

Syntax: long GetEventDialBackThreshold ( );

Return Values:

Parameter Description long The number of events that the dialback

threshold is set for.

Page 81: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 81

SendCommand Purpose: This function will send a command to the hardware. If this function is to wait for a response (vb_Wait = TRUE), this function will wait until the command is processed by the SendPanelNextDirectCmd function. If it doesn’t need to wait for the response (vb_Wait = FALSE), the WriteCommand method is called so that the command is placed in the command pipe that will then be processed when the SendPanelNextCmdFromPipe function grabs the command from the pipe.

Syntax: virtual BOOL SendCommand ( BYTE *prz_Buffer, DWORD ll_Size, BOOL vb_Wait );

Input Parameters:

Parameter Description prz_Buffer Command data. ll_Size Number of bytes in the command. vb_Wait Indicates if the sending of the command

will wait for a response before returning.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 82: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 82

WriteCommand Purpose: This method writes a command to the command pipe. The default implementation of the SendPanelNextCmdFromPipe function will read the command from the pipe and send it to the panel. This is done because the commands are being generated from a different thread then the thread that is writing to the communication port, this ensures that these commands are written to the communication port from the same thread. The WriteCommand function is called from the default implementation of SendCommand when it doesn’t need to wait for the response.

Syntax: BOOL WriteCommand ( LPVOID prv_Buffer, DWORD ll_Size );

Input Parameters:

Parameter Description prv_Buffer Command data. ll_Size Number of bytes in command.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 83: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 83

WriteResponse Purpose: No longer being used.

Syntax: BOOL WriteResponse ( LPVOID prv_Buffer, DWORD ll_Size );

Input Parameters:

Parameter Description prv_Buffer Buffer. ll_Size Number of bytes in the buffer.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 84: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 84

IdleLine Purpose: Idle the line (read extra bytes from the communication port)

Syntax: void IdleLine ( );

Page 85: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 85

ConvertFromLocalToGMT Purpose: Convert from local to GMT time.

Syntax: long ConvertFromLocalToGMT ( long vi_LocalTime );

Input Parameters:

Parameter Description vi_LocalTime Local time.

Return Values:

Parameter Description long GMT time.

Page 86: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 86

ConvertFromGMTToLocal Purpose: Convert from GMT to local time.

Syntax: long ConvertFromGMTToLocal ( long vi_GMTTime );

Input Parameters:

Parameter Description vi_GMTTime GMT time.

Return Values:

Parameter Description long Local time.

Page 87: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 87

GetPanelTZInfo Purpose: Returns the panel timezone structure.

Syntax: TZI* GetPanelTZInfo ( );

Return Values:

Parameter Description TZI* Timezone information structure.

Page 88: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 88

ConnectCommunicationTransporter Purpose: This function is no longer being used.

Syntax: BOOL ConnectCommunicationTransporter ( REFIID iid, IUnknown *pIUnknown );

Page 89: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 89

LogEvent Purpose: Logs an event to the NT application log. Below is an example of how this may be used. // An example of how the LogEvent function may be used to

// log the error to the NT application log CString nameStr, errorStr; nameStr.Format(_T("Example!")); LPTSTR m_EventStrs[3]; /* array of pointers to insert */ m_EventStrs[0] = nameStr.GetBuffer(nameStr.GetLength()+1); m_EventStrs[1] = errorStr.GetBuffer(errorStr.GetLength()+1);

LogEvent(MSG_DRIVER_MSG,2,(LPCTSTR *)m_EventStrs, EVENTLOG_ERROR_TYPE );

errorStr.ReleaseBuffer(); nameStr.ReleaseBuffer();

Syntax: void LogEvent ( DWORD dwIdEvent, WORD cStrings, LPCTSTR *pszStrings, WORD vl_ErrorType = EVENTLOG_ERROR_TYPE );

Input Parameters:

Parameter Description dwIdEvent Event ID. cStrings Number of strings. pszStrings Array of strings. vl_ErrorType Error type.

Page 90: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 90

RegisterApplication Purpose: Register the application so it can use the NT application log.

Syntax: BOOL RegisterApplication ( LPCTSTR AppName );

Input Parameters:

Parameter Description AppName Application name.

Return Values:

Parameter Description BOOL FALSE – Function failed.

TRUE – Function succeeded.

Page 91: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 91

GetReplyPacket Purpose: This method is used to get a message or a reply packet from the hardware. If there are problems reading from the communication port then FALSE should return indicating the communication problems. The version of this method in the Device Translator template only returns TRUE, this method needs to be overridden to do the specialized work of each individual Device Translator.

Syntax: virtual BOOL GetReplyPacket ( );

Return Values:

Parameter Description BOOL FALSE – Indicates failure.

TRUE – Indicates success.

Page 92: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 92

SendCommandPacket Purpose: Function used to send a command to the hardware. This is called in the default implementations of SendPanelNextCmdFromPipe and SendPanelNextDirectCmd.

Syntax: virtual BOOL SendCommandPacket ( LPVOID prv_Buffer, LPDWORD ll_DataSize, BOOL vb_ResetSeqNum = FALSE );

Input Parameters:

Parameter Description prv_Buffer Command data. ll_DataSize Number of bytes in the command. vb_ResetSeqNum Indicates if the sequence number needs to

be reset.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 93: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 93

GetReply Purpose: This function copies the reply into a buffer from the reply buffer (cb_ReplyBuffer). Currently this function is not called from within the template Device Translator.

Syntax: virtual void GetReply ( BYTE *prz_Buffer, DWORD *pri_Size );

Output Parameters:

Parameter Description prz_Buffer Buffer that the reply is copied into. pri_Size The number of bytes in the reply.

Page 94: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 94

SetReply Purpose: This function copies the reply into the reply buffer (cb_ReplyBuffer) and sets the reply length (cl_ReplyLength). This function is called from within the default implementation of SendPanelNextDirectCmd.

Syntax: virtual BOOL SetReply ( BYTE *prz_Buffer, DWORD vi_Size );

Input Parameters:

Parameter Description prz_Buffer The reply data. vi_Size Number of bytes in the reply.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 95: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 95

IsLanConnected Purpose: Determines if LAN is connected. This method by default always returns FALSE, it needs to be overridden to function differently. Currently this function is not being used.

Syntax: virtual BOOL IsLanConnected ( );

Return Values:

Parameter Description BOOL FALSE – LAN not connected.

TRUE – LAN Connected.

Page 96: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 96

ForwardAsyncMsg Purpose: This function no longer is being used.

Syntax: virtual BOOL ForwardAsyncMsg ( int vi_Msg, int vi_Error );

Page 97: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 97

WriteOfflineEvent Purpose: Writes an offline event (this gets sent to clients).

Syntax: virtual BOOL WriteOfflineEvent ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 98: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 98

WriteOnlineEvent Purpose: Writes an online event (this gets sent to clients).

Syntax: virtual BOOL WriteOnlineEvent ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 99: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 99

Read Purpose: Read from the communication port. The default version of this function reads via the ITransport interface. This function can be overloaded to handle the read differently.

Syntax: virtual BOOL Read ( unsigned char *prv_Data, DWORD ll_NumBytesToRead, int *NumBytes, BOOL CheckSize=TRUE );

Input Parameters:

Parameter Description ll_NumBytesToRead Number of bytes to read. CheckSize Flag indicating if the number of bytes to

read is checked against the number of bytes actually read in determining the status of this method.

Output Parameters:

Parameter Description prv_Data Bytes that were read. NumBytes The number of bytes that were read.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 100: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 100

Write Purpose: Write to the communication port. The default version of this function writes via the ITransport interface. This function can be overloaded to handle the write differently.

Syntax: virtual BOOL write ( unsigned char *prv_Data, DWORD ll_NumBytesToWrite, int *NumBytes );

Input Parameters:

Parameter Description prv_Data The bytes to write. ll_NumBytesToWrite The number of bytes to write.

Output Parameters:

Parameter Description NumBytes The number of bytes written.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 101: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 101

InitCommunication Purpose: InitCommunication: Performs any initialization tasks with the communication port. By default this method just returns TRUE. This function should be overridden by the Device Translator object.

Syntax: virtual BOOL InitCommunication ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 102: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 102

InitPanel Purpose: This function performs any tasks needed to initialize the panel. By default this function returns TRUE. This function should be overridden by the DeviceTranslator. One example of a task that this function might need to perform is sending an init command to the panel.

Syntax: virtual BOOL InitPanel ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 103: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 103

PollPanel Purpose: This function is usually called by PollPanelForEvents. It usually sends a poll command to the hardware or just sleeps (for hardware that does not require a poll command) to give other threads a chance to do some work.

Syntax: virtual BOOL PollPanel ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 104: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 104

SendForLastReportedEvent Purpose: Send for the last reported event. By default this returns TRUE, this needs to be overridden to function differently. Currently this is not called by any function in the template Device Translator. One example of where this might be called is inside an overloaded InitiateEventRequest function.

Syntax: virtual BOOL SendForLastReportedEvent ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 105: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 105

GetLastReportedEvent Purpose: Currently this function is not being used. The purpose of this function was to get the last reported event. By default this returns 0, it needs to be overridden to function differently.

Syntax: virtual long GetLastReportedEvent ( );

Return Values:

Parameter Description long Last reported event.

Page 106: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 106

UnsolicitedEventRequest Purpose: Function used to start or stop polling. This function is an example of how this might be used. This method may need to be overridden to function differently.

Syntax: virtual BOOL UnsolicitedEventRequest ( long ll_EventNumber, BOOL vb_WaitForRsp );

Input Parameters:

Parameter Description ll_EventNumber The event number to start polling from, -1

indicates to stop polling. vb_WaitForRsp Indicates if this function should wait for a

response before returning.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 107: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 107

ReadClock Purpose: Returns the value of the date and time set in the hardware. This function needs to be overloaded by hardware that support this feature. The default implementation of this function returns the current system time.

Syntax: virtual BOOL ReadClock ( struct tm *prl_Time );

Output Parameters:

Parameter Description prl_Time Time.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 108: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 108

AreEventsPresent Purpose: This function determines if there are events in the hardware which need to be processed. Not all devices support this sort of function so if they do they will need to overload it with their own implementation (the default implementation always returns TRUE).

Syntax: virtual BOOL AreEventsPresent ( );

Return Values:

Parameter Description BOOL FALSE – Events are not present.

TRUE – Events are present.

Page 109: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 109

SendPanelNextCmdFromPipe Purpose: This function sends out the next command which was placed in the command pipe. This function needs to be overloaded by the specific Device Translator if supported. This method is called from within the Lnl_SendPanelNextDirectCmd. The template Device Translator includes an example implementation of this function.

Syntax: virtual BOOL SendPanelNextCmdFromPipe ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 110: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 110

SendPanelNextDirectCmd Purpose: Sends out the next direct command which is waiting. This function needs to be overloaded by the specific Device Translator if supported. This method is called from within the Lnl_SendPanelNextDirectCmd. The template Device Translator includes an example implementation of this function.

Syntax: virtual BOOL SendPanelNextDirectCmd ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 111: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 111

PollPanelForEvents Purpose: Function which polls the hardware to determine if there are events. The default implementation is an example of how this can be used, it may needsto be overridden by the specific Device Translator. This function is called from the Lnl_PollPanelForEvents method.

Syntax: virtual BOOL PollPanelForEvents ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 112: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 112

InitiateEventRequest Purpose: This method is called from the default implementation of InitializePanel when the panel is determined to be connected. Determines if there is at least one client listening and if it ins't sending events then it will toggle the flag that indicates that events are being sent. This could be useful if the panel is capable of storing events in memory and only wants to send them to the Lenel Communication Server if there are clients waiting to monitor these events. Other Device Translators may need to have this function differently so they would need to overload this method. One of the implemented Device Translators actually sends a command to the hardware requesting for the last reported event when the connection is re-established if there is at least one client listening.

Syntax: virtual BOOL InitiateEventRequest ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 113: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 113

IssuePrimaryPortCmd Purpose: This function is used to issue a command to the panel indicating the primary port. Not all Device Translators will need to implement this function, the default implementation is to always return TRUE. This method is called during the default implementation of the InitializePanel function.

Syntax: virtual BOOL IssuePrimaryPortCmd ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 114: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 114

SetPortTimingCfg Purpose: This method is called from the default implementation of InitializePanel after communication has been established to the panel so that the port timing can be configured. Not all Device Translators require this so the default implementation of this method is to always return TRUE. Those Device Translators that need this to function differently will need to override this funtion.

Syntax: virtual BOOL SetPortTimingCfg ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 115: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 115

IsDatabaseSet Purpose: This method is used to determine if the database is set. The default implementation of this function is to always return TRUE. Not all devices have a method for determining if the database is set but those that do will need to override this function. The InitializePanel method calls this function to determine if a database download needs to be issued for the panel after communications is established.

Syntax: virtual BOOL IsDatabaseSet ( );

Return Values:

Parameter Description BOOL FALSE – Database is not set.

TRUE – Database is set.

Page 116: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 116

SetDialBackRPCCount Purpose: Increments the dialback RPC count (sl_DialBackRPCCount). The dialback RPC count is used for dialup connections to keep track of the amount of time that the connection has been connected. This method is called roughly once a minute if the Device Translator supports the IDialup Interface.

Syntax: virtual void SetDialBackRPCCount ( );

Page 117: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 117

WaitForAppCommandEvent Purpose: The function is called a couple of times inside of the default implementation of InitializePanel if a response that is expected is not returned. Since a response is never received from the panel certain variables need to be reset so.

Syntax: BOOL WaitForAppCommandEvent ( );

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 118: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 118

WriteEventsToClients Purpose: Sends a message to the Lenel Communication Server to be distributed to applications which are listening, like Alarm Monitoring.

Syntax: virtual void WriteEventsToClients ( LNLMESSAGE *msg );

Input Parameters:

Parameter Description msg Structure containing the event / message

information (See IDistributeEvent documentation for more information).

Page 119: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 119

IsWinNT Purpose: Function that determines which operating system is currently being used (WindowsNT or Windows98).

Syntax: virtual BOOL IsWinNT ( );

Return Values:

Parameter Description BOOL FALSE – Operating system is not

Windows NT. TRUE – Operating system is Windows NT.

Page 120: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 120

CreateCommunicationObject Purpose: Create Communication Object. This function creates the Communication Transporter based on the CLSID that is passed in. If a Device Translator is not going to use a Communication Transporter then this function does not need to be called.

Syntax: BOOL CreateCommunicationObject ( CLSID CommObjectCLSID );

Input Parameters:

Parameter Description CommObjectCLSID CLSID (or GUID) of the Communication

Object to create.

Return Values:

Parameter Description BOOL FALSE – Failure.

TRUE – Success.

Page 121: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 121

DistributeDisplayTextMessage Purpose: Distributes a text message to be displayed in the application window of the Lenel Communication Server. This is useful during development.

Syntax: void DistributeDisplayTextMessage ( LPCTSTR TextMsg );

Input Parameters:

Parameter Description TextMsg Text message to be displayed in the

application window of the Lenel Communication Server.

Page 122: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 122

DetermineDirectCmdReplyType Purpose: This function is used in the example implementations of the SendPanelNextDirectCmd and SendPanelNextCmdFromPipe functions to indicate that the reply type for the command needs to be determined. If these functions are to be overloaded, then a function similar to this needs to be implemented to actually be able to determine the reply type of the command.

Syntax: virtual BOOL DetermineDirectCmdReplyType ( );

Return Values:

Parameter Description BOOL FALSE – Reply is a NAK.

TRUE – Reply is an Acknowledgement.

Page 123: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 123

AsciiHexCharToInt Purpose: Converts an ASCII character represented in hex into the decimal equivalent returned as an integer.

Syntax: HRESULT AsciiHexCharToInt ( unsigned char c );

Input Parameters:

Parameter Description c Hex character.

Return Values:

Parameter Description int Value of the ASCII hex character or -1 if

there was a problem.

Page 124: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 124

DebugDisplayBufferHex Purpose: Displays the hex characters in a buffer via trace statements.

Syntax: void DebugDisplayBufferHex ( LPCTSTR header, unsigned char *buffer, int numBytes );

Input Parameters:

Parameter Description header Header or description to be displayed

before the bytes. buffer Pointer to an array of bytes to display. numBytes Number of bytes to display.

Page 125: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 125

DebugDisplayBufferChar Purpose: Displays the characters in the buffer via trace statements.

Syntax: void DebugDisplayBufferChar ( LPCTSTR header, unsigned char *buffer, int numBytes );

Input Parameters:

Parameter Description header Header or description to be displayed

before the bytes. buffer Pointer to an array of bytes to display. numBytes Number of bytes to display.

Page 126: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 126

CheckCOMStatus Purpose: Check the return COM status of a COM interface method.

Syntax: BOOL CheckCOMStatus ( HRESULT hr, LPTSTR MethodStr );

Input Parameters:

Parameter Description hr COM status to check. MethodStr Text description of the method that the

COM status is from.

Return Values:

Parameter Description BOOL FALSE – Bad status.

TRUE – Good Status.

Page 127: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 127

InitializePanel Purpose: This function is called via the Lnl_InitializePanel method of the ITranslate interface. It is called during the polling routine of the Lenel Communication Server. If the panel is not currently online then the initialization steps are performed to try and get the panel online, otherwise if the panel is online nothing is done.

Syntax: int InitializePanel ( );

Return Values:

Parameter Description int The current panel state:

PANEL_STATE_OFFLINE or PANEL_STATE_READY.

Page 128: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 128

StartDatabaseThread Purpose: Starts a database download. It calls the Lnl_StartDatabaseThread method of the IDistributeEvent interface and passes it the current Panel ID and the m_DatabaseDownloadArray byte array of commands. This array of commands is usually filled in during the constructor of the Device Translator.

Syntax: void StartDatabaseThread ( );

Page 129: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 129

IsTimezoneActive Purpose: Makes a call to the Lenel Communication Server using the IDistributeEvent interface to check to see if a timezone is active.

Syntax: BOOL IsTimezoneActive ( long timeZone, );

Input Parameters:

Parameter Description timeZone Timezone to check to see if it is currently

active.

Return Values:

Parameter Description BOOL FALSE – Timezone is not active.

TRUE – Timezone is active.

Page 130: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 130

StartReaderDownload Purpose: Makes a call to the Lenel Communication Server using the IDistributeEvent interface to check to see if a timezone is active.

Syntax: BOOL StartReaderDownload ( int numReaders, BYTE *readerArray, BYTE *downloadArray );

Input Parameters:

Parameter Description numReaders Number of readers the reader download is

for. readerArray Array of readers to download. downloadArray Reader download commands to be

executed during reader download.

Return Values:

Parameter Description BOOL FALSE – Timezone is not active.

TRUE – Timezone is active.

Page 131: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 131

SetCommunicationType2 Purpose: Sets the type of communication that is being used as the secondary communication type. This is used when multiple communication paths are being used.

Syntax: void SetCommunicationType2 ( int vi_Value );

Input Parameters:

Parameter Description vi_Value The secondary communication type.

Page 132: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 132

GetCommunicationType2 Purpose: Returns the communication type that is being used as the secondary communication method.

Syntax: int GetCommunicationType2 ( );

Return Values:

Parameter Description int Type of secondary communication.

Page 133: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 133

SetTapiName2 Purpose: Sets the secondary TAPI name being used.

Syntax: void SetTapiName2 ( CString prl_Value ( );

Input Parameters:

Parameter Description prl_Value Secondary TAPI name.

Page 134: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 134

GetTapiName2 Purpose: Obtains the name of the secondary TAPI name.

Syntax: CString GetTapiName2 ( );

Return Values:

Parameter Description CString Secondary TAPI name.

Page 135: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 135

SetPanelNumber2 Purpose: Sets the secondary panel phone number.

Syntax: void SetPanelNumber2 ( CString prl_Value );

Input Parameters:

Parameter Description prl_Value Secondary panel phone number.

Page 136: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 136

GetPanelNumber2 Purpose: Obtains the secondary panel phone number.

Syntax: CString GetPanelNumber2 ( );

Return Values:

Parameter Description CString Secondary panel phone number.

Page 137: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 137

SetEventDialBackThreshold2 Purpose: Sets the secondary event dial back threshold.

Syntax: void SetEventDialBackThreshold2 ( int vl_Counter, );

Input Parameters:

Parameter Description vl_Counter Secondary event dial back threshold.

Page 138: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 138

GetEventDialBackThreshold2 Purpose: Obtains the secondary event dial back threshold.

Syntax: long GetEventDialBackThreshold2 ( );

Return Values:

Parameter Description long Secondary event dial back threshold.

Page 139: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 139

Lnl_CreateCommunicationObject Purpose: This method is called to have the Device Translator create a Communication Transporter object if one is being used. The default implementation calls the CreateCommunicationObject function instructing it to create an RS-232 Communication Transporter. For those Device Translators that require a different means of communication this method needs to be overridden.

Syntax: HRESULT Lnl_CreateCommunicationObject ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 140: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 140

Lnl_ConnectCommunicationManager Purpose: For those Device Translators that require a Communication Manager object this method is called to make the proper connections. Not all Device Translators require a Communication Manager, only those that share a communications path and need a way to manage the use of the path or paths. For example, the sharing of modems is a very good example of why one of these Communication Managers may be required.

Syntax: HRESULT Lnl_ConnectCommunicationManager ( REFIID iid, IUnknown *pIUnknown );

Input Parameters:

Parameter Description iid pIUnknown

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 141: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 141

Lnl_RequireCTManager Purpose: Method that is called to determine if a Communication Manager (Communication Transporter Manager) is required. Not all Device Translators require a Communication Manager. The default implementation indicates that no manager is required. The method needs to be overridden by those Device Translators that require a Communication Manager.

Syntax: HRESULT Lnl_RequireCTManager ( int *ManagerRequired );

Output Parameters:

Parameter Description ManagerRequired Type of manager required.

0 – Manager not required 1 – Lenel Manager 2 – Apollo Dialup Manager

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 142: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 142

Lnl_InitCommunication Purpose: Initializes communication to be used. The default implementation calls the InitCommunication function.

Syntax: HRESULT Lnl_InitCommunication ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 143: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 143

Lnl_GetSystemStatus Purpose: Method to grab the system status. The system status can be returned synchronously or asynchronously and this can be indicated by setting the proper flag in this structure. When returning the status synchronously the structure is filled in with the status otherwise status messages need to be created and sent when available. This method needs to be overridden by each Device Translator, the default implementation does not do anything.

Syntax: HRESULT Lnl_GetSystemStatus ( SYSTEM_STATUS *p_Status );

Output Parameters:

Parameter Description p_Status Structure containing the system status

information.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 144: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 144

Lnl_CloseCommunication Purpose: Performs the required steps for closing down communication. The default implementation only generates the offline event, this method needs to be overridden to perform the required steps for closing communication.

Syntax: HRESULT Lnl_CloseCommunication ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 145: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 145

Lnl_GetPanelEventSerialNumber Purpose: Grabs the next event serial number. The default implementation calls the GetPanelEventSerialNumber function.

Syntax: HRESULT Lnl_GetPanelEventSerialNumber ( long *num );

Output Parameters:

Parameter Description num Event serial number.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 146: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 146

Lnl_UnsolicitedEventRequest Purpose: This method is used to start polling or to stop polling for events. The default implementation of this method makes a call to the UnsolicitedEventRequest function.

Syntax: HRESULT Lnl_UnsolicitedEventRequest ( long ll_EventNumber, BOOL vb_WaitForRsp );

Input Parameters:

Parameter Description ll_EventNumber Indicates the event number to start polling

from, -1 indicates to stop polling. vb_WaitForRsp Flag indicating if this method should wait

for a response before returning.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 147: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 147

Lnl_PollPanelForEvents Purpose: Method that polls the panel for events. The default implementation calls the PollPanelForEvents function.

Syntax: HRESULT Lnl_PollPanelForEvents ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 148: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 148

Lnl_IncrementMonitorReq Purpose: This method increments the monitor counter. The default implementation calls the IncrementMonitorReq function.

Syntax: HRESULT Lnl_IncrementMonitorReq ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 149: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 149

Lnl_DecrementMonitorReq Purpose: This method decrements the monitor counter. The default implementation calls the DecrementMonitorReq function.

Syntax: HRESULT Lnl_DecrementMonitorReq ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 150: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 150

Lnl_GetPanelID Purpose: Grabs the panel ID, the default implementation calls GetPanelID.

Syntax: HRESULT Lnl_GetPanelID ( int *panel_id );

Output Parameters:

Parameter Description panel_id Panel ID.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 151: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 151

Lnl_SetEventCounter Purpose: This method sets the event serial number variable that will be used. The default implementation makes a call to the SetEventCounter method.

Syntax: HRESULT Lnl_SetEventCounter ( long vl_Counter, );

Input Parameters:

Parameter Description vl_Counter Event serial number.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 152: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 152

Lnl_SetPanelID Purpose: This method sets the panel ID. The default implementation makes a call to SetPanelID.

Syntax: HRESULT Lnl_SetPanelID ( int panel_id );

Input Parameters:

Parameter Description panel_id Panel ID.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 153: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 153

Lnl_InitializePanel Purpose: This is the method that is called repeatedly during the polling of the panels by the Lenel Communication Server. If the panel is online this method simply returns, but if the panel is offline steps are performed to initialize the panel so it can become online. The default implementation calls the InitializePanel function.

Syntax: HRESULT Lnl_InitializePanel ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 154: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 154

Lnl_SetPanelOffline Purpose: This method is called when it is determined that the panel is offline. Its purpose is to perform a few steps that are required when a panel transitions from being online to being offline like sending the offline event and setting a few variables. The default implementation makes the call to SetPanelOffline.

Syntax: HRESULT Lnl_SetPanelOffline ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 155: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 155

Lnl_ReadClock Purpose: This method is called to read the clock from the hardware. The default implementation of this method makes a call to ReadClock. Not all hardware has a clock so this function can be overridden to indicate this, the default implementation returns the time of the system clock.

Syntax: HRESULT Lnl_ReadClock ( struct tm *prl_Time );

Output Parameters:

Parameter Description prl_Time Structure containing the time.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 156: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 156

Lnl_SendPanelNextDirectCmd Purpose: This method is called during the polling loop by the Lenel Communication Server to have any pending commands be sent to the hardware. The default implementation of this method makes a call to both SendPanelNextDirectCmd and SendPanelNextCmdFromPipe.

Syntax: HRESULT Lnl_SendPanelNextDirectCmd ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 157: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 157

Lnl_SetClock Purpose: Sets the clock for the hardware. The default implementation just returns S_OK, this method needs to be overridden to perform the steps to actually set the clock or to indicate that this method is not implemented.

Syntax: HRESULT Lnl_SetClock ( long vl_Time, BOOL vb_WaitForRsp );

Input Parameters:

Parameter Description vl_Time Time to set. vb_WaitForRsp FALSE – Do not wait for a response.

TRUE – Wait for a response.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 158: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 158

Lnl_SetDBEnabledFlag Purpose: Sets the database enabled flag to the value that is passed in. This is used to inform the Device Translator the state of database so that events are only sent when the database is enabled so that they can be logged to the database. The default implementation sets the m_IsDBLoggingEvents flag with the value passed in.

Syntax: HRESULT Lnl_SetDBEnabledFlag ( BOOL vb_IsDBLoggingEvents );

Input Parameters:

Parameter Description vb_IsDBLoggingEvents FALSE – Database is not logging events.

TRUE – Database is logging events.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 159: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 159

Lnl_IssueColdStartCmd Purpose: This method is used to indicate to the Device Translator that a cold start needs to be performed on the hardware. This command is also sent when a database download is requested to be performed to the hardware. The default implementation of this method only returns S_OK so this method needs to be overridden to actually be used by the Device Translator.

Syntax: HRESULT Lnl_IssueColdStartCmd ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 160: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 160

Lnl_ResetPowerUpFlag Purpose: This method can be issued at the end of a database download for those hardware that need some sort of reset. Not all the Device Translators will require this. The default implementation of this method just returns S_OK so if this method is required by a Device Translator it will need to be overridden. This method can be issued at the end of a database download by including this in the list of items to be performed during a database download. Refer to the IDistributeEvent documentation for more about executing this command at the end of a download.

Syntax: HRESULT Lnl_ResetPowerUpFlag ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 161: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 161

Lnl_DownloadFirmware Purpose: This method is used to download firmware to the panel. The default implementation just returns S_OK so if this method is required it will need to be overridden. When overriding this method the Device Translator will need to know how and where to grab the firmware that is to be downloaded to the panel.

Syntax: HRESULT Lnl_DownloadFirmware ( );

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 162: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 162

Lnl_ConnectToPanel Purpose: This method is used to allow the Device Translator to connect to a panel when requested. This is useful for panels that are not always connected (ex. dialup panels). The default implementation of this method is to just return S_OK, so it will need to be overridden if this method is required.

Syntax: HRESULT Lnl_ConnectToPanel ( BOOL vb_Connect, BOOL vb_GenerateEvent );

Input Parameters:

Parameter Description vb_Connect FALSE – Disonnect.

TRUE – Connect. vb_GenerateEvent Flag that indicates if an event should be

generated.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 163: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 163

Lnl_IsDownloadFinished Purpose: Determines if a database download is finished. The default implementation of this method always returns S_OK. This method needs to be overridden to function differently.

Syntax: HRESULT Lnl_IsDownloadFinished ( );

Return Values:

Parameter Description HRESULT S_OK - on Success (download finished)

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 164: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 164

Lnl_SetDST Purpose: Sets the Daylight Savings flag. The default implementation calls SetDST.

Syntax: HRESULT Lnl_SetDST ( BOOL vi_Value );

Input Parameters:

Parameter Description vi_Value DST value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 165: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 165

Lnl_GetDST Purpose: Gets the value of the Daylight Savings flag. The default implementation calls GetDST.

Syntax: HRESULT Lnl_GetDST ( BOOL *Value );

Output Parameters:

Parameter Description Value DST value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 166: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 166

Lnl_SetIsDialupDriver Purpose: Sets the flag indicating if this Device Translator uses dialup. The default implementation of this method calls the SetIsDialupDriver function.

Syntax: HRESULT Lnl_SetIsDialupDriver ( BOOL vi_Value );

Input Parameters:

Parameter Description vi_Value Dialup up driver flag value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 167: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 167

Lnl_GetIsDialupDriver Purpose: Gets the flag indicating if this Device Translator uses dialup. The default implementation of this method calls the GetIsDialupDriver function.

Syntax: HRESULT Lnl_GetIsDialupDriver ( int *Value );

Output Parameters:

Parameter Description Value Dialup driver flag value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 168: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 168

Lnl_SetDownloadInProgressState Purpose: Sets the flag indicating if a download is progress. The default implementation of this method makes a call to SetDownloadInProgressState.

Syntax: HRESULT Lnl_SetDownloadInProgressState ( BOOL State );

Input Parameters:

Parameter Description State State of the download.

FALSE – Download not in progress. TRUE – Download in progress.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 169: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 169

Lnl_SetLineError Purpose: Sets the line error flag. The default implementation calls SetLineError.

Syntax: HRESULT Lnl_SetLineError ( BOOL vi_Value );

Input Parameters:

Parameter Description vi_Value Value of the line error.

FALSE – No line error. TRUE – Line error.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL – Not Implemented

Page 170: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 170

Lnl_GetLineError Purpose: Get the line error flag. The default implementation calls GetLineError.

Syntax: HRESULT Lnl_GetLineError ( BOOL *Value );

Output Parameters:

Parameter Description Value Value of the line error flag.

FALSE – No line error. TRUE – Line error.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL – Not Implemented

Page 171: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 171

Lnl_SetPanelState Purpose: Sets the state of the panel. The default implementation calls the SetPanelState function.

Syntax: HRESULT Lnl_SetPanelState ( int vi_Value );

Input Parameters:

Parameter Description vi_Value State of the panel

(PANEL_STATE_OFFLINE, PANEL_STATE_READY).

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL – Not Implemented

Page 172: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 172

Lnl_GetPanelState Purpose: Gets the state of the panel. The default implementation calls the GetPanelState function.

Syntax: HRESULT Lnl_GetPanelState ( int *Value );

Output Parameters:

Parameter Description Value State of the panel

(PANEL_STATE_OFFLINE, PANEL_STATE_READY).

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 173: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 173

Lnl_SetDirectCmd Purpose: This method is used to re-send a command that had failed previously. This is used by Device Translators that return the status of commands asynchronously and if these commands fail they save the command to the database so it can be sent at a later time. Special logic needs to be in place inside the Lenel Communication Server in order for this method to be called on a particular Device Translator.

Syntax: HRESULT Lnl_SetDirectCmd ( BYTE *pro_Data );

Input Parameters:

Parameter Description pro_Data Raw data of command to send.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 174: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 174

Lnl_SetPanelName Purpose: Sets the name of the panel. The default implementation of this method calls the SetPanelName function.

Syntax: HRESULT Lnl_SetPanelName ( BSTR prl_Value );

Input Parameters:

Parameter Description prl_Value Array of bytes containing the panel name.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 175: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 175

Lnl_SetPanelType Purpose: Sets the panel type. The default implementation makes a call to SetPanelType.

Syntax: HRESULT Lnl_SetPanelType ( int Value );

Input Parameters:

Parameter Description Value Panel type.

Return Values:

Parameter Description HRESULT S_OK – on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 176: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 176

Lnl_GetPanelType Purpose: Gets the panel type. The default implementation of this method makes a call to GetPanelType.

Syntax: HRESULT Lnl_GetPanelType ( int *Value );

Output Parameters:

Parameter Description Value Panel type.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 177: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 177

Lnl_SetPanelTZInfo Purpose: Sets the timezone information variable (m_WorldTZ).

Syntax: HRESULT Lnl_SetPanelTZInfo ( TZI *Value );

Input Parameters:

Parameter Description Value Structure containing the timezone

information.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 178: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 178

Lnl_GetPanelTZInfo Purpose: Get the timezone information. The default implementation of this method fills in the structure with the correct values from the m_WorldTZ variable.

Syntax: HRESULT Lnl_GetPanelTZInfo ( TZI *Value );

Output Parameters:

Parameter Description Value Structure containing the timezone

information.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 179: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 179

Lnl_SetCommunicationType Purpose: Sets the communication type. The default implementation makes a call to SetCommunicationType (See the documentation on SetCommunicationType for the available communication types).

Syntax: HRESULT Lnl_SetCommunicationType ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Communication type.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 180: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 180

Lnl_GetCommunicationType Purpose: Returns the type of communication that is being used. The default implementation makes a call to GetCommunicationType.

Syntax: HRESULT Lnl_GetCommunicationType ( int *Value );

Output Parameters:

Parameter Description Value Communication type.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 181: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 181

Lnl_IsPanelOnline Purpose: Determines if the panel / hardware is online. It does this by determining if the current panel state is PANEL_STATE_READY. The default implementation makes a call to GetPanelState and compares the current state to PANEL_STATE_READY.

Syntax: HRESULT Lnl_IsPanelOnline ( BOOL *Value );

Output Parameters:

Parameter Description Value FALSE – Panel is not online.

TRUE – Panel is online.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 182: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 182

Lnl_GetVersionInfo Purpose: This method was designed to return the version information of the hardware, but currently is not used. The version information can be returned via a status message (see documentation on the IDistributeEvent Interface or on creating Events).

Syntax: HRESULT Lnl_GetVersionInfo ( long* major, long* minor, long* build );

Output Parameters:

Parameter Description major Major part of the version number. minor Minor part of the version number. build Build part of the version number.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 183: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 183

Lnl_GetComPort Purpose: Determines the value of the com port variable. The default implementation calls the GetComPort function.

Syntax: HRESULT Lnl_GetComPort ( int *ComPort );

Output Parameters:

Parameter Description ComPort Com port value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 184: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 184

Lnl_SetComPort Purpose: Sets the com port variable. The default implementation calls the SetComPort function.

Syntax: HRESULT Lnl_SetComPort ( int ComPort );

Input Parameters:

Parameter Description ComPort Com port value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 185: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 185

Lnl_SetComPort2 Purpose: Sets the value of the secondary com port variable. The default implementation calls the SetComPort2 function.

Syntax: HRESULT Lnl_SetComPort2 ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Secondary com port value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 186: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 186

Lnl_GetComPort2 Purpose: Gets the value of the secondary com port variable. The default implementation calls the GetComPort2 function.

Syntax: HRESULT Lnl_GetComPort2 ( int *Value );

Output Parameters:

Parameter Description Value Secondary com port value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 187: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 187

Lnl_SetBaudRate Purpose: Sets the baud rate variable. The default implementation calls the SetBaudRate method.

Syntax: HRESULT Lnl_SetBaudRate ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Baud rate value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 188: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 188

Lnl_GetBaudRate Purpose: Gets the baud rate. The default implementation calls the GetBaudRate function.

Syntax: HRESULT Lnl_GetBaudRate ( int *Value );

Output Parameters:

Parameter Description Value Baud rate value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 189: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 189

Lnl_SetPanelAddress Purpose: Sets the panel address variable. The default implementation calls the SetPanelAddress implementation.

Syntax: HRESULT Lnl_SetPanelAddress ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Panel address value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 190: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 190

Lnl_GetPanelAddress Purpose: Get the panel address variable. The default implementation calls the GetPanelAddress function.

Syntax: HRESULT Lnl_GetPanelAddress ( int *Value );

Output Parameters:

Parameter Description Value Panel address value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 191: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 191

Lnl_SetPrimaryIP Purpose: Set the primary IP value. The default implementation calls the SetPrimaryIP function.

Syntax: HRESULT Lnl_SetPrimaryIP ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Primary IP value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 192: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 192

Lnl_GetPrimaryIP Purpose: Get the primary IP value. The default implementation calls the GetPrimaryIP function.

Syntax: HRESULT Lnl_GetPrimaryIP ( int *Value );

Output Parameters:

Parameter Description Value Primary IP value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL - Not Implemented

Page 193: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 193

Lnl_SetSecondaryIP Purpose: Set the secondary IP value. The default implementation calls the SetSecondaryIP function.

Syntax: HRESULT Lnl_SetSecondaryIP ( int vi_Value );

Input Parameters:

Parameter Description vi_Value Secondary IP value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL – Not Implemented

Page 194: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 194

Lnl_GetSecondaryIP Purpose: Get the secondary IP value. The default implementation calls the GetSecondaryIP function.

Syntax: HRESULT Lnl_GetSecondaryIP ( int *Value );

Output Parameters:

Parameter Description Value Secondary IP value.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL – Not Implemented

Page 195: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 195

Lnl_SetPanelPassword Purpose: Sets the panel password variable in the Device Translator.

Syntax: HRESULT Lnl_SetPanelPassword ( BSTR password );

Output Parameters:

Parameter Description password password.

Return Values:

Parameter Description HRESULT S_OK - on Success

E_FAIL - on Failure E_NOTIMPL – Not Implemented

Page 196: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 196

Device Translator Template Member Variables lb_WinNT Type: BOOL

Description: Variable that indicates if the platform the driver is running on is NT.

ci_ComPort Type: int

Description: Communications port number being used.

m_PanelID Type: int

Description: Panel ID being used.

m_GeneralBuffer Type: BYTE [COM_BUFFER_SIZE]

Description: General buffer used with SendCommandPacket and GetCmd

cl_EventCounter Type: long

Page 197: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 197

Description: Event counter which is assigned to events so they can be stored uniquely in the database.

m_CardExType Type: int

Description: Card Ex Type

m_BaudRate Type: int

Description: The baud rate being used for communications.

m_PanelAddress Type: int

Description: Panel Address of the panel.

m_ComPort2 Type: long

Description: Second com port value.

m_PrimaryIP Type: long

Description:

Page 198: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 198

Primary IP

m_TwoWireRS485 Type: long

Description: Value of TwoWireRS485

m_SecondaryIP Type: long

Description: Secondary IP

m_ConnectionType Type: long

Description: Indicates type of Communication.

m_dwGeneralSize Type: DWORD

Description: Size of the General Buffer (m_GeneralBuffer).

m_bSendingEvents Type: BOOL

Description: Determines whether events are being polled from the device.

Page 199: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 199

m_DaylightSavings Type: BOOL

Description: Indicates if daylight savings is being used.

m_CardRecCfg Type: CARD_REC_CFG

Description: Card Rec CFG structure

m_DataCS Type: CRITICAL_SECTION

Description: Critical Section used with setting the member variables of the Device Translator.

m_LastInitTime Type: long

Description: Last time of init command. Used if the time of the last init command was sent needs to be kept track up.

si_TapiName Type: CString

Description: Tapi Dialup Name

Page 200: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 200

si_PanelName Type: CString

Description: Panel Name

si_HostNumber Type: CString

Description: Host phone number

si_HostNumber2 Type: CString

Description: Second host phone number

si_PanelNumber Type: CString

Description: Panel phone number

si_DialupTZ Type: long

Description: Dialup TZ

Page 201: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 201

si_DialupTZ2 Type: long

Description: Second Dialup TZ

sl_DialBackThreshold Type: long

Description: Dialback Threshold

sl_DialBackRPCCount Type: long

Description: Dial Back RPC Count.

m_bIsDialupDriver Type: BOOL

Description: Indicates if this Device Translator is being used with Dialup.

ci_PanelState Type: int

Description: Indicates the panel's current state (PANEL_STATE_OFFLINE, PANEL_STATE_READY).

Page 202: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 202

cb_LineError Type: BOOL

Description: Indicates if there is a line error.

m_IsDownloadInProgress Type: BOOL

Description: Indicates if a download to the panel is in progress.

m_bEnablePanelStorage Type: BOOL

Description: Flag indicating if events are to be stored in the panel

pTransport Type: ITransport

Description: ITransport Interface pointer to the Communication Transporter.

pRs232 Type: IRs232

Description: RS232 Interface pointer to the Communication Transporter.

Page 203: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 203

pComTranMgr Type: IComManager

Description: Communication Transporter Manager interface

co_EventLog Type: CEventLog

Description: Variable which is used to log information (errors) to the event log.

m_pDistributeEvent Type: IDistributeEvent

Description: Interface pointer used to pass information back to the Lenel Communication Server application.

m_PanelType Type: long

Description: Variable that stores the type of panel. This is useful when the same Device Translator can be used for more than one panel type.

m_WorldTZ Type: TZI

Description: World TimeZone information structure.

Page 204: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 204

co_CmdPipe Type: CLocalNamedPipe

Description: Pipe handle for the pipe that commands are placed up that are to be sent to the hardware.

ci_MonitorReqNum Type: int

Description: Number of requests to monitor events.

m_IsDBLoggingEvents Type: BOOL

Description: Used to determine if logging events.

ch_PollCmdEvent Type: HANDLE

Description: Since polling requires multiple steps this event is a special case for this situation.

ch_AppCmdEvent Type: HANDLE

Description: Handle for the incoming event.

Page 205: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 205

ch_AppRspEvent Type: HANDLE

Description: Handle for the response to the incoming event.

cb_CommandStatus Type: BOOL

Description: Return value for the status of the command that uses the cb_CommandBuffer, used to indicate the status of RPC based commands.

cb_CommandBuffer Type: BYTE [COM_BUFFER_SIZE]

Description: This buffer is specifically for incoming RPC commands that need a response immediately. It is protected by an event that limits the user of the buffer.

cb_ReplyBuffer Type: BYTE [COM_BUFFER_SIZE]

Description: This buffer is specifically for incoming RPC commands that need a response immediately. It is protected by an event that limits the user of the buffer.

cl_CommandLength Type: DWORD

Description:

Page 206: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 206

Length of the command buffer (cb_CommandBuffer).

cl_ReplyLength Type: DWORD

Description: Length of the reply buffer (cb_ReplyBuffer).

ch_CmdBufferEvent Type: HANDLE

Description: Controls access to the buffer used for sending commands.

cb_RspBuffer Type: BYTE [COM_BUFFER_SIZE]

Description: Response buffer for receiving data from the devices.

cb_CmdBuffer Type: BYTE [COM_BUFFER_SIZE]

Description: Command buffer for sending data to devices.

cw_ComLength Type: short

Description: Length of the entire communication message.

Page 207: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 207

ci_DataLength Type: int

Description: Length of data portion of communication message.

cb_Sequence Type: BYTE

Description: Message sequence number for sending packets.

m_PossibleChecksumError Type: BOOL

Description: Flag which determines if messages are sent on to monitoring indicating that a possible checksum error occurred.

m_DatabaseDownloadArray Type: BYTE [255]

Description: Byte array that contains the database download commands that are needed when a database download is to be performed. For those Device Translators that require a database download this array should be filled in (a good spot for filling this in may be in the constructor). The Lnl_StartDatabaseThread method passes this array to the Lenel Communication Server when kicking off a database download.

s_PanelPassword Type: CString

Page 208: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 208

Description: Panel Password.

m_SecondaryConnectionType Type: long

Description: Type of communications used for the secondary communications path.

si_PanelNumber2 Type: CString

Description: Secondary panel phone number.

si_SecondaryTapiName2 Type: CString

Description: Secondary TAPI name.

si_DialbackThreshold2 Type: long

Description: Secondary event dialback threshold.

m_EventIndex Type: long

Description:

Page 209: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 209

Variable that is used to keep track of the event index. This is used for those controllers that keep track of where in the event buffer the next event is to be grabbed.

Page 210: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation July 19, 2016 210

Device Translator Template Error Codes Name Value Description

Page 211: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation 211

Index ~CDeviceTranslator .................................. 16 AreEventsPresent .................................... 108 AsciiHexCharToInt ................................. 123 cb_CmdBuffer......................................... 206 cb_CommandBuffer ................................ 205 cb_CommandStatus ................................ 205 cb_LineError ........................................... 202 cb_ReplyBuffer ....................................... 205 cb_RspBuffer .......................................... 206 cb_Sequence ........................................... 207 CDeviceTranslator .................................... 15 ch_AppCmdEvent ................................... 204 ch_AppRspEvent .................................... 205 ch_CmdBufferEvent ............................... 206 ch_PollCmdEvent ................................... 204 CheckCOMStatus ................................... 126 ci_ComPort ............................................. 196 ci_DataLength ......................................... 207 ci_MonitorReqNum ................................ 204 ci_PanelState ........................................... 201 cl_CommandLength ................................ 205 cl_EventCounter ..................................... 196 cl_ReplyLength ....................................... 206 co_CmdPipe ............................................ 204 co_EventLog ........................................... 203 ConnectCommunicationTransporter ......... 88 ConvertFromGMTToLocal ....................... 86 ConvertFromLocalToGMT ....................... 85 CreateCommunicationObject .................. 120 cw_ComLength ....................................... 206 DebugDisplayBufferChar ....................... 125 DebugDisplayBufferHex ........................ 124 DecodeSegmentValue ............................... 17 DecrementMonitorReq ............................. 27 DetermineDirectCmdReplyType ............ 122 Device Translator Template ........................ 8 Device Translator Template Error Codes 210 Device Translator Template Member

Variables ............................................. 196 DistributeDisplayTextMessage ............... 121 ForwardAsyncMsg .................................... 96 GetBaudRate ............................................. 44 GetCardExType ........................................ 46

GetCmd ..................................................... 18 GetCommunicationType ........................... 56 GetCommunicationType2 ....................... 132 GetComPort .............................................. 38 GetComPort2 ............................................ 42 GetDialupTZ ............................................. 67 GetDialupTZ2 ........................................... 69 GetDownloadInProgressState ................... 76 GetDST ..................................................... 71 GetEventDialBackThreshold .................... 80 GetEventDialBackThreshold2 ................ 138 GetHostNumber ........................................ 61 GetHostNumber2 ...................................... 63 GetIsDialupDriver..................................... 73 GetLastReportedEvent ............................ 105 GetLineError ............................................. 32 GetMonitorReqCount ............................... 28 GetPanelAddress ....................................... 48 GetPanelEventSerialNumber .................... 78 GetPanelID ................................................ 36 GetPanelNumber ....................................... 65 GetPanelNumber2 ................................... 136 GetPanelState ............................................ 34 GetPanelType ............................................ 40 GetPanelTZInfo ........................................ 87 GetPrimaryIP ............................................ 50 GetReply ................................................... 93 GetReplyPacket ......................................... 91 GetSecondaryIP ........................................ 54 GetSendingEvents ..................................... 25 GetTapiName ............................................ 59 GetTapiName2 ........................................ 134 GetUseTwoWireRS485 ............................ 52 IdleLine ..................................................... 84 IncrementMonitorReq ............................... 26 InitCommunication ................................. 101 InitializePanel ......................................... 127 InitiateEventRequest ............................... 112 InitPanel .................................................. 102 IsDatabaseSet .......................................... 115 IsDBLoggingEvents .................................. 21 IsLanConnected ........................................ 95 IssuePrimaryPortCmd ............................. 113

Page 212: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation 212

IsTimezoneActive ................................... 129 IsWinNT ................................................. 119 lb_WinNT ............................................... 196 Lnl_CloseCommunication ...................... 144 Lnl_ConnectCommunicationManager .... 140 Lnl_ConnectToPanel .............................. 162 Lnl_CreateCommunicationObject .......... 139 Lnl_DecrementMonitorReq .................... 149 Lnl_DownloadFirmware ......................... 161 Lnl_GetBaudRate ................................... 188 Lnl_GetCommunicationType ................. 180 Lnl_GetComPort ..................................... 183 Lnl_GetComPort2 ................................... 186 Lnl_GetDST ............................................ 165 Lnl_GetIsDialupDriver ........................... 167 Lnl_GetLineError ................................... 170 Lnl_GetPanelAddress ............................. 190 Lnl_GetPanelEventSerialNumber ........... 145 Lnl_GetPanelID ...................................... 150 Lnl_GetPanelState .................................. 172 Lnl_GetPanelType .................................. 176 Lnl_GetPanelTZInfo ............................... 178 Lnl_GetPrimaryIP ................................... 192 Lnl_GetSecondaryIP ............................... 194 Lnl_GetSystemStatus .............................. 143 Lnl_GetVersionInfo ................................ 182 Lnl_IncrementMonitorReq ..................... 148 Lnl_InitCommunication .......................... 142 Lnl_InitializePanel .................................. 153 Lnl_IsDownloadFinished ........................ 163 Lnl_IsPanelOnline .................................. 181 Lnl_IssueColdStartCmd .......................... 159 Lnl_PollPanelForEvents ......................... 147 Lnl_ReadClock ....................................... 155 Lnl_RequireCTManager ......................... 141 Lnl_ResetPowerUpFlag .......................... 160 Lnl_SendPanelNextDirectCmd ............... 156 Lnl_SetBaudRate .................................... 187 Lnl_SetClock .......................................... 157 Lnl_SetCommunicationType .................. 179 Lnl_SetComPort ..................................... 184 Lnl_SetComPort2 ................................... 185 Lnl_SetDBEnabledFlag .......................... 158 Lnl_SetDirectCmd .................................. 173 Lnl_SetDownloadInProgressState .......... 168 Lnl_SetDST ............................................ 164

Lnl_SetEventCounter .............................. 151 Lnl_SetIsDialupDriver ............................ 166 Lnl_SetLineError .................................... 169 Lnl_SetPanelAddress .............................. 189 Lnl_SetPanelID ....................................... 152 Lnl_SetPanelName ................................. 174 Lnl_SetPanelOffline ............................... 154 Lnl_SetPanelPassword ............................ 195 Lnl_SetPanelState ................................... 171 Lnl_SetPanelType ................................... 175 Lnl_SetPanelTZInfo ............................... 177 Lnl_SetPrimaryIP ................................... 191 Lnl_SetSecondaryIP ............................... 193 Lnl_UnsolicitedEventRequest ................ 146 LogEvent ................................................... 89 m_BaudRate ............................................ 197 m_bEnablePanelStorage ......................... 202 m_bIsDialupDriver ................................. 201 m_bSendingEvents ................................. 198 m_CardExType ....................................... 197 m_CardRecCfg ....................................... 199 m_ComPort2 ........................................... 197 m_ConnectionType ................................. 198 m_DatabaseDownloadArray ................... 207 m_DataCS ............................................... 199 m_DaylightSavings ................................. 199 m_dwGeneralSize ................................... 198 m_EventIndex ......................................... 208 m_GeneralBuffer .................................... 196 m_IsDBLoggingEvents........................... 204 m_IsDownloadInProgress ....................... 202 m_LastInitTime....................................... 199 m_PanelAddress ..................................... 197 m_PanelID .............................................. 196 m_PanelType .......................................... 203 m_pDistributeEvent ................................ 203 m_PossibleChecksumError ..................... 207 m_PrimaryIP ........................................... 197 m_SecondaryConnectionType ................ 208 m_SecondaryIP ....................................... 198 m_TwoWireRS485 ................................. 198 m_WorldTZ ............................................ 203 pComTranMgr ........................................ 203 PollPanel ................................................. 103 PollPanelForEvents ................................. 111 pRs232 .................................................... 202

Page 213: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation 213

pTransport ............................................... 202 Read .......................................................... 99 ReadClock ............................................... 107 RegisterApplication .................................. 90 s_PanelPassword ..................................... 207 SendCommand .......................................... 81 SendCommandPacket ............................... 92 SendForLastReportedEvent .................... 104 SendPanelNextCmdFromPipe ................ 109 SendPanelNextDirectCmd ...................... 110 SendPollingCmdReq ................................. 30 SetBaudRate .............................................. 43 SetCardExType ......................................... 45 SetCardRecCfg ......................................... 74 SetCmd ...................................................... 19 SetCmdEvent ............................................ 20 SetCommunicationType ........................... 55 SetCommunicationType2 ....................... 131 SetComPort ............................................... 37 SetComPort2 ............................................. 41 SetDialBackRPCCount ........................... 116 SetDialupTZ .............................................. 66 SetDialupTZ2 ............................................ 68 SetDistributeEvent .................................... 22 SetDownloadInProgressState .................... 75 SetDST ...................................................... 70 SetEventCounter ....................................... 77 SetEventDialBackThreshold ..................... 79 SetEventDialBackThreshold2 ................. 137 SetHostNumber ......................................... 60 SetHostNumber2 ....................................... 62 SetIsDialupDriver ..................................... 72 SetLineError .............................................. 31 SetPanelAddress ....................................... 47 SetPanelID ................................................ 35 SetPanelName ........................................... 57

SetPanelNumber ....................................... 64 SetPanelNumber2 ................................... 135 SetPanelOffline ......................................... 24 SetPanelState............................................. 33 SetPanelType ............................................ 39 SetPollingCmdReq .................................... 29 SetPortTimingCfg ................................... 114 SetPrimaryIP ............................................. 49 SetReply .................................................... 94 SetSecondaryIP ......................................... 53 SetSendingEvents ..................................... 23 SetTapiName............................................. 58 SetTapiName2......................................... 133 SetUseTwoWireRS485 ............................. 51 si_DialbackThreshold2 ........................... 208 si_DialupTZ ............................................ 200 si_DialupTZ2 .......................................... 201 si_HostNumber ....................................... 200 si_HostNumber2 ..................................... 200 si_PanelName ......................................... 200 si_PanelNumber ...................................... 200 si_PanelNumber2 .................................... 208 si_SecondaryTapiName2 ........................ 208 si_TapiName ........................................... 199 sl_DialBackRPCCount ........................... 201 sl_DialBackThreshold............................. 201 StartDatabaseThread ............................... 128 StartReaderDownload ............................. 130 UnsolicitedEventRequest ........................ 106 WaitForAppCommandEvent .................. 117 Write ....................................................... 100 WriteCommand ......................................... 82 WriteEventsToClients ............................. 118 WriteOfflineEvent ..................................... 97 WriteOnlineEvent ..................................... 98 WriteResponse .......................................... 83

Page 214: OpenDevice - Device Translator Template Guide · The Device Translator Template can be used when developing Device Translators. The device translator template was created to make

© 2016 United Technologies Corporation. Lenel is a part of UTC Climate, Controls & Security, a unit of United Technologies Corporation 214