TSG-15458 基于Sentinel LDK的C API检查软锁/硬锁的授权是否有效

This commit is contained in:
luwenpeng
2023-06-12 10:49:35 +08:00
parent b836a3bf91
commit 61233aac97
10 changed files with 325 additions and 29 deletions

View File

@@ -0,0 +1,6 @@
add_definitions(-DENABLD_LOG_FIEL)
add_executable(hasp_verify ${CMAKE_SOURCE_DIR}/platform/src/hasp_verify.c ${CMAKE_SOURCE_DIR}/platform/test/hasp_verify_test.c)
target_include_directories(hasp_verify PUBLIC ${CMAKE_SOURCE_DIR}/platform/include/)
target_link_libraries(hasp_verify pthread)
target_link_libraries(hasp_verify ${CMAKE_SOURCE_DIR}/lib/libhasp_linux_x86_64_25743.a)
install(TARGETS hasp_verify RUNTIME DESTINATION bin COMPONENT Program)

View File

@@ -0,0 +1,30 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "hasp_verify.h"
int main(int argc, char **argv)
{
uint64_t interval_s = 0;
uint64_t feature_id = 0;
if (argc != 3)
{
fprintf(stdout, "Usage: %s [feature_id] [interval_s]\n", argv[0]);
exit(0);
}
else
{
feature_id = atol(argv[1]);
interval_s = atol(argv[2]);
}
hasp_verify(feature_id, interval_s);
while (1)
{
sleep(1);
}
return 0;
}