static void ws_dbus_libosso_errors (osso_return_t result);
static void ws_dbus_fill_message (DBusMessage *msg, void *data);
+/**This function will be used in future version of DBUS as soon as introspection
+ * is implemented
+ */
static gchar* ws_dbus_get_ptr2method (GArray *methods, gchar* name)
{
guint i;
temp = g_quark_try_string (method);
if (temp != 0)
{
- //run through all available methods and run the one which was called remotely
+ /*run through all available methods and run the one which was
+ called remotely*/
+
for (i=0; i < dbus_method_data->len; ++i)
{
method_data = g_array_index( dbus_method_data,
};
-/* This function adds words stored in a GArray as arguments to a DBUS message */
+/** This function adds words stored in a GArray as arguments to a DBUS message
+ * \param msg - DBusMessage structure
+ * \param data - GArray of osso_rpc_t containing arguments and its types
+ */
static void ws_dbus_fill_message (DBusMessage *msg, void *data)
{
guint i;
g_debug ("DBUS: Added %d words\n", i);
};
+/**Function will be used in future version of dbus wrapper library, as soon as
+ *introspection is implemented
+ *\param error - a GError error
+ *\param data - a GArray of methods (listed in a string form)
+ *\param user_data - a pointer WSDBusData structure
+*/
void ws_dbus_add_remote_methods (GError *error,
gpointer data,
gpointer user_data)
return;
};
+/** This function is used for allocating memory for the WSDBusData structure and
+ * setting some basic parameters.
+ * \param name - name of the application
+ * \param version - app's version
+ * \return pointer to WSDBusData structure\n
+ * \sa WSDBusData
+ */
WSDBusData * ws_dbus_create (gchar *name, gchar *version)
{
WSDBusData *temp;
return temp;
};
-/* Set destination and source addresses of DBUS communication */
+/** Setting DBUS wrapper configuration.
+ * \param ws_dbus_data - pointer to a structure uniquely identifying
+ * the application for DBus. The possible values of
+ * this parameter are listed here: ::WSDBusConfig
+ * \param field - the name of the variable, this function is supposed to set.
+ * \param value - the value of the variable
+ * \return WS_STATUS_OK - on success \n
+ * WS_STATUS_ERROR - on error
+ * \sa WSDBusConfig
+ */
WSDBusStatus ws_dbus_config (WSDBusData * ws_dbus_data,
WSDBusConfig field,
gchar *value)
return WS_DBUS_STATUS_OK;
};
+/** It should be the called after <B>ws_dbus_create</B> and after setting all
+ * DBUS parameters with the <B>ws_dbus_config</B> function.
+ * The structure it returns is necessary to call every function implemented in
+ * this wrapper library.
+ * \param ws_dbus_data - it's a structure containing the unique paths to objects
+ * and interfaces to be registered in the DBus session daemon
+ * \return WS_STATUS_OK - on success \n
+ * WS_STATUS_ERROR - on error
+ * \sa WSDBusConfig | ws_dbus_create | ws_dbus_config
+ */
WSDBusStatus ws_dbus_connect (WSDBusData * ws_dbus_data)
{
osso_return_t result;
}
};
-/* Free allocated memory */
+/** Before the program exits, all memory allocated by DBUS wrapper should be
+ * freed.
+ * \param ws_dbus_data - pointer to a structure uniquely identifying the
+ * application for DBus
+ * \return \li WS_STATUS_OK - on success \li WS_STATUS_ERROR - on error
+ */
void ws_dbus_destroy (WSDBusData * ws_dbus_data)
{
guint i;
g_free (ws_dbus_data->remote_object);
g_free (ws_dbus_data->remote_iface);
- /** \TODO is this needed still? */
- /* Introspection not implemented yet - IS IT NEEDED?? */
- /*
- * if (ws_dbus_data->remote_method_data != NULL)
+ /* Introspection not implemented yet. This piece of code will be used
+ *in future version.*/
+ /* if (ws_dbus_data->remote_method_data != NULL)
* {
* for (i = 0; i < ws_dbus_data->remote_method_data->len; ++i)
* {
* gchar*, i));
* };
* g_array_free (ws_dbus_data->remote_method_data, TRUE);
- * };*/
+ * };
+ */
g_free (ws_dbus_data);
g_debug ("| Freeing WSDBusData structure |\n----------------------\n");
};
+/** \param ws_dbus_data - pointer to a structure uniquely identifying the
+ * application for D-BUS
+ * \param detailed_signal - string containing the signal name which will trigger
+ * the function passed in the c_func parameter.
+ * \param c_func - is a pointer to the signal handling function.
+ * \param user_data - is the data passed directly to the signal handling
+ * function
+ * \return \li WS_STATUS_OK - on success \li WS_STATUS_ERROR - on error
+ * \sa WSDBusConfig | ws_dbus_cb
+ */
WSDBusStatus ws_dbus_set_cb (WSDBusData * ws_dbus_data,
gchar * method,
gpointer c_func,
return WS_DBUS_STATUS_OK;
};
+/** \param ws_dbus_data - pointer to a structure uniquely identifying the
+ * application for DBus
+ * \param method - method name\n
+ * \param arglist - a comma separated list of method's arguments (actually just
+ * their datatypes) finished with WS_DBUS_TYPE_INVALID
+ * \return \li WS_STATUS_OK - on success \li WS_STATUS_ERROR - on error
+ * \sa WSDBusDataType
+ */
WSDBusStatus ws_dbus_add_method (WSDBusData * ws_dbus_data, gchar *method, ...)
{
WSDBusMethodData *method_data;
return WS_DBUS_STATUS_OK;
};
-/* Converts an array of strings to an array of osso_rpc_t */
+/** Converts an array of strings to an array of osso_rpc_t which is necessary
+ * then sending data via DBUS
+ * \param data_bundle - a preallocated GArray of osso_rpc_t
+ * \param strings - a GArray of strings to be converted
+ * \return
+ */
WSDBusStatus ws_dbus_add_garray (GArray *data_bundle, GArray *strings)
{
osso_rpc_t *temp;
};
};
-/* Calls a specific method on remote object */
+/**Runs a remote method with specific name
+ *
+ * \param ws_dbus_data - pointer to a structure uniquely identifying the
+ * application for DBus
+ * \param method - method name
+ * \param arglist - a comma separated list of pairs: datatype, value finished
+ * with WS_DBUS_TYPE_INVALID
+ * \return \li WS_STATUS_OK - on success \li WS_STATUS_ERROR - on error
+ * \sa WSDBusDataType
+ */
WSDBusStatus ws_dbus_call_method (WSDBusData * ws_dbus_data, gchar *method, ...)
{
va_list arglist;
return WS_DBUS_STATUS_OK;
};
+/**This function will be used in future version of DBUS as soon as introspection
+ * is implemented
+ */
WSDBusStatus ws_dbus_call_registered_method (WSDBusData * ws_dbus_data,
gchar *method, ...)
{