#include "ITs-iotcon-common.h"
+bool g_Error;
//& set: Iotcon
/**
{
FPRINTF("[Line : %d][%s] Callback invoked ,info is NULL \\n", __LINE__, API_NAMESPACE);
}
-
-#if DEBUG
- FPRINTF("[Line : %d][%s] IotconGetDeviceInfoCB callback called\\n", __LINE__, API_NAMESPACE);
-#endif
+ else
+ {
+ FPRINTF("[Line : %d][%s] Callback invoked\\n", __LINE__, API_NAMESPACE);
+ }
g_bCheckCb = true;
if ( g_pMainLoop )
{
if ( info == NULL )
{
- FPRINTF("[Line : %d][%s] Callback invoked for get platform info \\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] Callback invoked for get platform info. info is NULL \\n", __LINE__, API_NAMESPACE);
+ }
+ else
+ {
+ FPRINTF("[Line : %d][%s] Callback invoked for get platform info\\n", __LINE__, API_NAMESPACE);
}
-#if DEBUG
- FPRINTF("[Line : %d][%s] IotconGetPlatformInfoCB callback called\\n", __LINE__, API_NAMESPACE);
-#endif
g_bCheckCb = true;
if ( g_pMainLoop )
{
if ( info == NULL )
{
- FPRINTF("[Line : %d][%s] Callback invoked for device_info_get_property \\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] Callback invoked for device_info_get_property. info is NULL \\n", __LINE__, API_NAMESPACE);
}
-
+ else
+ {
+ FPRINTF("[Line : %d][%s] Callback invoked. \\n", __LINE__, API_NAMESPACE);
+ }
+
g_bCheckCb = true;
char *pszValue = NULL;
for(nEnumStartCount = 0 ; nEnumStartCount < nGetPropertyOptionCount ; nEnumStartCount++ )
{
nRet = iotcon_device_info_get_property(info, nGetPropertyOption[nEnumStartCount],&pszValue);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_device_info_get_property", IotConGetError(nRet));
+ if (IOTCON_ERROR_NONE != nRet)
+ {
+ g_Error = true;
+ FPRINTF("[Line : %d][%s] iotcon_device_info_get_property failed for enum: %d Error: %s\\n", __LINE__, API_NAMESPACE, nEnumStartCount, IotConGetError(nRet));
+ if ( g_pMainLoop )
+ {
+ g_main_loop_quit(g_pMainLoop);
+ g_pMainLoop = NULL;
+ }
+ return false;
+ }
FPRINTF(" property = [EnumVal : %d][ Value : %s] \\n", nEnumStartCount, pszValue);
- return false;
}
if ( g_pMainLoop )
{
if ( info == NULL )
{
- FPRINTF("[Line : %d][%s] Callback invoked for device_info_get_property \\n", __LINE__, API_NAMESPACE);
+ FPRINTF("[Line : %d][%s] Callback invoked for device_info_get_property. Info is NULL \\n", __LINE__, API_NAMESPACE);
+ }
+ else
+ {
+ FPRINTF("[Line : %d][%s] Callback invoked. \\n", __LINE__, API_NAMESPACE);
}
g_bCheckCb = true;
-
char *pszValue = NULL;
-int nGetPropertyOption[] = {
- IOTCON_PLATFORM_INFO_ID ,
- IOTCON_PLATFORM_INFO_MANUF_NAME,
- IOTCON_PLATFORM_INFO_MANUF_URL,
- IOTCON_PLATFORM_INFO_MODEL_NUMBER,
- IOTCON_PLATFORM_INFO_DATE_OF_MANUF ,
- IOTCON_PLATFORM_INFO_PLATFORM_VER,
- IOTCON_PLATFORM_INFO_OS_VER,
- IOTCON_PLATFORM_INFO_HARDWARE_VER,
- IOTCON_PLATFORM_INFO_FIRMWARE_VER,
- IOTCON_PLATFORM_INFO_SUPPORT_URL,
- IOTCON_PLATFORM_INFO_SYSTEM_TIME,
-
-};
- int nRet = -1;
- int nEnumStartCount = 0 ;
-
- int nGetPropertyOptionCount = sizeof(nGetPropertyOption) / sizeof(nGetPropertyOption[0]);
-
- for(nEnumStartCount = 0 ; nEnumStartCount < nGetPropertyOptionCount ; nEnumStartCount++ )
+ int nGetPropertyOption[] = {
+ IOTCON_PLATFORM_INFO_ID ,
+ IOTCON_PLATFORM_INFO_MANUF_NAME,
+ IOTCON_PLATFORM_INFO_MANUF_URL,
+ IOTCON_PLATFORM_INFO_MODEL_NUMBER,
+ IOTCON_PLATFORM_INFO_DATE_OF_MANUF ,
+ IOTCON_PLATFORM_INFO_PLATFORM_VER,
+ IOTCON_PLATFORM_INFO_OS_VER,
+ IOTCON_PLATFORM_INFO_HARDWARE_VER,
+ IOTCON_PLATFORM_INFO_FIRMWARE_VER,
+ IOTCON_PLATFORM_INFO_SUPPORT_URL,
+ IOTCON_PLATFORM_INFO_SYSTEM_TIME,
+
+ };
+ int nRet = -1;
+ int nEnumStartCount = 0 ;
+
+ int nGetPropertyOptionCount = sizeof(nGetPropertyOption) / sizeof(nGetPropertyOption[0]);
+
+ for(nEnumStartCount = 0 ; nEnumStartCount < nGetPropertyOptionCount ; nEnumStartCount++ )
+ {
+ nRet = iotcon_platform_info_get_property(info, nGetPropertyOption[nEnumStartCount],&pszValue);
+ if (IOTCON_ERROR_NONE != nRet)
{
- nRet = iotcon_platform_info_get_property(info, nGetPropertyOption[nEnumStartCount],&pszValue);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_device_info_get_property", IotConGetError(nRet));
- FPRINTF(" property = [EnumVal : %d][ Value : %s] \\n",nEnumStartCount, pszValue);
+ g_Error = true;
+ FPRINTF("[Line : %d][%s] iotcon_platform_info_get_property failed for enum: %d Error: %s\\n", __LINE__, API_NAMESPACE, nEnumStartCount, IotConGetError(nRet));
+ if ( g_pMainLoop )
+ {
+ g_main_loop_quit(g_pMainLoop);
+ g_pMainLoop = NULL;
+ }
return false;
}
-
+ FPRINTF(" property = [EnumVal : %d][ Value : %s] \\n",nEnumStartCount, pszValue);
+ }
if ( g_pMainLoop )
{
}
g_bIotconConnect = true;
g_bFeatureUnsupported = false;
-
+ g_Error = false;
+
ic_get_svr_db_path(&svr_db_path);
int nRet = iotcon_initialize(svr_db_path);
free(svr_db_path);
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
- iotcon_query_h hQuery = NULL;
-
- int nRet = iotcon_query_create(&hQuery);
- PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_create", IotConGetError(nRet));
- CHECK_HANDLE(hQuery,"iotcon_query_create");
- nRet = iotcon_query_set_resource_type(hQuery, LIGHT_RESOURCE_TYPE);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_query_set_resource_type", IotConGetError(nRet), iotcon_query_destroy(hQuery));
-
- nRet = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, hQuery, IotconGetDeviceInfoCB, NULL);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_find_device_info", IotConGetError(nRet),iotcon_query_destroy(hQuery));
+ int nRet = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, NULL, IotconGetDeviceInfoCB, NULL);
+ PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_device_info", IotConGetError(nRet));
RUN_POLLING_LOOP;
if(g_bCheckCb != true)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
- iotcon_query_destroy(hQuery);
return 1;
}
- nRet = iotcon_query_destroy(hQuery);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
-
return 0;
}
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
- iotcon_query_h hQuery = NULL;
-
- int nRet = iotcon_query_create(&hQuery);
- PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_create", IotConGetError(nRet));
- CHECK_HANDLE(hQuery,"iotcon_query_create");
+ g_Error = false;
- nRet = iotcon_query_set_resource_type(hQuery, LIGHT_RESOURCE_TYPE);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_query_set_resource_type", IotConGetError(nRet), iotcon_query_destroy(hQuery));
-
- nRet = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, hQuery, IotconDeviceInfoGetPropertyCB, NULL);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_find_device_info", IotConGetError(nRet),iotcon_query_destroy(hQuery));
+ int nRet = iotcon_find_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, NULL, IotconDeviceInfoGetPropertyCB, NULL);
+ PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_device_info", IotConGetError(nRet));
RUN_POLLING_LOOP;
if(g_bCheckCb != true)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
- iotcon_query_destroy(hQuery);
return 1;
}
-
- nRet = iotcon_query_destroy(hQuery);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
+ if(g_Error == true)
+ {
+ FPRINTF("[Line : %d][%s] iotcon_device_info_get_property failed : \\n", __LINE__, API_NAMESPACE );
+ return 1;
+ }
return 0;
}
* @since_tizen 3.0
* @description To extract representative colour from an image buffer.
* @scenario connect device \n
-* iotcon_find_device_info \n
+* iotcon_find_platform_info \n
* @apicovered iotcon_initialize, iotcon_find_platform_info
* @passcase If iotcon_find_platform_info passes.
* @failcase If iotcon_find_platform_info fails.
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
- iotcon_query_h hQuery = NULL;
- int nRet = iotcon_query_create(&hQuery);
- PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_create", IotConGetError(nRet));
- CHECK_HANDLE(hQuery,"iotcon_query_create");
-
- nRet = iotcon_query_set_resource_type(hQuery, LIGHT_RESOURCE_TYPE);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_query_set_resource_type", IotConGetError(nRet), iotcon_query_destroy(hQuery));
-
- nRet = iotcon_find_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, hQuery, IotconGetPlatformInfoCB, NULL);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_find_platform_info", IotConGetError(nRet),iotcon_query_destroy(hQuery));
+ int nRet = iotcon_find_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, NULL, IotconGetPlatformInfoCB, NULL);
+ PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_platform_info", IotConGetError(nRet));
RUN_POLLING_LOOP;
if(g_bCheckCb != true)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
- iotcon_query_destroy(hQuery);
return 1;
}
- nRet = iotcon_query_destroy(hQuery);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
-
return 0;
}
START_TEST;
int nIotconTimeoutId = 0;
g_bCheckCb = false;
- iotcon_query_h hQuery = NULL;
+ g_Error = false;
- int nRet = iotcon_query_create(&hQuery);
- PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_query_create", IotConGetError(nRet));
- CHECK_HANDLE(hQuery,"iotcon_query_create");
-
- nRet = iotcon_query_set_resource_type(hQuery, LIGHT_RESOURCE_TYPE);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_query_set_resource_type", IotConGetError(nRet), iotcon_query_destroy(hQuery));
-
- nRet = iotcon_find_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, hQuery, IotconPlatformInfoGetPropertyCB, NULL);
- PRINT_RESULT_CLEANUP(IOTCON_ERROR_NONE, nRet, "iotcon_find_platform_info", IotConGetError(nRet),iotcon_query_destroy(hQuery));
+ int nRet = iotcon_find_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4, NULL, IotconPlatformInfoGetPropertyCB, NULL);
+ PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_find_platform_info", IotConGetError(nRet));
RUN_POLLING_LOOP;
if(g_bCheckCb == false)
{
FPRINTF("[Line : %d][%s] callback not invoked : \\n", __LINE__, API_NAMESPACE );
- iotcon_query_destroy(hQuery);
+ return 1;
+ }
+ if(g_Error == true)
+ {
+ FPRINTF("[Line : %d][%s] iotcon_platform_info_get_property failed : \\n", __LINE__, API_NAMESPACE );
return 1;
}
- nRet = iotcon_query_destroy(hQuery);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
-
return 0;
}
/** @} */
-/** @} */
-
-
+/** @} */
\ No newline at end of file