TSG-15458 基于Sentinel LDK的C API检查软锁/硬锁的授权是否有效
This commit is contained in:
6
platform/test/CMakeLists.txt
Normal file
6
platform/test/CMakeLists.txt
Normal 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)
|
||||
30
platform/test/hasp_verify_test.c
Normal file
30
platform/test/hasp_verify_test.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user