return UA_ERROR_NONE;
}
+int ua_service_update(ua_service_h service_handle)
+{
+ FUNC_ENTRY;
+
+ int ret;
+ uam_service_info_s uam_service;
+ ua_service_info_s *service = (ua_service_info_s *)service_handle;
+
+ UA_VALIDATE_INPUT_PARAMETER(service_handle);
+ UA_VALIDATE_HANDLE(service_handle, ua_services_list);
+
+ retv_if(NULL == service->name, UA_ERROR_INVALID_PARAMETER);
+ retv_if(service->isadded != TRUE, UA_ERROR_INVALID_PARAMETER);
+
+ memset(&uam_service, 0, sizeof(uam_service_info_s));
+ g_strlcpy(uam_service.name, service->name, UAM_SERVICE_MAX_STRING_LEN);
+ uam_service.presence_threshold = service->presence_threshold;
+ uam_service.absence_threshold = service->absence_threshold;
+
+ ret = _ua_get_error_code(_uam_update_service(&uam_service));
+ if (UA_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ UA_ERR("Failed with error: %s(0x%X)",
+ _ua_get_error_string(ret), ret);
+ return ret;
+ /* LCOV_EXCL_STOP */
+ }
+
+ FUNC_EXIT;
+ return UA_ERROR_NONE;
+}
+
int ua_service_remove(ua_service_h service_handle)
{
FUNC_ENTRY;
return RET_SUCCESS;
}
+static int run_ua_service_update(
+ MManager *mm, struct menu_data *menu)
+{
+ int ret = UA_ERROR_NONE;
+
+ msg("ua_service_update");
+
+ check_if(NULL == g_service_h);
+
+ ret = ua_service_update(g_service_h);
+
+ msg(" - ua_service_update() ret: [0x%X] [%s]",
+ ret, uat_get_error_str(ret));
+
+ return RET_SUCCESS;
+}
+
static int run_ua_service_remove(
MManager *mm, struct menu_data *menu)
{
menu_ua_service_set_detection_threshold, NULL, NULL },
{ "5", "ua_service_add",
NULL, run_ua_service_add, NULL },
- { "6", "ua_service_remove",
+ { "6", "ua_service_update",
+ NULL, run_ua_service_update, NULL },
+ { "7", "ua_service_remove",
NULL, run_ua_service_remove, NULL},
- { "7", "ua_service_destroy",
+ { "8", "ua_service_destroy",
NULL, run_ua_service_destroy, NULL},
- { "8", "ua_service_get_by_name",
+ { "9", "ua_service_get_by_name",
menu_ua_service_get_by_name, NULL, NULL },
- { "9", "ua_service_foreach_added_services",
+ { "10", "ua_service_foreach_added_services",
NULL, run_ua_service_foreach_added_services, NULL },
{ NULL, NULL, },
};