Tracking license events, License event types – Echelon LNS User Manual

Page 307

Advertising
background image

LNS Programmer's Guide

293

credits are in use, and therefore there is no time limit. The special value

of 254 indicates that the application is operating in Demonstration Mode,
or that the application is a legacy (LNS 1.x) application, and there is no

time limit.

• DeficitCredits: The number of deficit credits currently being used.
• LicensedCredits: The number of LNS Device Credits licensed on the

LNS Object Server. This number does not include the number of deficit

credits allowed.

• LicenseType: The type of license in effect. A value of 0 indicates

Demonstration Mode is being used, or that you are running a legacy

(version 1.x) LNS application. A value of 1 indicates that Standard Mode
is being used.

• MaxDeficitCredits: The maximum number of deficit credits allowed

on the LNS Object Server. If this number is exceeded, the LNS Server
license will expire, and the LNS Server will cease to operate until

sufficient LNS Device Credits are added.

• UsedCredits: The number of LNS Device Credits currently in use. This

number does not include the number of deficit credits currently being

used.

Tracking License Events

LNS applications should notify users about certain licensing situations, such as when

they are using deficit credits and when the LNS Server's license has expired. That way,
users can take action before the expired license renders the LNS Server inoperable. For

these and other application-specific reasons, an LNS application may need to track
licensing events. To do so, LNS provides the OnLicenseEvent event.

To register for this event, invoke the BeginLicenseEvent() method, as follows:
MySystem.BeginLicenseEvent()
To cancel the receipt of licensing events, invoke the EndLicenseEvent() method, as

follows:
MySystem.EndLicenseEvent()

License Event Types

The OnLicenseEvent event returns five parameters. Two of these, the network handle

and system handle, identify the network and system on which the licensing event
occurred. The event also returns an updated CreditInfo object, as well as two integer

values indicating the event type and the number of LNS Device Credits debited or

credited by that event. The event types and the meaning of the corresponding count
values are the following:

• LIC_DEBIT: A debit has been charged to the available number of licensed

LNS Device Credits due to a device installation. The number of LNS
Device Credits charged is returned as a positive integer in the count

parameter. You can check how many LNS Device Credits are currently in
use by reading the UsedCredits property of the CreditInfo object

returned by the event.

Advertising