Obtaining Cumulative Trial License Usage Information
Declare Variables/Constants
#define FEATURE_NAME "FeatureTrial"
#define FEATURE_VERSION "1.0"
#define CONTACT_SERVER "localhost"
static const char *pcScopeTrialUsageInfo = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sentinelScope>"
"<feature index=\"0\">"
"<name>"FEATURE_NAME"</name>"
"<version>"FEATURE_VERSION"</version>"
"</feature>"
"</sentinelScope>";
sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_app_context_t *pAppContext = NULL;
char *pcTrialInfo = NULL;
API Calls
To obtain cumulative trial license usage information, execute the APIs in the specified sequential order only:
sntl_licensing_attr_new(&pAttrAppContext);
sntl_licensing_attr_set_appcontext_contact_server (pAttrAppContext, CONTACT_SERVER);
If instead the LSFORCEHOST or LSHOST environment variables are set, then the above-mentioned steps are not required.
sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);
sntl_licensing_get_info(pAppContext, pcScopeTrialUsageInfo, SNTL_QUERY_FEATURE_CUMULATIVE_TRIAL_INFO_VERSION(v), &pcTrialInfo);
If the sntl_licensing_get_info call is successful, the pcTrialInfo parameter contains an XML-based output having the detailed information (an example output is shown here).
Notes
>In the use case described above, a license is being requested from the local system when the License Manager is running on the same system as the client application (set as localhost). You can change the CONTACT_SERVER constant to the IP address or hostname of the system hosting the Sentinel RMS License Manager. For example,
•#define CONTACT_SERVER "50.155.68.24"
>In the case of standalone licensing, set the contact server as no-net:
•#define CONTACT_SERVER "no-net"