g_free(data);
}
+
+static void __monitor_result_cb(Group *object, gchar *uuid, gchar *group_name,
+ gchar *status, gpointer user_data)
+{
+ companion_device_status_e device_status;
+ comp_manager_s *handle = user_data;
+ companion_check_null_ret("user_data", user_data);
+
+ _DBG("Received Monitor Result uuid %s group name %s status %s", uuid,
+ group_name, status);
+
+ if (g_strcmp0(status, "Added") == 0)
+ device_status = COMPANION_DEVICE_ADDED;
+ else if (g_strcmp0(status, "Removed") == 0)
+ device_status = COMPANION_DEVICE_REMOVED;
+ else
+ return;
+
+ if (handle->monitor_result_cb.cb) {
+ handle->monitor_result_cb.cb(uuid, group_name, device_status,
+ handle->monitor_result_cb.user_data);
+ }
+}
/* LCOV_EXCL_STOP */
"send-data-finish", G_CALLBACK(__send_data_finish_cb), handle);
g_signal_connect(handle->group_proxy,
"request-result", G_CALLBACK(__request_result_cb), handle);
+ g_signal_connect(handle->group_proxy,
+ "device-monitor-result", G_CALLBACK(__monitor_result_cb), handle);
return COMP_ERROR_NONE;
}