#include <Licensing.h>
|
struct BaseLib::Licensing::Licensing::LicenseData | __attribute__ ((aligned(64))) |
|
uint64_t | getMapKey (int32_t familyId, int32_t deviceId) |
|
virtual void | addDevice (int32_t familyId, int32_t deviceId, bool state, std::string licenseKey) |
|
virtual void | removeDevice (int32_t familyId, int32_t deviceId) |
|
virtual void | updateDevice (int32_t familyId, int32_t deviceId, bool state, std::string licenseKey) |
|
virtual void | loadVariables () |
|
virtual void | saveVariable (uint64_t index, int32_t intValue) |
|
virtual void | saveVariable (uint64_t index, int64_t intValue) |
|
virtual void | saveVariable (uint64_t index, std::string &stringValue) |
|
virtual void | saveVariable (uint64_t index, std::vector< uint8_t > &binaryValue) |
|
virtual void | saveVariable (uint64_t index, LicenseData &licenseData) |
|
§ DeviceStates
§ PDeviceInfo
§ Licensing()
§ ~Licensing()
BaseLib::Licensing::Licensing::~Licensing |
( |
| ) |
|
|
virtual |
§ __attribute__() [1/2]
§ __attribute__() [2/2]
§ addDevice()
void BaseLib::Licensing::Licensing::addDevice |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId, |
|
|
bool |
state, |
|
|
std::string |
licenseKey |
|
) |
| |
|
protectedvirtual |
§ checkLicense()
virtual int32_t BaseLib::Licensing::Licensing::checkLicense |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId, |
|
|
const std::string & |
licenseKey = "" |
|
) |
| |
|
pure virtual |
Checks if a license key is valid.
- Parameters
-
familyId | The family id the license key is for. |
deviceId | The device id the license key is for or -1 if not applicable. |
licenseKey | The license key to check. If empty the mothod reads the license key for this device from the database. |
- Returns
- Returns -1 on application errors, -2 if the licensing module could not be found, -3 on communication errors, -4 if the activation server returned invalid data, -5 if the license key is invalid, -6 if the license key is valid but blocked, -7 if the activation key validation failed, -8 if no license key was passed and no license key was found in the database, -9 if no license key was passed and the activation key verification failed, -10 if the trial period has expired, 0 if the license key is valid and already known, 1 if the license key is valid and on new activation, 2 on successful trial activation and 3 with valid trial key which is already known.
§ decryptDeviceDescription()
virtual void BaseLib::Licensing::Licensing::decryptDeviceDescription |
( |
const std::vector< char > & |
input, |
|
|
std::vector< char > & |
output |
|
) |
| |
|
pure virtual |
§ decryptScript()
virtual void BaseLib::Licensing::Licensing::decryptScript |
( |
const std::vector< char > & |
input, |
|
|
std::string & |
output |
|
) |
| |
|
pure virtual |
§ dispose()
void BaseLib::Licensing::Licensing::dispose |
( |
| ) |
|
|
virtual |
§ getDeviceState()
bool BaseLib::Licensing::Licensing::getDeviceState |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId |
|
) |
| |
|
virtual |
Returns the activation status of a device or family.
- Parameters
-
familyId | The family id. |
deviceId | The device id or -1. |
- Returns
- Returns true when the device or family is activated otherwise false. When the device is unknown, false is returned.
§ getDeviceStates()
Returns a map with all unlicensed devices.
- Returns
- Returns a map with all unlicensed devices. The first pair element is the family id the second the device id. When the device id is "-1" the whole device family is not activated.
§ getLicenseKey()
std::string BaseLib::Licensing::Licensing::getLicenseKey |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId |
|
) |
| |
|
virtual |
Returns the license key stored in the database.
- Parameters
-
familyId | The family id the license key is for. |
deviceId | The device id the license key is for or -1 if not applicable. |
- Returns
- Returns the license key or an empty string if no license key was found.
§ getMapKey()
uint64_t BaseLib::Licensing::Licensing::getMapKey |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId |
|
) |
| |
|
protected |
§ getModuleId()
virtual int32_t BaseLib::Licensing::Licensing::getModuleId |
( |
| ) |
|
|
inlinevirtual |
§ getTrialStartTime()
int64_t BaseLib::Licensing::Licensing::getTrialStartTime |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId |
|
) |
| |
|
virtual |
Returns the start time of a trial version.
The default method reads the start time from the license key, if it is the format: "trial<unix timestamp in milliseconds>", e. g. "trial1487608697439".
- Parameters
-
familyId | The family id the license key is for. |
deviceId | The device id the license key is for or -1 if not applicable. |
- Returns
- Returns the start time of a trial version as unix timestamp in milliseconds or -1 if not applicable.
§ init()
virtual bool BaseLib::Licensing::Licensing::init |
( |
| ) |
|
|
pure virtual |
§ load()
void BaseLib::Licensing::Licensing::load |
( |
| ) |
|
|
virtual |
§ loadVariables()
void BaseLib::Licensing::Licensing::loadVariables |
( |
| ) |
|
|
protectedvirtual |
§ removeDevice()
void BaseLib::Licensing::Licensing::removeDevice |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId |
|
) |
| |
|
protectedvirtual |
§ removeLicense()
void BaseLib::Licensing::Licensing::removeLicense |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId |
|
) |
| |
|
virtual |
Removes a license.
- Parameters
-
familyId | The family id the license key is for. |
deviceId | The device id the license key is for or -1 if not applicable. |
§ saveVariable() [1/5]
void BaseLib::Licensing::Licensing::saveVariable |
( |
uint64_t |
index, |
|
|
int32_t |
intValue |
|
) |
| |
|
protectedvirtual |
§ saveVariable() [2/5]
void BaseLib::Licensing::Licensing::saveVariable |
( |
uint64_t |
index, |
|
|
int64_t |
intValue |
|
) |
| |
|
protectedvirtual |
§ saveVariable() [3/5]
void BaseLib::Licensing::Licensing::saveVariable |
( |
uint64_t |
index, |
|
|
std::string & |
stringValue |
|
) |
| |
|
protectedvirtual |
§ saveVariable() [4/5]
void BaseLib::Licensing::Licensing::saveVariable |
( |
uint64_t |
index, |
|
|
std::vector< uint8_t > & |
binaryValue |
|
) |
| |
|
protectedvirtual |
§ saveVariable() [5/5]
void BaseLib::Licensing::Licensing::saveVariable |
( |
uint64_t |
index, |
|
|
LicenseData & |
licenseData |
|
) |
| |
|
protectedvirtual |
§ updateDevice()
void BaseLib::Licensing::Licensing::updateDevice |
( |
int32_t |
familyId, |
|
|
int32_t |
deviceId, |
|
|
bool |
state, |
|
|
std::string |
licenseKey |
|
) |
| |
|
protectedvirtual |
§ _bl
§ _devices
§ _devicesMutex
std::mutex BaseLib::Licensing::Licensing::_devicesMutex |
|
protected |
§ _disposed
bool BaseLib::Licensing::Licensing::_disposed = false |
|
protected |
§ _licenseData
std::map<uint64_t, LicenseData> BaseLib::Licensing::Licensing::_licenseData |
|
protected |
§ _moduleId
int32_t BaseLib::Licensing::Licensing::_moduleId = -1 |
|
protected |
§ _variableDatabaseIds
std::map<uint64_t, uint32_t> BaseLib::Licensing::Licensing::_variableDatabaseIds |
|
protected |
The documentation for this class was generated from the following files: