summaryrefslogtreecommitdiffstats
path: root/src/sysinfolibsysfs.cpp
diff options
context:
space:
mode:
authorNiklas Goby2011-03-23 17:54:26 +0100
committerNiklas Goby2011-03-23 17:54:26 +0100
commit58e234ffcded954047436365667ad91a54a61847 (patch)
tree2f4371e4f48ac39fad9a75bacf14e184ddf7db54 /src/sysinfolibsysfs.cpp
parentloadURL() called when trigger file found (diff)
downloadfbgui-58e234ffcded954047436365667ad91a54a61847.tar.gz
fbgui-58e234ffcded954047436365667ad91a54a61847.tar.xz
fbgui-58e234ffcded954047436365667ad91a54a61847.zip
a new classes sysinfolibsysfs
it uses the libsysfs.c to gater informations about the system not finished yet
Diffstat (limited to 'src/sysinfolibsysfs.cpp')
-rw-r--r--src/sysinfolibsysfs.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/sysinfolibsysfs.cpp b/src/sysinfolibsysfs.cpp
new file mode 100644
index 0000000..feacd30
--- /dev/null
+++ b/src/sysinfolibsysfs.cpp
@@ -0,0 +1,52 @@
+/*
+ * sysinfolibsysfs.cpp
+ *
+ * Created on: Mar 23, 2011
+ * Author: niklas
+ */
+
+#include "sysinfolibsysfs.h"
+
+SysInfoLibsysfs::SysInfoLibsysfs() {
+ // TODO Auto-generated constructor stub
+
+}
+
+SysInfoLibsysfs::~SysInfoLibsysfs() {
+ // TODO Auto-generated destructor stub
+}
+
+void SysInfoLibsysfs::getInfoAboutNetworkInterface()
+{
+ struct sysfs_class_device *class_device = sysfs_open_class_device("net","eth0");
+ struct dlist *attrlist = sysfs_get_classdev_attributes(class_device);
+ struct sysfs_device *device = sysfs_get_classdev_device(class_device);
+ //struct sysfs_driver *driver = sysfs_get_classdev_driver(class_device);
+ if(device == NULL) {
+ qDebug() << "device is NULL!";
+ }
+ else {
+ qDebug() << "--- print eth0 device path:";
+ qDebug() << QString(device->path);
+ }
+
+ sysfs_close_class_device(class_device);
+}
+
+void SysInfoLibsysfs::getInfoAboutClassNet()
+{
+ struct sysfs_class *sysfsclass = sysfs_open_class("net");
+ struct dlist *devices = sysfs_get_class_devices(sysfsclass);
+ struct sysfs_device *dev = NULL;
+ dlist_for_each_data(devices,dev, struct sysfs_device) {
+ if(dev == NULL) {
+ qDebug() << "device is NULL!";
+ }
+ else {
+ qDebug() << "--- print device:";
+ qDebug() << QString(dev->name);
+ }
+ }
+
+ sysfs_close_class(sysfsclass);
+}