hasp_login增加die_at_expiration=1参数;授权探测间隔从30分钟调整为15分钟;hasp_monitor隐藏-i命令行参数

This commit is contained in:
luwenpeng
2023-10-24 14:01:53 +08:00
parent 1c1186e36a
commit f3f6ca1fc8
2 changed files with 11 additions and 3 deletions

View File

@@ -12,7 +12,7 @@
#include "hasp_vcode.h"
#include "hasp_log.h"
#define DEFAULT_INTERVAL_S (30 * 60)
#define DEFAULT_INTERVAL_S (15 * 60)
#define MAX_INTERVAL_S (24 * 60 * 60)
#ifndef MIN
@@ -541,10 +541,19 @@ static void *hasp_monitor_cycle(void *arg)
return NULL;
}
/*
* <feature> <die_at_expiration>
* Whether the current session should be terminated if the expiration date of the current Feature has passed. Possible values are:
* 0 - Allow the session to continue (default).
* 1 - Terminate the session.
*/
const char *scope = "<haspscope>\n"
" <feature die_at_expiration=\"1\" />\n"
"</haspscope>\n";
while (1)
{
hasp_handle_t handle;
hasp_status_t status = hasp_login(hasp_monitor_feature_id, (hasp_vendor_code_t)vendor_code, &handle);
hasp_status_t status = hasp_login_scope(hasp_monitor_feature_id, scope, (hasp_vendor_code_t)vendor_code, &handle);
if (status != HASP_STATUS_OK)
{
log_hasp_status(status);

View File

@@ -8,7 +8,6 @@ static void usage(char *cmd)
{
fprintf(stderr, "USAGE: %s [OPTIONS]\n", cmd);
fprintf(stderr, " -f -- set feature id\n");
fprintf(stderr, " -i -- set interval second\n");
fprintf(stderr, " -h -- show help\n");
}