summaryrefslogtreecommitdiffstats
path: root/src/device.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-01-20 03:03:34 +0100
committerGravatar Martin Szulecki2010-01-20 10:42:22 +0100
commit40b776a2638b7e9d422724bd76c0b6a0622bc734 (patch)
tree461b62b2a6da9596dfd211d5bc7ec37b86b2bbbc /src/device.h
parent2fcf6e74ca814ea9f2214a5816692b3df011b3ea (diff)
downloadsbmanager-40b776a2638b7e9d422724bd76c0b6a0622bc734.tar.gz
sbmanager-40b776a2638b7e9d422724bd76c0b6a0622bc734.tar.bz2
Separate out device handling code
Diffstat (limited to 'src/device.h')
-rw-r--r--src/device.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h
new file mode 100644
index 0000000..6afaa84
--- /dev/null
+++ b/src/device.h
@@ -0,0 +1,49 @@
+/**
+ * device.h
+ * Device communication functions (header file)
+ *
+ * Copyright (C) 2009-2010 Nikias Bassen <nikias@gmx.li>
+ * Copyright (C) 2009-2010 Martin Szulecki <opensuse@sukimashita.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more profile.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ */
+#ifndef DEVICE_H
+#define DEVICE_H
+#include <glib.h>
+#include <libiphone/sbservices.h>
+
+struct device_info_int {
+ char *device_name;
+ char *device_type;
+ guint battery_capacity;
+ guint battery_poll_interval;
+};
+typedef struct device_info_int *device_info_t;
+
+void device_init();
+sbservices_client_t device_sbs_new(const char *uuid, GError **error);
+void device_sbs_free(sbservices_client_t sbc);
+gboolean device_sbs_get_iconstate(sbservices_client_t sbc, plist_t *iconstate, GError **error);
+gboolean device_sbs_save_icon(sbservices_client_t sbc, char *display_identifier, char *filename, GError **error);
+gboolean device_sbs_set_iconstate(sbservices_client_t sbc, plist_t iconstate, GError **error);
+
+device_info_t device_info_new();
+void device_info_free(device_info_t device_info);
+gboolean device_get_info(const char *uuid, device_info_t *device_info, GError **error);
+
+#endif