#include "e.h"
#include "e_mod_main.h"
-static void _battery_udev_event_battery(const char *syspath, const char *event, void *data, Eeze_Udev_Watch *watch);
-static void _battery_udev_event_ac(const char *syspath, const char *event, void *data, Eeze_Udev_Watch *watch);
+static void _battery_udev_event_battery(const char *syspath, int event, void *data, Eeze_Udev_Watch *watch);
+static void _battery_udev_event_ac(const char *syspath, int event, void *data, Eeze_Udev_Watch *watch);
static void _battery_udev_battery_add(const char *syspath);
static void _battery_udev_ac_add(const char *syspath);
static void _battery_udev_battery_del(const char *syspath);
static void
-_battery_udev_event_battery(const char *syspath, const char *event, void *data, Eeze_Udev_Watch *watch)
+_battery_udev_event_battery(const char *syspath, int event, void *data, Eeze_Udev_Watch *watch)
{
- if ((!strcmp(event, "add")) || (!strcmp(event, "online")))
+ if (((event & EEZE_UDEV_EVENT_ADD) == EEZE_UDEV_EVENT_ADD) ||
+ ((event & EEZE_UDEV_EVENT_ONLINE) == EEZE_UDEV_EVENT_ONLINE))
_battery_udev_battery_add(syspath);
- else if ((!strcmp(event, "remove")) || (!strcmp(event, "offline")))
+ if (((event & EEZE_UDEV_EVENT_REMOVE) == EEZE_UDEV_EVENT_REMOVE) ||
+ ((event & EEZE_UDEV_EVENT_OFFLINE) == EEZE_UDEV_EVENT_OFFLINE))
_battery_udev_battery_del(syspath);
else /* must be change */
_battery_udev_battery_update(syspath, data);
}
static void
-_battery_udev_event_ac(const char *syspath, const char *event, void *data, Eeze_Udev_Watch *watch)
+_battery_udev_event_ac(const char *syspath, int event, void *data, Eeze_Udev_Watch *watch)
{
- if ((!strcmp(event, "add")) || (!strcmp(event, "online")))
+ if (((event & EEZE_UDEV_EVENT_ADD) == EEZE_UDEV_EVENT_ADD) ||
+ ((event & EEZE_UDEV_EVENT_ONLINE) == EEZE_UDEV_EVENT_ONLINE))
_battery_udev_ac_add(syspath);
- else if ((!strcmp(event, "remove")) || (!strcmp(event, "offline")))
+ if (((event & EEZE_UDEV_EVENT_REMOVE) == EEZE_UDEV_EVENT_REMOVE) ||
+ ((event & EEZE_UDEV_EVENT_OFFLINE) == EEZE_UDEV_EVENT_OFFLINE))
_battery_udev_ac_del(syspath);
else /* must be change */
_battery_udev_ac_update(syspath, data);
inst->sensor_name = NULL;
inst->units = CELCIUS;
#ifdef HAVE_EEZE_UDEV
- inst->backend = TEMPGET;
+ inst->backend = UDEV;
#endif
if (!temperature_config->faces)
temperature_config->faces = eina_hash_string_superfast_new(NULL);
}
else
{
+ eeze_udev_init();
inst->temp_poller = ecore_poller_add(ECORE_POLLER_CORE, inst->poll_interval, temperature_udev_update_poll, inst);
temperature_udev_update(inst);
}
#ifdef HAVE_EEEZ_UDEV
if (inst->temp_poller)
ecore_poller_del(inst->temp_poller);
+ eeze_udev_shutdown();
#endif
if (inst->o_temp) evas_object_del(inst->o_temp);
inst->o_temp = NULL;