// // Created by Administrator on 2021-12-29. // #include #include #include #include #include "../src/atlas_licence.h" int main() { for (int i = 0; i <10 ; ++i) { const char *token_password = "shiyu2018"; std::string guid = std::string("ae454e83af41ac8eff3e9f6f")+std::to_string(i); void *skt_handle = NULL; atlas_licence_param param; memset(¶m, 0, sizeof(atlas_licence_param)); sprintf(param.product_id, "%s", "68B0B0EBB33C4359BE226543F2DBB653"); sprintf(param.guid, "%s",guid.c_str()); sprintf(param.token_pwd, "%s", token_password); param.channel_num = 2; atlas_licence_token param_token; memset(¶m_token, 0, sizeof(atlas_licence_token)); int result = atlas_licence_connect(&skt_handle, param, ¶m_token); printf("result:%d,code:%d,msg:%s \n", result, param_token.code, param_token.msg); printf("token:%s\n", param_token.token); std::string recv_token = std::string(param_token.token); atlas_licence_check_result check_result; memset(&check_result, 0, sizeof(atlas_licence_check_result)); atlas_licence_check_param check_param; memset(&check_param, 0, sizeof(atlas_licence_check_param)); sprintf(check_param.token_pwd, "%s", token_password); sprintf(check_param.time, "%s", "2022-01-10 20:00:00"); sprintf(check_param.token, "%s", recv_token.c_str()); check_param.consume = 2; atlas_licence_check(skt_handle, check_param, &check_result); std::cout << "code:" << check_result.code << ",msg:" << check_result.msg << std::endl; atlas_licence_close(&skt_handle); usleep(1000*1000); } return 0; }