OSDN Git Service

gobex: Add g_obex_disconnect
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 21 Mar 2014 10:56:08 +0000 (12:56 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 21 Mar 2014 14:13:45 +0000 (16:13 +0200)
This adds g_obex_disconnect function which can be used to send OBEX
Disconnect command.

gobex/gobex.c
gobex/gobex.h

index d7d325b..ca15941 100644 (file)
@@ -1445,6 +1445,18 @@ guint g_obex_connect(GObex *obex, GObexResponseFunc func, gpointer user_data,
        return g_obex_send_req(obex, req, -1, func, user_data, err);
 }
 
+guint g_obex_disconnect(GObex *obex, GObexResponseFunc func, gpointer user_data,
+                                                               GError **err)
+{
+       GObexPacket *req;
+
+       g_obex_debug(G_OBEX_DEBUG_COMMAND, "");
+
+       req = g_obex_packet_new(G_OBEX_OP_DISCONNECT, TRUE, G_OBEX_HDR_INVALID);
+
+       return g_obex_send_req(obex, req, -1, func, user_data, err);
+}
+
 guint g_obex_setpath(GObex *obex, const char *path, GObexResponseFunc func,
                                        gpointer user_data, GError **err)
 {
index 76a224e..7c47590 100644 (file)
@@ -75,6 +75,9 @@ void g_obex_unref(GObex *obex);
 guint g_obex_connect(GObex *obex, GObexResponseFunc func, gpointer user_data,
                                GError **err, guint8 first_hdr_id, ...);
 
+guint g_obex_disconnect(GObex *obex, GObexResponseFunc func, gpointer user_data,
+                                                               GError **err);
+
 guint g_obex_setpath(GObex *obex, const char *path, GObexResponseFunc func,
                                        gpointer user_data, GError **err);