From f3f6ca1fc8b3d991eb5fc45e0a66961640704b04 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Tue, 24 Oct 2023 14:01:53 +0800 Subject: [PATCH] =?UTF-8?q?hasp=5Flogin=E5=A2=9E=E5=8A=A0die=5Fat=5Fexpira?= =?UTF-8?q?tion=3D1=E5=8F=82=E6=95=B0=EF=BC=9B=E6=8E=88=E6=9D=83=E6=8E=A2?= =?UTF-8?q?=E6=B5=8B=E9=97=B4=E9=9A=94=E4=BB=8E30=E5=88=86=E9=92=9F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BA15=E5=88=86=E9=92=9F=EF=BC=9Bhasp=5F?= =?UTF-8?q?monitor=E9=9A=90=E8=97=8F-i=E5=91=BD=E4=BB=A4=E8=A1=8C=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/hasp_verify.c | 13 +++++++++++-- platform/tool/hasp_monitor.c | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/src/hasp_verify.c b/platform/src/hasp_verify.c index d38abf6..623d09c 100644 --- a/platform/src/hasp_verify.c +++ b/platform/src/hasp_verify.c @@ -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; } + /* + * + * 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 = "\n" + " \n" + "\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); diff --git a/platform/tool/hasp_monitor.c b/platform/tool/hasp_monitor.c index 8940007..6aa899a 100644 --- a/platform/tool/hasp_monitor.c +++ b/platform/tool/hasp_monitor.c @@ -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"); }