r11 - include src
by abd4lla@fedoraproject.org
Author: abd4lla
Date: 2010-07-31 20:10:59 +0000 (Sat, 31 Jul 2010)
New Revision: 11
Removed:
include/dbus_utils.h
src/dbus_utils.c
Modified:
include/fired.h
include/firedbus.h
include/firedbus_interface.h
src/CMakeLists.txt
src/fired.c
src/firedbus.c
Log:
Proper firedbus implementation
Deleted: include/dbus_utils.h
===================================================================
--- include/dbus_utils.h 2009-12-02 21:23:40 UTC (rev 10)
+++ include/dbus_utils.h 2010-07-31 20:10:59 UTC (rev 11)
@@ -1,28 +0,0 @@
-// Author: Abd4llA "Ahmed Abdalla" <abd4lla(a)fedoraproject.org>
-//
-// 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 Library General Public License for more details.
-//
-// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// Copyright 2009 Abd4llA
-
-/* inclusion guard */
-#ifndef __FIREKIT_DBUS_UTILS__H__
-#define __FIREKIT_DBUS_UTILS__H__
-#include <stdio.h>
-#include <dbus/dbus-glib.h>
-#include <stdlib.h>
-
-gboolean firekit_firedbus_connect(DBusGConnection **connection, GError **error);
-gboolean firekit_firedbus_request_servicename(const char* name, DBusGConnection *connection, GError **error);
-gboolean firekit_firedbus_init(const char *name, const char *path, DBusGConnection **connection, GError **error);
-#endif //__FIREKIT_DBUS_UTILS__H__
Modified: include/fired.h
===================================================================
--- include/fired.h 2009-12-02 21:23:40 UTC (rev 10)
+++ include/fired.h 2010-07-31 20:10:59 UTC (rev 11)
@@ -17,17 +17,7 @@
#ifndef FIRED_H
#define FIRED_H
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <string.h>
#include "firedbus.h"
-#include <dbus/dbus-glib.h>
/*
int32_t fired_init_daemon(void);
Modified: include/firedbus.h
===================================================================
--- include/firedbus.h 2009-12-02 21:23:40 UTC (rev 10)
+++ include/firedbus.h 2010-07-31 20:10:59 UTC (rev 11)
@@ -16,51 +16,56 @@
// Copyright 2009 Abd4llA
/* inclusion guard */
-#ifndef __FIREKIT_FDBUS_H__
-#define __FIREKIT_FDBUS_H__
+#ifndef __FIREKIT_FIREDBUS_H__
+#define __FIREKIT_FIREDBUS_H__
/*
* Header Inclusions
*/
#include <glib-object.h>
-#include <syslog.h>
#include <dbus/dbus-glib.h>
#include <glib.h>
/*
* Type macros.
*/
-#define FIREKIT_TYPE_FDBUS (firekit_firedbus_get_type())
-#define FIREKIT_FDBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FIREKIT_TYPE_FDBUS, FirekitFDBus))
-#define FIREKIT_IS_FDBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FIREKIT_TYPE_FDBUS))
-#define FIREKIT_FDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FIREKIT_TYPE_FDBUS, FirekitFDBusClass))
-#define FIREKIT_IS_FDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FIREKIT_TYPE_FDBUS))
-#define FIREKIT_FDBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FIREKIT_TYPE_FDBUS, FirekitFDBusClass))
+#define FIREKIT_TYPE_FIREDBUS (firekit_firedbus_get_type())
+#define FIREKIT_FIREDBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, FIREKIT_TYPE_FIREDBUS, FirekitFireDBus))
+#define FIREKIT_IS_FIREDBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, FIREKIT_TYPE_FIREDBUS))
+#define FIREKIT_FIREDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, FIREKIT_TYPE_FIREDBUS, FirekitFireDBusClass))
+#define FIREKIT_IS_FIREDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE (klass, FIREKIT_TYPE_FIREDBUS))
+#define FIREKIT_FIREDBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS (obj, FIREKIT_TYPE_FIREDBUS, FirekitFireDBusClass))
-typedef struct _FirekitFDBus FirekitFDBus;
-typedef struct _FirekitFDBusClass FirekitFDBusClass;
+typedef struct _FirekitFireDBus FirekitFireDBus;
+typedef struct _FirekitFireDBusClass FirekitFireDBusClass;
-struct _FirekitFDBus
-{
- GObject parent_instance;
+struct _FirekitFireDBus{
+ GObject parent_instance;
- /* instance members */
+ /* instance members */
+ char *expose_path;
+ char *name;
+ DBusGConnection *connection;
};
-struct _FirekitFDBusClass
-{
+struct _FirekitFireDBusClass{
GObjectClass parent_class;
/* class members */
};
-//GType firekit_firedbus_get_type (void);
+enum {
+ PROP_O,
+ PROP_EXPOSE_PATH,
+ PROP_NAME
+};
/*
* Method definitions.
*/
-gboolean firekit_firedbus_apply_profile (FirekitFDBus *self, DBUS_TYPE_G_INT_ARRAY ports, gboolean ret, GError **err);
+gboolean firekit_firedbus_apply_profile(FirekitFireDBus *self, const char **ports, const gint ports_n, gboolean **ret, GError **err);
+gboolean firekit_firedbus_run(FirekitFireDBus *self, const char *name, const char *path, GError **error);
-#endif /* __FIREKIT_FDBUS_H__ */
+#endif /* __FIREKIT_FIREDBUS_H__ */
Modified: include/firedbus_interface.h
===================================================================
--- include/firedbus_interface.h 2009-12-02 21:23:40 UTC (rev 10)
+++ include/firedbus_interface.h 2010-07-31 20:10:59 UTC (rev 11)
@@ -53,31 +53,34 @@
#endif /* !G_ENABLE_DEBUG */
-/* BOOLEAN:POINTER (/tmp/dbus-binding-tool-c-marshallers.DRAXXU:1) */
-extern void dbus_glib_marshal_firekit_firedbus_BOOLEAN__POINTER (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+/* BOOLEAN:BOXED,INT,POINTER,POINTER */
+extern void dbus_glib_marshal_firekit_firedbus_BOOLEAN__BOXED_INT_POINTER_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
void
-dbus_glib_marshal_firekit_firedbus_BOOLEAN__POINTER (GClosure *closure,
- GValue *return_value G_GNUC_UNUSED,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint G_GNUC_UNUSED,
- gpointer marshal_data)
+dbus_glib_marshal_firekit_firedbus_BOOLEAN__BOXED_INT_POINTER_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
{
- typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER) (gpointer data1,
- gpointer arg_1,
- gpointer data2);
- register GMarshalFunc_BOOLEAN__POINTER callback;
+ typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_INT_POINTER_POINTER) (gpointer data1,
+ gpointer arg_1,
+ gint arg_2,
+ gpointer arg_3,
+ gpointer arg_4,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__BOXED_INT_POINTER_POINTER callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
gboolean v_return;
g_return_if_fail (return_value != NULL);
- g_return_if_fail (n_param_values == 2);
+ g_return_if_fail (n_param_values == 5);
if (G_CCLOSURE_SWAP_DATA (closure))
{
@@ -89,10 +92,13 @@
data1 = g_value_peek_pointer (param_values + 0);
data2 = closure->data;
}
- callback = (GMarshalFunc_BOOLEAN__POINTER) (marshal_data ? marshal_data : cc->callback);
+ callback = (GMarshalFunc_BOOLEAN__BOXED_INT_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_pointer (param_values + 1),
+ g_marshal_value_peek_boxed (param_values + 1),
+ g_marshal_value_peek_int (param_values + 2),
+ g_marshal_value_peek_pointer (param_values + 3),
+ g_marshal_value_peek_pointer (param_values + 4),
data2);
g_value_set_boolean (return_value, v_return);
@@ -104,14 +110,14 @@
#include <dbus/dbus-glib.h>
static const DBusGMethodInfo dbus_glib_firekit_firedbus_methods[] = {
- { (GCallback) firekit_firedbus_open_port, dbus_glib_marshal_firekit_firedbus_BOOLEAN__POINTER, 0 },
+ { (GCallback) firekit_firedbus_apply_profile, dbus_glib_marshal_firekit_firedbus_BOOLEAN__BOXED_INT_POINTER_POINTER, 0 },
};
const DBusGObjectInfo dbus_glib_firekit_firedbus_object_info = {
0,
dbus_glib_firekit_firedbus_methods,
1,
-"org.fedorahosted.firekit\0OpenPort\0S\0\0\0",
+"org.freedesktop.FireKit\0ApplyProfile\0S\0ports\0I\0as\0ports_n\0I\0i\0ret\0O\0F\0N\0b\0\0\0",
"\0",
"\0"
};
Modified: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt 2009-12-02 21:23:40 UTC (rev 10)
+++ src/CMakeLists.txt 2010-07-31 20:10:59 UTC (rev 11)
@@ -1,6 +1,6 @@
include_directories( ${GObject2_INCLUDE_DIRS} ${GLib2_INCLUDE_DIRS} ${DBus-GLib1_INCLUDE_DIRS} )
set (LIBS ${LIBS} ${GObject2_LIBRARIES} ${GLib2_LIBRARIES} ${DBus-GLib1_LIBRARIES} )
-set (SRCS ${SRCS} fired dbus_utils firedbus)
+set (SRCS ${SRCS} fired firedbus)
ADD_EXECUTABLE(fired ${SRCS})
target_link_libraries(fired ${LIBS})
-ADD_LIBRARY(fkiptc fkiptc)
+#ADD_LIBRARY(fkiptc fkiptc)
Deleted: src/dbus_utils.c
===================================================================
--- src/dbus_utils.c 2009-12-02 21:23:40 UTC (rev 10)
+++ src/dbus_utils.c 2010-07-31 20:10:59 UTC (rev 11)
@@ -1,106 +0,0 @@
-// Author: Abd4llA "Ahmed Abdalla" <abd4lla(a)fedoraproject.org>
-//
-// 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 Library General Public License for more details.
-//
-// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// Copyright 2009 Abd4llA
-
-#include "dbus_utils.h"
-#include "firedbus.h"
-
-/* Get the dbus connection object with the system bus
- * @param DBusGConnection *connection: the pointer where we'll assign our connection
- * @param GError *error: In case of error, we'll set our error here
- * @return: TRUE on success, otherwise FALSE
- */
-gboolean firekit_firedbus_connect(DBusGConnection **connection, GError **error){
- syslog( LOG_DAEMON | LOG_INFO, "Getting connection to system bus\n");
- *connection = dbus_g_bus_get(DBUS_BUS_SESSION, error);
- if (connection == NULL){
- return FALSE;
- }
- return TRUE;
-}
-/* Register firekit service name with the dbus daemon
- * @param const char *name: Service name to register
- * @param DBusGConnection *connection: The dbus connection
- * @param GError *error: In case of error, we'll set out error here
- * @retur: TRUE on success, otherwise FALSE
- */
-gboolean firekit_firedbus_request_servicename(const char *name, DBusGConnection *connection, GError **error){
- syslog(LOG_DAEMON | LOG_INFO, "Requesting service name %s from dbus service \n", name);
- if (connection == NULL){
- //TODO: set error
- return FALSE;
- }
- DBusGProxy *bus = NULL;
- guint result;
- syslog(LOG_DAEMON | LOG_INFO, "Getting proxy of dbus service\n");
- bus = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
- if (bus == NULL){
- //TODO: set error
- syslog(LOG_DAEMON | LOG_INFO, "Failed to get proxy of dbus service.\n");
- return FALSE;
- }
- syslog(LOG_DAEMON | LOG_INFO,"Calling RequestName of dbus service\n");
- if (!dbus_g_proxy_call(bus, "RequestName", error, G_TYPE_STRING, name, G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE, G_TYPE_INVALID,
- G_TYPE_UINT, &result, G_TYPE_INVALID)){
- syslog(LOG_DAEMON | LOG_INFO, "Proxy call failed due to: %s\n",(*error)->message);
- return FALSE;
- }
- syslog(LOG_DAEMON | LOG_INFO, "RequestName returned %d \n", result);
- if (result != 1) {
- syslog(LOG_DAEMON | LOG_INFO, "Failed to get name %s: %s\n", name, (*error)->message);
- return FALSE;
- }
- return TRUE;
-}
-
-/* Initialization method for our dbus interface, it does the following
- * 1- Gets a connection to dbus
- * 2- Requests our service name
- * 3- Creates a new gobject that'll be exposed
- * 4- Registers that object in the dbus
- * Register GObject to the dbus service
- * @param const char *name: Service name "eg: org.fedorahosted.firekit
- * @param const char *path: Object path "eg: /org/fedorahosted/firekit/Daemon"
- * @param DBusGConnection *connection: The dbus connection which we'll create and fill
- * @param GError *error: In case of error, we'll set out error here
- * @retur: TRUE on success, otherwise FALSE
- */
-gboolean firekit_firedbus_init(const char *name, const char *path, DBusGConnection **connection, GError **error){
-
- *error =NULL;
- *connection = NULL;
- //Connect to dbus
- if (!firekit_firedbus_connect(connection, error)){
- syslog( LOG_DAEMON | LOG_INFO, "Failed to connect to dbus system bus due to %s\n", (*error)->message);
- return FALSE;
- }
- //Request service name
- if (!firekit_firedbus_request_servicename(name, *connection, error)){
- syslog( LOG_DAEMON | LOG_INFO, "Failed to request service name %s error message %s \n", name, (*error)->message);
- return FALSE;
- }
- //Create GObject
- GObject * fdbus_obj = g_object_new(FIREKIT_TYPE_FDBUS, NULL);
- if (fdbus_obj == NULL){
- syslog( LOG_DAEMON | LOG_INFO, "Failed to request service name %s error message %s \n", name, (*error)->message);
- return FALSE;
- }
-
- syslog( LOG_DAEMON | LOG_INFO, "Registering GObject at path %s \n", path);
- dbus_g_connection_register_g_object (*connection, path, fdbus_obj);
- return TRUE;
-}
-
Modified: src/fired.c
===================================================================
--- src/fired.c 2009-12-02 21:23:40 UTC (rev 10)
+++ src/fired.c 2010-07-31 20:10:59 UTC (rev 11)
@@ -14,12 +14,22 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Copyright 2009 Abd4llA
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <string.h>
#include "fired.h"
-#include "dbus_utils.h"
-#define FIREKIT_SERVICE_NAME "org.fedorahosted.firekit"
-#define FIREKIT_OBJECT_PATH "/org/fedorahosted/firekit"
-int main(void) {
+#define FIREKIT_SERVICE_NAME "org.freedesktop.FireKit"
+#define FIREKIT_SERVICE_PATH "/org/freedesktop/FireKit"
+
+int main(int argc, char * argv) {
g_type_init();
//
// /* Our process ID and Session ID */
@@ -76,19 +86,15 @@
//
// /* Register ourselves to dbus daemon */
//// firekit_initdbus();
- DBusGConnection *connection;
GError *error;
GMainLoop * loop;
+
loop = g_main_loop_new(NULL,FALSE);
error = NULL;
syslog(LOG_DAEMON | LOG_INFO, "Initializing firedbus\n");
- if (! firekit_firedbus_init(FIREKIT_SERVICE_NAME, FIREKIT_OBJECT_PATH, &connection, &error)){
- syslog(LOG_DAEMON | LOG_INFO, "Failed to initialize firedbus: %s\n", error->message);
- exit(EXIT_FAILURE);
- }
-
+ FirekitFireDBus *firdbus = g_object_new(FIREKIT_TYPE_FIREDBUS, "expose-path", FIREKIT_SERVICE_PATH,"name", FIREKIT_SERVICE_NAME, NULL);
/*
driver_proxy = dbus_g_proxy_new_for_name (connection,
DBUS_SERVICE_DBUS,
Modified: src/firedbus.c
===================================================================
--- src/firedbus.c 2009-12-02 21:23:40 UTC (rev 10)
+++ src/firedbus.c 2010-07-31 20:10:59 UTC (rev 11)
@@ -15,23 +15,129 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Copyright 2009 Abd4llA
+#include <stdio.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <dbus/dbus-glib-bindings.h>
#include "firedbus.h"
#include "firedbus_interface.h"
-#include <stdio.h>
-G_DEFINE_TYPE(FirekitFDBus, firekit_firedbus, G_TYPE_OBJECT);
+G_DEFINE_TYPE(FirekitFireDBus, firekit_firedbus, G_TYPE_OBJECT);
-static void firekit_firedbus_class_init (FirekitFDBusClass *self) {
+static void firekit_firedbus_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *p_spec){
+ FirekitFireDBus *self = FIREKIT_FIREDBUS(object);
+
+ switch(property_id){
+ case PROP_EXPOSE_PATH:
+ self->expose_path = g_value_dup_string(value);
+ break;
+ case PROP_NAME:
+ self->name = g_value_dup_string(value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, p_spec);
+ }
+}
+
+static void firekit_firedbus_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *p_spec){
+ FirekitFireDBus *self = FIREKIT_FIREDBUS(object);
+
+ switch(property_id){
+ case PROP_EXPOSE_PATH:
+ g_value_set_string(value, self->expose_path);
+ break;
+ case PROP_NAME:
+ g_value_set_string(value, self->name);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, p_spec);
+
+ }
+}
+
+static GObject * firekit_firedbus_constructor(GType gtype, guint n_properties, GObjectConstructParam *properties){
+ GObject * object;
+ GObjectClass * parent_class = G_OBJECT_CLASS(firekit_firedbus_parent_class);
+ object = parent_class->constructor(gtype, n_properties, properties);
+ FirekitFireDBus *self = FIREKIT_FIREDBUS(object);
+ GError * error = NULL;
+ DBusGProxy *bus = NULL;
+ guint result;
+
+ syslog( LOG_DAEMON | LOG_INFO, "Getting connection to system bus\n");
+ DBusGConnection *connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+ if (connection == NULL){
+ //TODO Error handling
+ printf("Couldn't get connection\n");
+ exit(EXIT_FAILURE);
+ }
+
+ syslog(LOG_DAEMON | LOG_INFO, "Getting proxy of dbus service\n");
+ bus = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
+ if (bus == NULL){
+ //TODO Error handling
+ printf("Couldn't get bus\n");
+ exit(EXIT_FAILURE);
+ }
+
+ syslog(LOG_DAEMON | LOG_INFO, "Requesting service name %s from dbus service \n", self->name);
+ org_freedesktop_DBus_request_name(bus, self->name, DBUS_NAME_FLAG_DO_NOT_QUEUE, &result, &error);
+
+ if (result != 1) {
+ //TODO Error handling
+ syslog(LOG_DAEMON | LOG_INFO, "Failed to get name %s: %s\n", self->name, error->message);
+ exit(EXIT_FAILURE);
+ }
+
+ syslog( LOG_DAEMON | LOG_INFO, "Registering GObject at path %s \n", self->expose_path);
+ dbus_g_connection_register_g_object (connection, self->expose_path, G_OBJECT(self));
+ return object;
+}
+
+static void firekit_firedbus_class_init (FirekitFireDBusClass *firedbus_class) {
/* Install g_object info which is defined in firedbus_interface.h */
- dbus_g_object_type_install_info ( FIREKIT_TYPE_FDBUS, & dbus_glib_firekit_firedbus_object_info);
+ GObjectClass *parent_class = G_OBJECT_CLASS(firedbus_class);
+
+ GParamSpec *p_spec;
+
+ parent_class->constructor = firekit_firedbus_constructor;
+ parent_class->set_property = firekit_firedbus_set_property;
+ parent_class->get_property = firekit_firedbus_get_property;
+
+ p_spec = g_param_spec_string("expose-path",
+ "Expose Path",
+ "DBus path to expose object at",
+ "/org/freedesktop/FireKit",
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property(parent_class, PROP_EXPOSE_PATH, p_spec);
+
+ p_spec = g_param_spec_string("name",
+ "Name",
+ "Expose object name",
+ "org.freedesktop.FireKit",
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property(parent_class, PROP_NAME, p_spec);
+
+ dbus_g_object_type_install_info ( FIREKIT_TYPE_FIREDBUS, & dbus_glib_firekit_firedbus_object_info);
}
-static void firekit_firedbus_init(FirekitFDBus *self){
-
+static void firekit_firedbus_init(FirekitFireDBus *self){
+
}
-gboolean firekit_firedbus_open_port (FirekitFDBus *self, GError **err) {
- printf("Calling syslog\n");
- syslog( LOG_DAEMON | LOG_INFO, "firekit_firedbus_open_port called \n");
- return TRUE;
+
+//gboolean firekit_firedbus_open_port (FirekitFireDBus *self, GError **error) {
+// printf("Calling syslog\n");
+// syslog( LOG_DAEMON | LOG_INFO, "firekit_firedbus_open_port called \n");
+// return TRUE;
+//}
+//gboolean firekit_firedbus_apply_profile(FirekitFireDBus *self, const GArray **ports, gboolean **ret, GError **error){
+gboolean firekit_firedbus_apply_profile(FirekitFireDBus *self, const char **ports, const gint ports_n, gboolean **ret, GError **error){
+ syslog( LOG_DAEMON | LOG_DEBUG, "FirekitFireDBus::ApplyProfile\n");
+ int i = 0;
+ for(i ; i < ports_n; i++){
+ printf("Element %d is : %s\n", i, ports[i]);
+ }
+ *ret = TRUE;
+ return TRUE;
}
13 years, 9 months