Fix service_detection_cycle GET/SET APIs 44/208844/1
authorAtul Rai <a.rai@samsung.com>
Tue, 11 Jun 2019 14:24:02 +0000 (19:54 +0530)
committersaerome kim <saerome.kim@samsung.com>
Mon, 1 Jul 2019 02:01:57 +0000 (11:01 +0900)
Change-Id: Ie6dc128d8a63418800a213fb71cf8b0eb8d638ef
Signed-off-by: Atul Rai <a.rai@samsung.com>
include/ua-api.h
ua-api/src/ua-api.c

index 021189b..71864da 100644 (file)
@@ -244,9 +244,9 @@ int _uam_service_add_device(const char *service, char *device_id, uam_tech_type_
 
 int _uam_service_remove_device(const char *service, char *device_id, uam_tech_type_e tech_type);
 
-int _uam_set_service_detection_cycle(const char *service, int cycle);
+int _uam_set_service_detection_cycle(const char *service, unsigned int cycle);
 
-int _uam_get_service_detection_cycle(const char *service);
+int _uam_get_service_detection_cycle(const char *service, unsigned int *cycle);
 
 #ifdef __cplusplus
 }
index 57ed908..354b1b4 100644 (file)
@@ -989,7 +989,7 @@ UAM_EXPORT_API int _uam_service_remove_device(const char *service, char *device_
        return ret;
 }
 
-UAM_EXPORT_API int _uam_set_service_detection_cycle(const char *service, int cycle)
+UAM_EXPORT_API int _uam_set_service_detection_cycle(const char *service, unsigned int cycle)
 {
        FUNC_ENTRY;
        int ret;
@@ -1002,7 +1002,7 @@ UAM_EXPORT_API int _uam_set_service_detection_cycle(const char *service, int cyc
 
        g_strlcpy(svc_str, service, UAM_SERVICE_MAX_STRING_LEN);
        g_array_append_vals(in_param1, svc_str, sizeof(svc_str));
-       g_array_append_vals(in_param2, &cycle, sizeof(int));
+       g_array_append_vals(in_param2, &cycle, sizeof(unsigned int));
 
        ret = _uam_sync_request(UAM_REQUEST_SET_SERVICE_DETECTION_CYCLE,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
@@ -1013,7 +1013,7 @@ UAM_EXPORT_API int _uam_set_service_detection_cycle(const char *service, int cyc
        return ret;
 }
 
-UAM_EXPORT_API int _uam_get_service_detection_cycle(const char *service)
+UAM_EXPORT_API int _uam_get_service_detection_cycle(const char *service, unsigned int *cycle)
 {
        FUNC_ENTRY;
        int ret;
@@ -1029,6 +1029,10 @@ UAM_EXPORT_API int _uam_get_service_detection_cycle(const char *service)
 
        ret = _uam_sync_request(UAM_REQUEST_GET_SERVICE_DETECTION_CYCLE,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
+       if (UAM_ERROR_NONE == ret) {
+               *cycle = g_array_index(out_param, unsigned int, 0);
+               UAM_INFO("Detection cycle: %d for %s", *cycle, service);
+       }
 
        UAM_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);