SqueezeBrains SDK 1.18
|
License management. More...
Data Structures | |
struct | sb_t_license_configuration |
Defines the configurations of the license. More... | |
struct | sb_t_license_module |
Defines all the attributes and properties of a license module. More... | |
struct | sb_t_license |
Defines the license and its properties. More... | |
Macros | |
#define | SB_LICENSE_VENDOR_CODE_SIZE 32 |
Size, in bytes, of the string of the vendor code. | |
Enumerations | |
enum | sb_t_license_module_status { SB_LICENSE_MODULE_STATUS_NULL = 0 , SB_LICENSE_MODULE_STATUS_ACTIVE , SB_LICENSE_MODULE_STATUS_DISABLED , SB_LICENSE_MODULE_STATUS_ERR } |
Enumerations of status of a module of the license. More... | |
enum | sb_t_license_type { SB_LICENSE_NULL = 0 , SB_LICENSE_DISABLED , SB_LICENSE_DEMO , SB_LICENSE_MASTER , SB_LICENSE_NOT_PRESENT } |
Enumerations of the license types. More... | |
enum | sb_t_license_configuration_id { SB_LICENSE_PREMIUM = 0 , SB_LICENSE_STANDARD , SB_LICENSE_BASIC , SB_LICENSE_CONFIGURATION_NUMBER } |
Enumerations of the license configurations. More... | |
enum | sb_t_license_module_id { SB_LICENSE_MODULE_NONE = -1 , SB_LICENSE_MODULE_RETINA , SB_LICENSE_MODULE_SURFACE , SB_LICENSE_MODULE_DEEP_CORTEX , SB_LICENSE_MODULE_DEEP_SURFACE , SB_LICENSE_MODULE_DEEP_RETINA , SB_LICENSE_MODULE_NUMBER } |
Enumerations of modules of the SB library. More... | |
Functions | |
sb_t_err | sb_license_get_hw_info (char **const str) |
Returns the hardware information. More... | |
sb_t_err | sb_license_check (SB_HANDLE module, char **const msg) |
Checks the license status and if the project can be used with the current license configuration. More... | |
sb_t_err | sb_license_configuration_check (SB_HANDLE module, sb_t_license_configuration_id configuration_id, char **const msg) |
Checks if the project can be used with a license configuration. More... | |
sb_t_err | sb_license_get_info (sb_t_license *const info) |
Returns the license information. More... | |
sb_t_err | sb_license_format_info (const sb_t_license *const info, char *const str, int str_size) |
Formats the license structure. More... | |
const char * | sb_license_format_module_id (sb_t_license_module_id code) |
Returns the string of the module id. More... | |
const char * | sb_license_format_module_status (sb_t_license_module_status status) |
Returns the string of the feature status. More... | |
const char * | sb_license_format_type (sb_t_license_type type) |
Returns the string of the license type. More... | |
const char * | sb_license_format_configuration (sb_t_license_configuration_id configuration) |
Returns the string of the license configuration. More... | |
sb_t_err | sb_license_apply_v2c (const char *const v2c, char **const msg_err, int verbosity) |
Applies the v2c file to the usb dongle key. More... | |
License management.
See License for more information.
Enumerations of the license configurations.
The values are 32 bits both for 32 and 64 bits library version.
Enumerations of modules of the SB library.
The values are 32 bits both for 32 and 64 bits library version.
Enumerations of status of a module of the license.
The values are 32 bits both for 32 and 64 bits library version.
Enumerator | |
---|---|
SB_LICENSE_MODULE_STATUS_NULL | The license status is undefined. |
SB_LICENSE_MODULE_STATUS_ACTIVE | The license is valid and active. |
SB_LICENSE_MODULE_STATUS_DISABLED | The license is disabled. |
SB_LICENSE_MODULE_STATUS_ERR | There is an error. See the field sb_t_license_module::err. |
enum sb_t_license_type |
Enumerations of the license types.
The values are 32 bits both for 32 and 64 bits library version.
sb_t_err sb_license_apply_v2c | ( | const char *const | v2c, |
char **const | msg_err, | ||
int | verbosity | ||
) |
Applies the v2c file to the usb dongle key.
The function burns the usb dongle key with the Vendor to Customer (v2c) license file. You cannot apply the file twice or apply a previous license.
[in] | v2c | File name of the Vendor to Customer license. |
[out] | msg_err | In case there is an error the variable is filled with the pointer to a message error. The string must be freed with sb_free . It can be NULL. |
[in] | verbosity | Verbosity of the message. Set to 0 to disable all the messages. |
Checks the license status and if the project can be used with the current license configuration.
There are the following cases:
[in] | module | Handle of the module to be checked. |
[out] | msg | pointer to the string filled with a message. |
sb_t_err sb_license_configuration_check | ( | SB_HANDLE | module, |
sb_t_license_configuration_id | configuration_id, | ||
char **const | msg | ||
) |
Checks if the project can be used with a license configuration.
There are the following cases:
If you want to check only the error condition, and you are not interested in the reason for the error, you can call the function with msg equal to NULL.
[in] | module | Handle of the module to be checked. |
[in] | configuration_id | License configuration identifier. |
[out] | msg | Pointer to the string filled with a message describing the reasons for the error or warning. It can be NULL, in this case you cannot check for warning conditions, that is you can call sb_svl_run or sb_project_detection but with some limitations. |
const char * sb_license_format_configuration | ( | sb_t_license_configuration_id | configuration | ) |
Returns the string of the license configuration.
Interprets the contents of the type and converts it to a C-string containing a human-readable version of the corresponding configuration.
The string must not be freed.
[in] | configuration | License configuration. |
sb_t_err sb_license_format_info | ( | const sb_t_license *const | info, |
char *const | str, | ||
int | str_size | ||
) |
Formats the license structure.
Interprets the contents of info and converts it to a C-string containing a human-readable version of the corresponding structure.
[in] | info | Pointer to the structure of the license information. |
[out] | str | String filled by the function. |
[in] | str_size | Size, in bytes, of str |
const char * sb_license_format_module_id | ( | sb_t_license_module_id | code | ) |
Returns the string of the module id.
Interprets the contents of the code and converts it to a C-string containing a human-readable version of the corresponding id.
[in] | code | Module id. |
const char * sb_license_format_module_status | ( | sb_t_license_module_status | status | ) |
Returns the string of the feature status.
Interprets the contents of the status and converts it to a C-string containing a human-readable version of the corresponding status.
The string must not be freed.
[in] | status | Feature status. |
const char * sb_license_format_type | ( | sb_t_license_type | type | ) |
Returns the string of the license type.
Interprets the contents of the type and converts it to a C-string containing a human-readable version of the corresponding type.
The string must not be freed.
[in] | type | License type. |
sb_t_err sb_license_get_hw_info | ( | char **const | str | ) |
Returns the hardware information.
The string has to be sent to the vendor in order to obtain a Software Master license.
[out] | str | The function allocates the string and fills it with the hardware information. The string str MUST be deallocated with sb_free . |
sb_t_err sb_license_get_info | ( | sb_t_license *const | info | ) |
Returns the license information.
The table below lists some possible situations that can occur with the value of the status, type and err parameters of the sb_t_license_module structure. In the wait column it is reported in which cases you can wait for the license to activate. The case that will always occur immediately after calling the sb_init function is the first, ie when the license manager has not yet initialized.
status | type | err | Wait | Description |
---|---|---|---|---|
SB_LICENSE_MODULE_STATUS_NULL | SB_LICENSE_NULL | SB_ERR_NONE | yes | The license manager has not yet started. |
SB_LICENSE_MODULE_STATUS_ERR | SB_LICENSE_NULL | SB_ERR_LICENSE_NOT_FOUND | yes | USB dongle key license not found. It happen if you call sb_init with SB_INIT_ONLY_HW_LICENSE_KEY and the us dongle key is not present. |
SB_LICENSE_MODULE_STATUS_ERR | SB_LICENSE_NULL | SB_ERR_LICENSE_WAIT_SERVER | yes | License server is not reachable. It happens if you have a DEMO license and the license server is not reachable. |
SB_LICENSE_MODULE_STATUS_ERR | SB_LICENSE_DEMO | SB_ERR_LICENSE_WAIT_SERVER | yes | License server is not reachable. It happens if you have a Master license and a DEMO license and the license server is not reachable. |
SB_LICENSE_MODULE_STATUS_ACTIVE | SB_LICENSE_DEMO | SB_ERR_NONE | no | License active. |
SB_LICENSE_MODULE_STATUS_ACTIVE | SB_LICENSE_MASTER | SB_ERR_NONE | no | License active. |
SB_LICENSE_MODULE_STATUS_DISABLED | SB_LICENSE_DISABLED | SB_ERR_LICENSE_DISABLED | no | License disabled. |
SB_LICENSE_MODULE_STATUS_ERR | SB_LICENSE_NOT_PRESENT | SB_ERR_LICENSE_WAIT_SERVER | no | License not present. It happens with the Surface module if you are using a master license issued with versions prior to 1.5.0, ie only with the Retina module, and the license server cannot be reached. |
SB_LICENSE_MODULE_STATUS_ERR | SB_LICENSE_DEMO | SB_ERR_LICENSE_EXPIRED | no | License expired. |
SB_LICENSE_MODULE_STATUS_ERR | SB_LICENSE_NULL | SB_ERR_LICENSE_FILE | no | Non-existent license file, unreadable or incorrect format and the license server is not reachable |
info | Pointer to the structure which will be filled with license information. |