tsc_LicenseInformation

Use this class to retrieve licensing information and status.  In particular this class may be used to query any additional data that may be customized for the end-user's license, or to control restrictions that apply to a demonstration license.  

Each product license applies to a single Trimble Access application running on a given mobile device or PC identified by its unique serial number.  A tsc_LicenseInformation instance contains nothing that may be used to identify the end user.

Public Constructor

tsc_LicenseInformation (const char* forWhichGuid);
Retrieves the license information for the specified GUID.  This would normally be the currently active plugin's application GUID, such as that returned by tsc_Application::GetProductGuid().

Note that the information retrieved is pertinent to the current hardware device only.  If the supplied GUID is not licensed for the current device, most methods will return empty or default values; in particular IsCurrentlyValid() will return false and the license type will be None.

Public methods

bool IsCurrentlyValid (bool allowDemo = true);
Tests the license to see that it is valid at the present point in time. This is not necessarily the same as when the program was started.  The allowDemo parameter defaults to true and considers the Demo license type to be valid.

tsc_String Name();
The name of the license, which is generally the name of the application and a version number.

tsc_String Guid();
The GUID which uniquely identifies this product.  This will be the same as the GUID passed in to the constructor, possibly with case differences.

tsc_LicenseType Type();
x_Code          TypeAsXCode();
tsc_String      TypeAsString();
Returns the type of the license, as an enumeration, an x-code, or a string.  The string value is translated into the currently configured language.

double Activation() const;
Returns the date/time when this license became (or will become) valid, in seconds UTC to match the Survey Core format.

double Expiration() const;
Returns the date/time when this license expires, in seconds UTC to match the Survey Core format.

tsc_String CustomData();
The custom data string from the license.  This is generally empty, but may be configured by Trimble to convey additional information about the license.

double Expiration(const char* productTag) const;
Returns the warranty expiration date of the specified product, in seconds UTC to match the Survey Core format.
A <productTag> element must exist inside the <warrantyexpiration> element in the license file. If such an element is not found, the function returns double_Null.
Because the <warrantyexpiration> element is at the top level in the license file, the function operates independently of the current app and will work regardless of the GUID supplied in the constructor.

Enumeration

enum tsc_LicenseType
{
    tscli_Full = 0, A perpetual license.
    tscli_Timed,    A license that expires after a given period.
    tscli_Demo,     A demonstration license. The meaning of this is determined by the licensed software.
    tscli_None      There is no license.
};