llkGetLicenseInfo
Description
Provides information about the current activated license
Important
The function allocates memory. To release it, use the llkFree function
Syntax
llkGetLicenseInfo
LLKStatus LLK_API llkGetLicenseInfo(char** licenseInfoJson);
Parameters
Param | Description |
---|---|
licenseInfoJson | Pointer to the information retrieved about the activated license, in JSON format |
Return Values
Status Code | No. | Description |
---|---|---|
LLK_OK | 0 | Request was successfully completed. The operation status is successful |
LLK_INVALID_PARAMETER | 1 | The parameter licenseInfoJson is invalid (null pointers are forbidden) |
LLK_LICENSE_NOT_ACTIVATED_YET | 12 | The entitlement has not been activated yet. For activation/initialization, use llkActivateLicense |
LLK_INTERNAL_TRY_AGAIN | 701 | Internal error. In the case of this function, an error means that the operating system can't allocate memory |
Examples
C++ example
char *rawLicenseInfo = nullptr;
const LLKStatus status = llkGetLicenseInfo(&rawLicenseInfo);
if (llkGetLicenstatusseInfoStatus == LLKStatus::LLK_OK) {
std::cout << json::parse(rawLicenseInfo).dump(1) << std::endl;
}
/*null pointers are ok for llkFree*/
llkFree(rawLicenseInfo);
Example of a successful operation
{
"ActivationTimestamp": 1700034857,
"ConnectedProducts": [
{
"Name": "Prod_0_v.1.0"
}
],
"Features": [
{
"ID": 1,
"Name": "Test_1",
"executionsLimit": 0,
"licenseType": 2,
"validFromDate": 1700034857,
"validUpToDate": 1701993600
},
{
"ID": 2,
"Name": "Test_2",
"executionsLimit": 0,
"licenseType": 2,
"validFromDate": 1700034857,
"validUpToDate": 1701993600
},
{
"ID": 0,
"Name": "Test_0",
"executionsLimit": 0,
"licenseType": 2,
"validFromDate": 1700034857,
"validUpToDate": 1701993600
}
],
"SerialNumber": "989e79-140a9f1aw880-323b973g960d"
}
In this example, used the library nlohmann json, to format and print the captured data
Description of rawLicenseInfo
Поле | Description |
---|---|
ActivationTimestamp | Activation timestamp |
ConnectedProducts | List of all Products added to the entitlement |
Features | List of the Features related to the products |
SerialNumber | Current activated entitlement serial number |
Note
In order to successfully use all other API functions, the entitlement must be activated or initialized. For activation/initialization, use llkActivateLicense
Version history
- Added in version
1.0.0