コード例 #1
0
void BatteryProviderEfl::stopUpdating()
{
    if (!m_timer.isActive())
        return;

    m_timer.stop();
    e_ukit_shutdown();
    e_dbus_shutdown();
}
コード例 #2
0
EAPI int
e_notification_shutdown(void)
{
  if (--init_count) return init_count;
  e_dbus_connection_close(client_conn);
  client_conn = NULL;
  e_dbus_shutdown();
  return 0;
}
コード例 #3
0
EAPI int
e_notification_init(void)
{
  if (init_count) return ++init_count;

  if (!e_dbus_init()) return 0;
  client_conn = e_dbus_bus_get(DBUS_BUS_SESSION);
  if (!client_conn)
  {
    e_dbus_shutdown();
    return 0;
  }

  return ++init_count;
}
コード例 #4
0
void BatteryProviderEfl::startUpdating()
{
    if (m_timer.isActive())
        return;

    if (!e_dbus_init())
        return;

    if (!e_ukit_init()) {
        e_dbus_shutdown();
        return;
    }

    m_timer.startRepeating(m_batteryStatusRefreshInterval);
}
コード例 #5
0
ファイル: e_msgbus.c プロジェクト: hippytaff/Enform
EINTERN int
e_msgbus_shutdown(void)
{
   if (_e_msgbus_data->obj)
     {
        e_dbus_object_free(_e_msgbus_data->obj);
     }
   if (_e_msgbus_data->conn)
     {
        e_dbus_connection_close(_e_msgbus_data->conn);
     }
#ifdef HAVE_HAL
   e_hal_shutdown();
#endif
   e_dbus_shutdown();

   E_FREE(_e_msgbus_data);
   _e_msgbus_data = NULL;
   return 1;
}
コード例 #6
0
int
main(__UNUSED__ int argc, __UNUSED__ char *argv[])
{
   E_DBus_Connection *c;
   int total;

   ecore_init();
   e_dbus_init();
   eina_init();

   c = e_dbus_bus_get(DBUS_BUS_SYSTEM);
   if (!c) {
      printf("ERROR: can't connect to system session\n");
      return -1;
   }

   e_connman_system_init(c);
   ecore_event_handler_add(E_CONNMAN_EVENT_ELEMENT_ADD, _on_element_add, NULL);
   ecore_event_handler_add(E_CONNMAN_EVENT_ELEMENT_DEL, _on_element_del, NULL);
   ecore_event_handler_add(E_CONNMAN_EVENT_ELEMENT_UPDATED,
			   _on_element_updated, NULL);

   _exiter_reschedule();

   ecore_main_loop_begin();

   e_dbus_connection_close(c);
   eina_stringshare_dump();
   eina_shutdown();
   e_dbus_shutdown();
   ecore_shutdown();

   total = success + failure;
   if (total == 0)
     fputs("DBG: clean exit, no tests executed.\n", stderr);
   else
     fprintf(stderr, "DBG: clean exit, success: %d, failure: %d, %d%%\n",
	     success, failure, (success * 100) / total);

   return 0;
}
コード例 #7
0
ファイル: e_dbus_bluez_test.c プロジェクト: Limsik/e17
int
main(__UNUSED__ int argc,__UNUSED__ char *argv[])
{
   ecore_init();
   e_dbus_init();
   eina_init();

   _msgbus_data = calloc(1, sizeof(E_Msgbus_Data));
   _msgbus_data->conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
   if (!_msgbus_data->conn) {
      printf("ERROR: can't connect to system session\n");
      return -1;
   }

   e_bluez_system_init(_msgbus_data->conn);

   ecore_event_handler_add(E_BLUEZ_EVENT_ELEMENT_ADD, _on_element_add, NULL);
   ecore_event_handler_add(E_BLUEZ_EVENT_ELEMENT_DEL, _on_element_del, NULL);
   ecore_event_handler_add(E_BLUEZ_EVENT_ELEMENT_UPDATED,
			   _on_element_updated, NULL);
   ecore_event_handler_add(E_BLUEZ_EVENT_DEVICE_FOUND,
			   _on_device_found, NULL);

   ecore_main_fd_handler_add
     (0, ECORE_FD_READ | ECORE_FD_ERROR, _on_input, NULL, NULL, NULL);

   ecore_main_loop_begin();

   e_bluez_system_shutdown();

   e_dbus_connection_close(_msgbus_data->conn);
   eina_shutdown();
   e_dbus_shutdown();
   ecore_shutdown();

   fputs("DBG: clean exit.\n", stderr);

   return 0;
}
コード例 #8
0
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
   Instance *inst;

#ifdef HAVE_EEZE
   eeze_shutdown();
#elif !defined __OpenBSD__
   e_hal_shutdown();
   e_dbus_shutdown();
#endif

   inst = gcc->data;
   battery_config->instances = 
     eina_list_remove(battery_config->instances, inst);
   evas_object_del(inst->o_battery);
   if (inst->warning)
     {
        e_object_del(E_OBJECT(inst->warning));
        inst->popup_battery = NULL;
     }
   E_FREE(inst);
}
コード例 #9
0
void 
e_mod_kbd_device_shutdown(void) 
{
   char *str;

#ifdef HAVE_EEZE
   if (watch) eeze_udev_watch_del(watch);
   eeze_shutdown();
#else
   /* remove the dbus signal handlers if we can */
   if (_dev_add) e_dbus_signal_handler_del(_dbus_conn, _dev_add);
   if (_dev_del) e_dbus_signal_handler_del(_dbus_conn, _dev_del);
   if (_dev_chg) e_dbus_signal_handler_del(_dbus_conn, _dev_chg);
   e_hal_shutdown();
   e_dbus_shutdown();
#endif
   /* free the list of ignored keyboards */
   EINA_LIST_FREE(_ignore_kbds, str)
     eina_stringshare_del(str);

   /* free the list of keyboards */
   EINA_LIST_FREE(_device_kbds, str)
     eina_stringshare_del(str);
}
コード例 #10
0
int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t length)
{
	int result = 0;
	uint32_t i, count = 1;
	E_DBus_Connection *conn = NULL;

	LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__);

	if (address == NULL || files == NULL)
	{
		LOGD("invalid param [%p] [%p]", address, files);
		return 0;
	}

	/* count files */
	for (i = 0; i < length; i++)
	{
		if (files[i] == '?')
		{
			count++;
		}
	}

	if (e_dbus_init() > 0)
	{
		if ((conn = e_dbus_bus_get(DBUS_BUS_SYSTEM)) != NULL)
		{
			DBusMessage *msg = NULL;

			if (e_dbus_request_name(conn, "User.Bluetooth.UG", 0, NULL, NULL) != NULL)
			{
				if ((msg = dbus_message_new_signal("/org/projectx/connect_device", "User.Bluetooth.UG", "Send")) != NULL)
				{
					int reserved = 0;
					char *type = "nfc";

					LOGD("msg [%p], reserved [%d], address [%02X:%02X:%02X:%02X:%02X:%02X], count [%d], files [%s]", msg, reserved, address[0], address[1], address[2], address[3], address[4], address[5], count, files);

					if (dbus_message_append_args(msg,
												DBUS_TYPE_INT32, &reserved,
												DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &address, 6,
												DBUS_TYPE_INT32, &count,
												DBUS_TYPE_STRING, &files,
												DBUS_TYPE_STRING, &type,
												DBUS_TYPE_INVALID))
					{
						e_dbus_message_send(conn, msg, NULL, -1, NULL);

						LOGD("Send success");
					}
					else
					{
						LOGE("Connect sending failed");

						result = -1;
					}

					dbus_message_unref(msg);
				}
				else
				{
					LOGE("dbus_message_new_signal failed");

					result = -1;
				}
			}
			else
			{
				LOGE("e_dbus_request_name failed");

				result = -1;
			}
		}
		else
		{
			LOGE("e_dbus_bus_get failed");

			result = -1;
		}

		e_dbus_shutdown();
	}
	else
	{
		LOGE("e_dbus_init failed");

		result = -1;
	}

	LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__);

	return result;
}
コード例 #11
0
void BatteryClientEfl::stopUpdating()
{
    m_timer.stop();
    e_ukit_shutdown();
    e_dbus_shutdown();
}