Echelon i.LON SmartServer 2.0 User Manual
Page 171

i.LON SmartServer 2.0 Programming Tools User’s Guide
157
Generator Configuration File for more information on the CompanyName and FeatureName
properties.
5. Declare a License Manager control structure, then set the license file path and the license ID
fields. The file path field corresponds to the path of the FPM license file relative to the
root/config/license folder on the SmartServer flash disk, and the name of the FPM license file.
The default file name of an FPM license is <ShortCompanyName><LonMarkID>
<ShortFeatureName>.xml. For example:
//declare license manager control structure
memset(&taskCallBlock, 0, sizeof(taskCallBlock));
//specify the license file path and license ID
taskCallBlock.pFilePath =
"YourFilePath.xml";
taskCallBlock.pLicenseId = &licenseId;
Using the FPM license file of the HVAC Controller, for example, the file path property would be
“OurCompany0HVAC.xml”. If you chose to place your licenses in a subfolder of the
/root/config/license folder, the path name must contain that subfolder name, too (but not
/root/config/license). For example, “OurCompanyFolder/OurFileName.xml”. See Creating a
License Generator Configuration File for more information on the Short CompanyName,
LonMark ID, and ShortFeatureName properties.
6. Call the method in the i.LON license manger that finds the license and performs a node lock
check. For example:
LICMGR_TaskCall_FindLicense(&taskCallBlock);
The following code demonstrates the lock ID of a SmartServer being checked by the license validation
algorithm:
// FPM License Validation Routine()
void CUFPTHVACController::FPM_CHECK()
{
// Set FPM_CHECKED flag to TRUE so method is called once
FPM_CHECKED = TRUE;
// declare local variables to be passed to and returned
// by License Manager and Security Algorithm
LicMgrTaskCallBlock
taskCallBlock;
LicMgrLicenseId
licenseId;
LicMgrLicenseData
*pLic;
unsigned char secretKey[MD5_DIGEST_LEN];
unsigned char digest[MD5_DIGEST_LEN];
// Check for a valid license.
licenseId.szCompanyName = "Echelon Corporation";
licenseId.szFeatureName = "FPM HVAC Controller";
// Use dedicated license file
memset(&taskCallBlock, 0, sizeof(taskCallBlock));
taskCallBlock.pFilePath =
"Echelon1HVAC.xml";
taskCallBlock.pLicenseId = &licenseId;
// Macro for indirect task call.
LICMGR_TaskCall_FindLicense(&taskCallBlock);