Exemplo n.º 1
0
void WD_SYSTEM performtest_getWaitSessionQueryTime(void)
{
    if(SYS_ISIN(SYS_AUTHRECV)){
        APPEND_TM(g_performtest.d_tm_dtls_auth_wait);
        performtest_timeReset();
    }
}
Exemplo n.º 2
0
void performtest_tm_getRecvDtls(void)
{
	if(SYS_ISIN(SYS_APPLICATIONRECV))
	{
		APPEND_TM(g_performtest.d_tm_recv_dtls);
	}
}
Exemplo n.º 3
0
void WD_SYSTEM performtest_getHandleRecvDtlsTime(void)
{
    if(SYS_ISIN(SYS_APPLICATIONRECV))
    {
        APPEND_TM(g_performtest.d_tm_recv_dtls);
    }
}
Exemplo n.º 4
0
void performtest_tm_getAuthWait(void)
{
	if(SYS_ISIN(SYS_AUTHRECV)){
		APPEND_TM(g_performtest.d_tm_dtls_auth_wait);
		performtest_star_tm();
	}
}
Exemplo n.º 5
0
void WD_SYSTEM perform_sync(void)
{
    if(SYS_ISIN(SYS_APPLICATIONSENDING))
    {
        int m;
        u8 request_num= 1;//REQ_NUMBER;
        os_timer_disarm(&test_timer2);

        performtest_timeReset();
        for(m=0; m < request_num; m++)
        {
            performtest_timeReset();
            int res = wilddog_getValue(wilddog, test_onQueryFunc, NULL);
            performtest_getSendTime();
            if(0 == res)
                perform_count++;
            else
                g_performtest.d_send_fault++;
        }
        performtest_timeReset();
        performtest_setSysState(SYS_APPLICATIONRECV);

      
        os_timer_disarm(&test_timer2);
        os_timer_setfn(&test_timer2, (os_timer_func_t *)perform_sync2, NULL);
        os_timer_arm(&test_timer2, 1000, 0); 
      //wilddog_destroy(&wilddog);
    }
    else
    {
        wilddog_trySync();
        os_timer_setfn(&test_timer2, (os_timer_func_t *)perform_sync, NULL);        
        os_timer_arm(&test_timer2, 1000, 0);            
    }
}
Exemplo n.º 6
0
void performtest_tm_getRecv(void)
{
	if(SYS_ISIN(SYS_APPLICATIONRECV))
	{
		APPEND_TM(g_performtest.d_tm_recv);
		performtest_setSysState(SYS_APPLICATIONRECVDONE);
	}
}
Exemplo n.º 7
0
void performtest_tm_getRecv_wait(void)
{
	if(SYS_ISIN(SYS_APPLICATIONRECV))
	{
		APPEND_TM(g_performtest.d_tm_recv_wait);
		performtest_star_tm();
	}
}
Exemplo n.º 8
0
void performtest_tm_getDtlsSend(void)
{
	if(SYS_ISIN(SYS_APPLICATIONSENDING) )
	{
		u32 temp = performtest_cacl_tm();
		GET_AVERAGE(g_performtest.d_tm_dtls_send,temp);
	}
 }
Exemplo n.º 9
0
void WD_SYSTEM performtest_getDtlsHskTime(void)
{
    if(SYS_ISIN(SYS_HSK))
    {
        APPEND_TM(g_performtest.d_tm_dtls_hsk);
        performtest_setSysState(SYS_AUTHSENDING);
    }
}
Exemplo n.º 10
0
void WD_SYSTEM performtest_getHandleRecvTime(void)
{
    if(SYS_ISIN(SYS_APPLICATIONRECV))
    {
        APPEND_TM(g_performtest.d_tm_recv);
        performtest_setSysState(SYS_APPLICATIONRECVDONE);
    }
}
Exemplo n.º 11
0
void WD_SYSTEM performtest_getWaitRecvTime(void)
{
    if(SYS_ISIN(SYS_APPLICATIONRECV))
    {
        APPEND_TM(g_performtest.d_tm_recv_wait);
        performtest_timeReset();
    }
}
Exemplo n.º 12
0
void WD_SYSTEM performtest_getDtlsSendTime(void)
{
    if(SYS_ISIN(SYS_APPLICATIONSENDING) )
    {
        u32 temp = performtest_calDiffTime();
        GET_AVERAGE(g_performtest.d_tm_dtls_send,temp);
    }
 }
Exemplo n.º 13
0
void performtest_tm_getAuthHandle(void)
{
	if(SYS_ISIN(SYS_AUTHRECV))
	{
		APPEND_TM(g_performtest.d_tm_dtls_auth_handle);
		performtest_setSysState(SYS_APPLICATIONSENDING);
		performtest_star_tm();
	}
}
Exemplo n.º 14
0
void WD_SYSTEM performtest_getHandleSessionResponTime(void)
{
    if(SYS_ISIN(SYS_AUTHRECV))
    {
        APPEND_TM(g_performtest.d_tm_dtls_auth_handle);
        performtest_setSysState(SYS_APPLICATIONSENDING);
        performtest_timeReset();
    }
}
Exemplo n.º 15
0
void performtest_tm_printf(void)
{
	if(SYS_ISIN(SYS_APPLICATIONRECV))
	{
		static u32 tm_temp=0;
		APPEND_TM(tm_temp);
		printf("performtest_tm =%ld\n",tm_temp);
	}
}
Exemplo n.º 16
0
void performtest_tm_getDtlsHskVerify(void)
{
	if(SYS_ISIN(SYS_HSK))
		APPEND_TM(g_performtest.d_tm_dtls_hsk_verify);
}
Exemplo n.º 17
0
void WD_SYSTEM performtest_handle
	(
	u32 delay_tm,
	const u8 *p_url,
	u32 tree_num, 
	u8 request_num
	)
{
    u8 m = 0;
    Wilddog_T wilddog = 0;
        
    performtest_init(delay_tm,tree_num,request_num);
    performtest_setSysState(SYS_HSK);

    wilddog = wilddog_initWithUrl((Wilddog_Str_T*)p_url);
    if(0 == wilddog)
    {
        return;
    }
    perform_count = 0;
    performtest_setSysState(SYS_AUTHRECV);
    performtest_timeReset();
    while(1)
    {
        wilddog_trySync();
        if(SYS_ISIN(SYS_APPLICATIONSENDING))
            break;
    }
    performtest_timeReset();
    for(m=0; m < request_num; m++)
    {
        performtest_timeReset();
        /*printf("g_performtest.d_tm_star = %ul\n", g_performtest.d_tm_star);*/
        int res = wilddog_getValue(wilddog, test_onQueryFunc, NULL);
        performtest_getSendTime();
        /*printf("g_performtest.d_tm_send = %ul\n", g_performtest.d_tm_send);*/
        if(0 == res)
            perform_count++;
        else
            g_performtest.d_send_fault++;
        /*printf("send =%d;res =%d \n",perform_count,res);*/
    }
    performtest_timeReset();
    performtest_setSysState(SYS_APPLICATIONRECV);
    while(1)
    {
        if(perform_count == 0)
        {
            //printf("break\n");
            performtest_printf(&g_performtest);
            break;
        }
#ifdef WILDDOG_PORT_TYPE_WICED
        wiced_rtos_delay_milliseconds(g_performtest.d_tm_trysync_delay);
#else
#if defined WILDDOG_PORT_TYPE_ESP
        os_delay_us(1000 * g_performtest.d_tm_trysync_delay);
#else
        usleep(g_performtest.d_tm_trysync_delay);
#endif
#endif
        wilddog_increaseTime(g_performtest.d_tm_trysync_delay);
        wilddog_trySync();
    }
    wilddog_destroy(&wilddog);
    return;
}
Exemplo n.º 18
0
void WD_SYSTEM performtest_getDtlsHskVerifyTime(void)
{
    if(SYS_ISIN(SYS_HSK))
        APPEND_TM(g_performtest.d_tm_dtls_hsk_verify);
}
Exemplo n.º 19
0
void performtest_handle( u32 delay_tm,u8 tree_num, u8 request_num)
{
	u8 m = 0;
	Wilddog_T wilddog = 0;
    u8 url[64]={0};
	
    sprintf((char*)url, "coaps://c_test.wilddogio.com/performtest/tree_%d", tree2len[tree_num]);
	
	performtest_init(delay_tm,tree_num,request_num);
	performtest_setSysState(SYS_HSK);

	wilddog = wilddog_initWithUrl(url);
		  
	if(0 == wilddog)
	{
		return;
	}
	perform_count = 0;
	performtest_setSysState(SYS_AUTHRECV);
	performtest_star_tm();
	while(1)
	{
		wilddog_trySync();
		if(SYS_ISIN(SYS_APPLICATIONSENDING))
			break;
	}
	performtest_star_tm();
	for(m=0; m < request_num; m++)
	{
		performtest_star_tm();
		/*printf("g_performtest.d_tm_star = %ul\n", g_performtest.d_tm_star);*/
		int res = wilddog_getValue(wilddog, test_onQueryFunc, NULL);
		performtest_tm_getSend();
		/*printf("g_performtest.d_tm_send = %ul\n", g_performtest.d_tm_send);*/
				if(0 == res)
			perform_count++;
		else
			g_performtest.d_send_fault++;
		/*printf("send =%d;res =%d \n",perform_count,res);*/
	}
	performtest_star_tm();
	performtest_setSysState(SYS_APPLICATIONRECV);
	while(1)
	{
		if(perform_count == 0)
		{
			//printf("break\n");
			performtest_printf(&g_performtest);
			break;
		}
#ifdef WILDDOG_PORT_TYPE_WICED
		wiced_rtos_delay_milliseconds(g_performtest.d_tm_trysync_delay);
#else 
		usleep(g_performtest.d_tm_trysync_delay);
#endif
		wilddog_increaseTime(g_performtest.d_tm_trysync_delay);
		wilddog_trySync();
	}
	wilddog_destroy(&wilddog);
	return;
}