forked from enlightenment/efl
+EEZE_UDEV_TYPE_NET, thanks to Clement Battin
SVN revision: 57708
This commit is contained in:
parent
c8874ff8bd
commit
6e1be20e6c
|
@ -1,3 +1,6 @@
|
|||
2011-03-12 Mike Blumenkrantz (discomfitor/zmike)
|
||||
+EEZE_UDEV_TYPE_NET, added from patch sent by Clement Battin
|
||||
|
||||
2011-03-03 Mike Blumenkrantz (discomfitor/zmike)
|
||||
fix bug with watches involving filtering being too aggressive for removed/offlined devices
|
||||
|
||||
|
|
|
@ -160,6 +160,20 @@ main()
|
|||
eina_stringshare_del(name);
|
||||
}
|
||||
|
||||
printf("\nNetwork devices!\n");
|
||||
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_NET, NULL);
|
||||
type = eeze_udev_find_unlisted_similar(type);
|
||||
EINA_LIST_FREE(type, name)
|
||||
{
|
||||
printf("Found device: %s\n", name); /* get a property using the device's syspath */
|
||||
if ((check = eeze_udev_syspath_get_property(name, "INTERFACE")))
|
||||
{
|
||||
printf("\tYou probably know it better as %s\n", check);
|
||||
eina_stringshare_del(check);
|
||||
}
|
||||
eina_stringshare_del(name);
|
||||
}
|
||||
|
||||
printf("\nInternal drives, anyone? With serial numbers?\n");
|
||||
/* find all internal drives using type EEZE_UDEV_TYPE_DRIVE_INTERNAL */
|
||||
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
|
||||
|
|
|
@ -164,7 +164,9 @@ typedef enum
|
|||
/** - Battery */
|
||||
EEZE_UDEV_TYPE_POWER_BAT,
|
||||
/** - Temperature sensor */
|
||||
EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR
|
||||
EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR,
|
||||
/** - Network devices */
|
||||
EEZE_UDEV_TYPE_NET
|
||||
} Eeze_Udev_Type;
|
||||
/**@}*/
|
||||
|
||||
|
|
|
@ -249,6 +249,10 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype,
|
|||
udev_enumerate_add_match_sysattr(en, "type", "Battery");
|
||||
break;
|
||||
|
||||
case EEZE_UDEV_TYPE_NET:
|
||||
udev_enumerate_add_match_subsystem(en, "net");
|
||||
break;
|
||||
|
||||
case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
|
||||
udev_enumerate_add_match_subsystem(en, "hwmon");
|
||||
break;
|
||||
|
|
|
@ -265,6 +265,14 @@ _get_syspath_from_watch(void *data,
|
|||
goto error;
|
||||
break;
|
||||
|
||||
case EEZE_UDEV_TYPE_NET:
|
||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||
if ((!(test = udev_device_get_subsystem(device)))
|
||||
|| (strcmp(test, "net")))
|
||||
goto error;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
|
||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||
if ((!(test = udev_device_get_subsystem(device)))
|
||||
|
@ -376,6 +384,10 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
|
|||
NULL);
|
||||
break;
|
||||
|
||||
case EEZE_UDEV_TYPE_NET:
|
||||
udev_monitor_filter_add_match_subsystem_devtype(mon, "net", NULL);
|
||||
break;
|
||||
|
||||
case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
|
||||
udev_monitor_filter_add_match_subsystem_devtype(mon, "hwmon", NULL);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue