当前位置: 首页>>代码示例>>C++>>正文


C++ print_success函数代码示例

本文整理汇总了C++中print_success函数的典型用法代码示例。如果您正苦于以下问题:C++ print_success函数的具体用法?C++ print_success怎么用?C++ print_success使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print_success函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: reconf_fun

// Thread for receving reconf
void* reconf_fun(void* arg)
{
    int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
    struct sockaddr_un addr;
    addr.sun_family = AF_UNIX;
    strcpy(addr.sun_path, "reconf_socket");
    unlink("reconf_socket");
    if(bind(sockfd, (struct sockaddr*)&addr, sizeof(addr)) < 0)
    {
        print_error("Failed to create unix socket, %s %d\n", strerror(errno), errno);
    }
    print_success("Created socket");

    int sock;
    if (listen(sockfd, 5) < 0)
        print_error("Failed to listen on unix socket\n");
    if ((sock = accept(sockfd, NULL, NULL)) < 0)
        print_error("Failed to accept unix socket\n");
    else
        print_success("Unix socket accepted");

    char buf[1] = {' '};
    while(1)
    {
        if(read(sock, buf, sizeof(buf)) > 0)
        {
            if(buf[0] == 'r' && mode == RING)
            {
                //print_info("I got reconf!!\n");
                mode = RECONF;
                send_reconf_msg();
                while(1)
                {
                    //print_info("Waiting for reconf to come back\n");
                    unsigned char buf[MAX_DATA];
                    unsigned last_addr_len = sizeof(last_addr);
                    int len = recvfrom(sock_last, buf, MAX_DATA, 0, (struct sockaddr*)&last_addr, &last_addr_len);
                    if(len < 1)
                        continue;
                    union msg received_msg;
                    int msg_type = unpack_msg(buf, &received_msg);
                    //print_info("Got message %d\n", msg_type);
                    if(msg_type == RECONF_MSG)
                        break;
                }
                print_success("Now you can reconfigure network!");
            }
            else if(buf[0] == 'i' && mode == RECONF)
            {
                send_init_msg();
                mode = RING;
            }
        }
        else
            sleep(1);
    }
    return NULL;
}
开发者ID:Antyradek,项目名称:orbisensoriis,代码行数:59,代码来源:main.c

示例2: registerkey

TSS_RESULT
registerkey(int i)
{
	TSS_RESULT result;
	char *function = "Tspi_Context_RegisterKey";

	printf("%s: key %d\n", __FUNCTION__, i);
	result = Tspi_Context_RegisterKey( hContext, hKey[i].handle,
						TSS_PS_TYPE_SYSTEM,
						hKey[i].uuid,
						TSS_PS_TYPE_SYSTEM,
						SRK_UUID );
	if (result != TSS_SUCCESS)
	{
		if( !(checkNonAPI(result)) )
		{
			print_error( function, result );
			return result;
		}
		else
		{
			print_error_nonapi( function, result );
			return result;
		}
	}
	else
	{
		hKey[i].registered = 1;
		print_success( function, result );
		return 0;
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:32,代码来源:Tspi_Context_RegisterKey05.c

示例3: main_v1_1

main_v1_1(void){
	char		*nameOfFunction = "Tspi_GetAttribData07";
	TSS_HKEY	hKey;
	TSS_HCONTEXT	hContext;
	TSS_RESULT	result;
	BYTE*		BLOB;
	UINT32		BlobLength;

	print_begin_test(nameOfFunction);

		//Call GetAttribData
	result = Tspi_GetAttribData(hKey,
			TSS_TSPATTRIB_KEY_BLOB,
			TSS_TSPATTRIB_KEYBLOB_BLOB,
			&BlobLength, &BLOB);
	if (TSS_ERROR_CODE(result) != TSS_E_INVALID_HANDLE) {
		if(!checkNonAPI(result)){
			print_error(nameOfFunction, result);
			print_end_test(nameOfFunction);
			exit(result);
		}
		else{
			print_error_nonapi(nameOfFunction, result);
			print_end_test(nameOfFunction);
			exit(result);
		}
	}
	else{
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:33,代码来源:Tspi_GetAttribData07.c

示例4: main_v1_2

int
main_v1_2(char version)
{
	char			*function = "Tspi_TPM_PcrRead-trans03";
	BYTE			*rgbPcrValue;
	UINT32			ulPcrValueLength;
	TSS_HCONTEXT		hContext;
	TSS_HTPM		hTPM;
	TSS_RESULT		result;
	TSS_HKEY		hSRK, hWrappingKey;

	print_begin_test( function );

	result = connect_load_all(&hContext, &hSRK, &hTPM);
	if ( result != TSS_SUCCESS )
	{
		print_error( "connect_load_all", result );
		Tspi_Context_FreeMemory( hContext, NULL );
		Tspi_Context_Close( hContext );
		exit( result );
	}

	result = Testsuite_Transport_Init(hContext, hSRK, hTPM, FALSE, TRUE, &hWrappingKey,
					  NULL);
	if (result != TSS_SUCCESS) {
		print_error("Testsuite_Transport_Init", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}

	result = Tspi_TPM_PcrRead( hTPM, 8, &ulPcrValueLength, &rgbPcrValue );
	if (result != TSS_SUCCESS) {
		print_error("Tspi_TPM_PcrRead", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}

	result = Testsuite_Transport_Final(hContext, 0);
	if ( result != TSS_SUCCESS )
	{
		if( !(checkNonAPI(result)) )
		{
			print_error( function, result );
		}
		else
		{
			print_error_nonapi( function, result );
		}
	}
	else
	{
		print_success( function, result );
	}

	print_end_test( function );
	Tspi_Context_FreeMemory( hContext, NULL );
	Tspi_Context_Close( hContext );
	exit( result );
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:59,代码来源:Tspi_TPM_PcrRead-trans03.c

示例5: main_v1_1

int
main_v1_1( void )
{
	char			*function = "Tspi_TPM_StirRandom02";
	BYTE			entropy;
	TSS_HCONTEXT		hContext;
	TSS_HTPM		whTPM = -1;
	TSS_RESULT		result;
	UINT32			exitCode = 0;

	print_begin_test( function );

		// seed entropy with time
	srand( time(0) );

		// Create Context
	result = Tspi_Context_Create( &hContext );
	if ( result != TSS_SUCCESS )
	{
		print_error( "Tspi_Context_Create", result );
		exit( result );
	}

		// Connect to Context
	result = Tspi_Context_Connect( hContext, get_server(GLOBALSERVER) );
	if ( result != TSS_SUCCESS )
	{
		print_error( "Tspi_Context_Connect", result );
		Tspi_Context_FreeMemory( hContext, NULL );
		Tspi_Context_Close( hContext );
		exit( result );
	}

	entropy = ( rand() % 100 );

		//Get random number
	result = Tspi_TPM_StirRandom( whTPM, 16, &entropy );
	if ( TSS_ERROR_CODE(result) != TSS_E_INVALID_HANDLE )
	{
		if( !(checkNonAPI(result)) )
		{
			print_error( function, result );
		}
		else
		{
			print_error_nonapi( function, result );
		}
		exitCode = result;
	}
	else
	{
		print_success( function, result );
	}

	print_end_test( function );
	Tspi_Context_FreeMemory( hContext, NULL );
	Tspi_Context_Close( hContext );
	exit( exitCode );
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:59,代码来源:Tspi_TPM_StirRandom02.c

示例6: main_v1_1

main_v1_1(void){

	char		*nameOfFunction = "Tspi_GetAttribData09";
	TSS_HCONTEXT	hContext;
	TSS_RESULT	result;
	TSS_HKEY	hSRK;
	BYTE*		BLOB;
	UINT32		BlobLength;

	print_begin_test(nameOfFunction);

		//Create Context
	result = Tspi_Context_Create(&hContext);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Create ", result);
		exit(result);
	}
		//Connect Context
	result = Tspi_Context_Connect(hContext, get_server(GLOBALSERVER));
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Connect", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}
		//Load Key by UUID for SRK
	result = Tspi_Context_LoadKeyByUUID(hContext, TSS_PS_TYPE_SYSTEM,
				SRK_UUID, &hSRK);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_LoadKeyByUUID", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}
		//Call GetAttribData
	result = Tspi_GetAttribData(hSRK, TSS_TSPATTRIB_KEY_BLOB, TSS_TSPATTRIB_KEYBLOB_PUBLIC_KEY,
				    &BlobLength, &BLOB);
	if (TSS_ERROR_CODE(result) != TSS_E_BAD_PARAMETER) {
		if(!checkNonAPI(result)){
			print_error(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_FreeMemory(hContext, NULL);
			Tspi_Context_Close(hContext);
			exit(result);
		}
		else{
			print_error_nonapi(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_FreeMemory(hContext, NULL);
			Tspi_Context_Close(hContext);
			exit(result);
		}
	}
	else{
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_FreeMemory(hContext, NULL);
		Tspi_Context_Close(hContext);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:59,代码来源:Tspi_GetAttribData09.c

示例7: main_v1_2

main_v1_2(char version){

	char		*nameOfFunction = "Tspi_TPM_OwnerGetSRKPubKey01";
	TSS_RESULT	result;
	TSS_HCONTEXT	hContext;
	TSS_HTPM	hTPM;
	TSS_HKEY	hSRK;
	TSS_HPOLICY	hPolicy;
	UINT32          pulPubKeyLength;
	BYTE            *prgbPubKey;

	print_begin_test(nameOfFunction);

		//Create Context
	result = Tspi_Context_Create(&hContext);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Create", result);
		exit(result);
	}
		//Connect Context
	result = Tspi_Context_Connect(hContext, get_server(GLOBALSERVER));
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Connect", result);
		exit(result);
	}
		//Get TPM Object
	result = Tspi_Context_GetTpmObject(hContext, &hTPM);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_GetTpmObject", result);
		exit(result);
	}

	result = Tspi_GetPolicyObject( hTPM, TSS_POLICY_USAGE, &hPolicy );
	if ( result != TSS_SUCCESS ) {
		print_error( "Tspi_GetPolicyObject", result );
		return result;
	}

	result = Tspi_Policy_SetSecret( hPolicy, TESTSUITE_OWNER_SECRET_MODE,
					TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OWNER_SECRET);
	if ( result != TSS_SUCCESS ) {
		print_error( "Tspi_Policy_SetSecret", result );
		return result;
	}

		//Get SRK Public Key
	result = Tspi_TPM_OwnerGetSRKPubKey(hTPM, &pulPubKeyLength, &prgbPubKey);
	if (result != TSS_SUCCESS) {
		print_error(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_Close(hContext);
		exit(result);
	} else {
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_Close(hContext);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:59,代码来源:Tspi_TPM_OwnerGetSRKPubKey01.c

示例8: main_v1_2

int
main_v1_2(char version)
{
	char			*function = "Tspi_TPM_SetStatus-trans01";
	TSS_HCONTEXT		hContext;
	TSS_HTPM		hTPM;
	TSS_RESULT		result;
	TSS_HKEY		hSRK, hSigningKey, hWrappingKey;

	print_begin_test( function );

	result = connect_load_all(&hContext, &hSRK, &hTPM);
	if ( result != TSS_SUCCESS )
	{
		print_error( "connect_load_all", (result) );
		Tspi_Context_FreeMemory( hContext, NULL );
		Tspi_Context_Close( hContext );
		exit( result );
	}

	result = Testsuite_Transport_Init(hContext, hSRK, hTPM, TRUE, FALSE, &hWrappingKey,
					  &hSigningKey);
	if (result != TSS_SUCCESS) {
		print_error("Testsuite_Transport_Init", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}

		//Get random number
	result = Tspi_TPM_SetStatus( hTPM, TSS_TPMSTATUS_SETOWNERINSTALL, TRUE );
	if (result != TSS_SUCCESS) {
		print_error("Tspi_TPM_SetStatus", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}

	result = Testsuite_Transport_Final(hContext, hSigningKey);
	if ( result != TSS_SUCCESS )
	{
		if( !(checkNonAPI(result)) )
		{
			print_error( function, result );
		}
		else
		{
			print_error_nonapi( function, result );
		}
	}
	else
	{
		print_success( function, result );
	}

	print_end_test( function );
	Tspi_Context_FreeMemory( hContext, NULL );
	Tspi_Context_Close( hContext );
	exit( result );
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:58,代码来源:Tspi_TPM_SetStatus-trans01.c

示例9: main_v1_2

main_v1_2(char version){

	char		*nameOfFunction = "Tspi_TPM_OwnerGetSRKPubKey02";
	TSS_RESULT	result;
	TSS_HCONTEXT	hContext;
	TSS_HKEY	hSRK;
	TSS_HPOLICY	hPolicy;
	UINT32          pulPubKeyLength;
	BYTE            *prgbPubKey;

	print_begin_test(nameOfFunction);

		//Create Context
	result = Tspi_Context_Create(&hContext);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Create", result);
		exit(result);
	}
		//Connect Context
	result = Tspi_Context_Connect(hContext, get_server(GLOBALSERVER));
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Connect", result);
		exit(result);
	}

		//Get SRK Public Key
	result = Tspi_TPM_OwnerGetSRKPubKey(0xffffffff, &pulPubKeyLength, &prgbPubKey);
	if (TSS_ERROR_CODE(result) != TSS_E_INVALID_HANDLE) {
		if(!checkNonAPI(result)){
			print_error(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_Close(hContext);
			exit(result);
		} else {
			print_success(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_Close(hContext);
		exit(result);}
	} else {
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_Close(hContext);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:45,代码来源:Tspi_TPM_OwnerGetSRKPubKey02.c

示例10: main_v1_2

int
main_v1_2(char version)
{
	char		*nameOfFunction = "Tspi_TPM_SelfTestFull-trans03";
	TSS_HCONTEXT	hContext;
	TSS_RESULT	result;
	TSS_HTPM	hTPM;
	TSS_HKEY	hSRK, hWrappingKey;

	print_begin_test(nameOfFunction);

	result = connect_load_all(&hContext, &hSRK, &hTPM);
	if ( result != TSS_SUCCESS )
	{
		print_error( "connect_load_all", (result) );
		Tspi_Context_FreeMemory( hContext, NULL );
		Tspi_Context_Close( hContext );
		exit( result );
	}

	result = Testsuite_Transport_Init(hContext, hSRK, hTPM, TRUE, TRUE, &hWrappingKey,
					  NULL);
	if (result != TSS_SUCCESS) {
		print_error("Testsuite_Transport_Init", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}
		//Call self test full
	result = Tspi_TPM_SelfTestFull(hTPM);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_TPM_SelfTestFull", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}

	result = Testsuite_Transport_Final(hContext, 0);
	if (result != TSS_SUCCESS) {
		if(!checkNonAPI(result)){
			print_error(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_Close(hContext);
			exit(result);
		}
		else{
			print_error_nonapi(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_Close(hContext);
			exit(result);
		}
	}
	else{
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_Close(hContext);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:57,代码来源:Tspi_TPM_SelfTestFull-trans03.c

示例11: last_loop

// Loop for communication with last sensor
void last_loop()
{
    print_info("Last loop");
    while(1)
    {
        if(mode == RECONF)
        {
            sleep(1);
            continue;
        }
        print_info("Waiting for data from last...");
        unsigned char buf[MAX_DATA];
        unsigned last_addr_len = sizeof(last_addr);
        int len = recvfrom(sock_last, buf, MAX_DATA, 0, (struct sockaddr*)&last_addr, &last_addr_len);
        if(len < 0)
        {
            mode = DOUBLE_LIST;
            resolving_error = 1;
            print_warning("Didn't receive data message from last sensor");
            print_success("Mode changed to double-list");
            if(send_error_msg(FIRST) < 0 || receive_ack_and_finit(FIRST) < 0)
            {
                close_first = 1;
            }
            if(send_error_msg(LAST) < 0 || receive_ack_and_finit(LAST) < 0)
            {
                resolving_error = 0;
                return;
            }
            resolving_error = 0;
        }
        else
        {
            union msg received_msg;
            int msg_type = unpack_msg(buf, &received_msg);
            switch(msg_type)
            {
            case INIT_MSG:
                take_init_msg(received_msg.init);
                break;
            case DATA_MSG:
                take_data_msg(received_msg.data);
                break;
            default:
                print_warning("Received unknown bytes");
            }
            cleanup_msg(&received_msg);
        }
        usleep(SERVER_TIMEOUT*1000);
        if(mode == DOUBLE_LIST)
        {
            print_info("Sending data to last sensor...");
            send_data_msg(LAST);
        }
    }
}
开发者ID:Antyradek,项目名称:orbisensoriis,代码行数:57,代码来源:main.c

示例12: main_v1_2

int
main_v1_2( char version )
{
	char *			function = "Tspi_TPM_Delegate_UpdateVerificationCount03";
	TSS_HCONTEXT		hContext;
	TSS_HKEY		hSRK;
	TSS_HTPM		hTPM;
	TSS_HPOLICY		hTPMPolicy;
	TSS_RESULT		result;

	print_begin_test( function );

	result = connect_load_all(&hContext, &hSRK, &hTPM);
	if ( result != TSS_SUCCESS )
	{
		print_error( "connect_load_all", result );
		goto done;
	}

	result = Tspi_GetPolicyObject( hTPM, TSS_POLICY_USAGE, &hTPMPolicy );
	if ( result != TSS_SUCCESS )
	{
		print_error( "Tspi_GetPolicyObject", result );
		goto done;
	}

	result = Tspi_Policy_SetSecret( hTPMPolicy, TESTSUITE_OWNER_SECRET_MODE,
					TESTSUITE_OWNER_SECRET_LEN, TESTSUITE_OWNER_SECRET );
	if ( result != TSS_SUCCESS )
	{
		print_error( "Tspi_Policy_SetSecret", result );
		goto done;
	}

	result = Tspi_TPM_Delegate_UpdateVerificationCount(hTPM, -1);
	if (TSS_ERROR_CODE(result) != TSS_E_INVALID_HANDLE)
	{
		print_error( function, result );
		result = 1;
		goto done;
	}
	else
	{
		print_success( function, result );
		result = 0;
	}

done:
	
	Tspi_Context_FreeMemory( hContext, NULL );
	Tspi_Context_Close( hContext );

	print_end_test( function );
	exit( result );
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:55,代码来源:Tspi_TPM_Delegate_UpdateVerificationCount03.c

示例13: main_v1_1

main_v1_1(void){

	char		*nameOfFunction = "Tspi_TPM_SelfTestFull02";
	TSS_HCONTEXT	hContext;
	TSS_RESULT	result;
	TSS_HTPM	hTPM;
	
	print_begin_test(nameOfFunction);

		//Create Result
	result = Tspi_Context_Create(&hContext);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Create ", result);
		exit(result);
	}
		//Connect Result
	result = Tspi_Context_Connect(hContext, get_server(GLOBALSERVER));
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Connect ", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}
		//Get TPM Object
	result = Tspi_Context_GetTpmObject(hContext,  &hTPM);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_GetTpmObject ", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}
		//Self Test
	result = Tspi_TPM_SelfTestFull(-1);
	if (TSS_ERROR_CODE(result) != TSS_E_INVALID_HANDLE) {
		if(!checkNonAPI(result)){
			print_error(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_FreeMemory(hContext, NULL);
			Tspi_Context_Close(hContext);
			exit(result);
		}
		else{
			print_error_nonapi(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_FreeMemory(hContext, NULL);
			Tspi_Context_Close(hContext);
			exit(result);
		}
	}
	else{
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_FreeMemory(hContext, NULL);
		Tspi_Context_Close(hContext);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:55,代码来源:Tspi_TPM_SelfTestFull02.c

示例14: main_v1_1

int
main_v1_1(void){

	char		*nameOfFunction = "Tspi_Context_CreateObject02";
	TSS_HCONTEXT	hContext;
	TSS_HKEY	hSignatureKey;
	TSS_RESULT	result;

	print_begin_test(nameOfFunction);

		//Create Context
	result = Tspi_Context_Create(&hContext);
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Create ", result);
		exit(result);
	}
		//Connect Context
	result = Tspi_Context_Connect(hContext, get_server(GLOBALSERVER));
	if (result != TSS_SUCCESS) {
		print_error("Tspi_Context_Connect ", result);
		Tspi_Context_Close(hContext);
		exit(result);
	}
		//Create Object
	result = Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_HASH,
				TSS_KEY_SIZE_2048 | TSS_KEY_TYPE_SIGNING |
				TSS_KEY_MIGRATABLE, &hSignatureKey);
	if (TSS_ERROR_CODE(result) != TSS_E_INVALID_OBJECT_INITFLAG){
		if(!checkNonAPI(result)){
			print_error(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_FreeMemory(hContext, NULL);
			Tspi_Context_CloseObject(hContext, hSignatureKey);
			Tspi_Context_Close(hContext);
			exit(result);
		}
		else{
			print_error_nonapi(nameOfFunction, result);
			print_end_test(nameOfFunction);
			Tspi_Context_FreeMemory(hContext, NULL);
			Tspi_Context_CloseObject(hContext, hSignatureKey);
			Tspi_Context_Close(hContext);
			exit(result);
		}
	}
	else{
		print_success(nameOfFunction, result);
		print_end_test(nameOfFunction);
		Tspi_Context_FreeMemory(hContext, NULL);
		Tspi_Context_CloseObject(hContext, hSignatureKey);
		Tspi_Context_Close(hContext);
		exit(0);
	}
}
开发者ID:juliarahmawati,项目名称:testsuite,代码行数:54,代码来源:Tspi_Context_CreateObject02.c

示例15: take_data_msg

/**
* @brief Przyjmij pakiet z danymi i wyświetl je.
* @param received_msg Struktura z danymi
* @return 0 jeśli się udało, lub błąd, gdy inna liczba.
*/
static int take_data_msg(struct data_msg received_msg)
{
    int data_count = received_msg.count;
    print_success("Received %d measurements:", data_count);
    int i;
    for(i = 0; i < data_count; ++i)
    {
        print_info("Sensor: %d Data: %d", received_msg.data[i].id, received_msg.data[i].data);
    }
    return 0;
}
开发者ID:Antyradek,项目名称:orbisensoriis,代码行数:16,代码来源:main.c


注:本文中的print_success函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。