Licensing and network recovery – Echelon LNS User Manual

Page 308

Advertising
background image

LNS Programmer's Guide

294

• LIC_DEFICIT: A credit or debit has been charged, and the number of

licensed LNS Device Credits has been exhausted. As described in the

Standard Mode section on page 291, the LNS Object Server will continue

to run for a 14-day grace period during which the deficits credits can be
used. Read the DaysRemaning and DeficitCredits properties of the
CreditInfo object returned by the event to determine how many deficit

credits are available, and how much longer the LNS Server license is
valid for. The count parameter contains the number of LNS Device

Credits being debited (if positive), or returned (if negative). LNS
applications are required to periodically raise a dialog warning the user

that the license will shortly expire, once this event is received.

• LIC_EXPIRED: The LNS Server's license has expired. This occurs when

the maximum number of deficit credits has been used, or when the 14-

day grace period initiated when the first deficit credit is used has expired.

The application is required to terminate at this point. If the expiration
was caused by a debit transaction, the count parameter returns the

number of devices successfully debited.

• LIC_CREDIT: A credit has been applied to the available number of LNS

Device Credits due to the removal of a device. This is reflected as a

decrease in the number of used LNS Device Credits. The number of LNS
Device Credits added is returned as a negative integer in the count

parameter.

Licensing and Network Recovery

The network recovery feature described in Chapter 10 can be used on any L

ON

W

ORKS

network, whether it was installed by an LNS application or by some other kind of

network tool. If the network was installed by an LNS application, the network recovery

process should not deduct any LNS Device Credits, because this would result in an
overcharge (i.e. a device would be charged once during the original installation and once

during the network recovery). On the other hand, recovery performed on a non-LNS

network should charge for each device on the recovered network. Unfortunately, there is
no way for the LNS Object Server to determine whether or not the network being

recovered was installed by an LNS application.

The LNS Licensing Agreement charges the LNS application with the responsibility of

indicating whether or not a network was installed by an LNS application. To simplify
this process, the System object contains the RestoreLicense() method. You can call

this method after network recovery to restore the license.

The method takes an input parameter (wasLNS) that indicates whether or not the

recovered network was installed by an LNS application. A value of True indicates that
the recovered network was installed by an LNS application, and a value of False

indicates that it was not. For example, the following code indicates that the network was

installed by an LNS application, and so restores the license without deducting LNS
Device Credits during the recovery:
MySystem.RestoreLicense(True)
The System object provides the CommissionedDeviceCount,
UncommissionedDeviceCount, and UninstalledDeviceCount properties. These

properties indicate the number of devices that were recovered (commissioned) or

discovered in an unconfigured state (uninstalled) during the recovery process. When the

Advertising