net_nfc_error_e out_result = NET_NFC_OK;
GError *error = NULL;
- net_nfc_client_manager_init();
-
- if (manager_proxy == NULL)
- return NET_NFC_NOT_INITIALIZED;
-
/* prevent executing daemon when nfc is off */
if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- if (net_nfc_gdbus_manager_call_configure_discovery_sync(manager_proxy,
+ if (auto_start_proxy == NULL) {
+ auto_start_proxy = net_nfc_gdbus_manager_proxy_new_for_bus_sync(
+ G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ "org.tizen.NetNfcService",
+ "/org/tizen/NetNfcService/Manager",
+ NULL,
+ &error);
+ if (auto_start_proxy == NULL) {
+ DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+ g_error_free(error);
+
+ return NET_NFC_UNKNOWN_ERROR;
+ }
+ }
+
+ if (net_nfc_gdbus_manager_call_configure_discovery_sync(auto_start_proxy,
mode,
&out_result,
NULL,