Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] gobex: Add g_obex_disconnect
@ 2014-03-21 11:58 Luiz Augusto von Dentz
  2014-03-21 11:58 ` [PATCH BlueZ 2/3] unit/test-gobex: Add test for g_obex_disconnect Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2014-03-21 11:58 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds g_obex_disconnect function which can be used to send OBEX
Disconnect command.
---
 gobex/gobex.c | 12 ++++++++++++
 gobex/gobex.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/gobex/gobex.c b/gobex/gobex.c
index d7d325b..ca15941 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -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)
 {
diff --git a/gobex/gobex.h b/gobex/gobex.h
index 76a224e..7c47590 100644
--- a/gobex/gobex.h
+++ b/gobex/gobex.h
@@ -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);
 
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-21 14:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-21 11:58 [PATCH BlueZ 1/3] gobex: Add g_obex_disconnect Luiz Augusto von Dentz
2014-03-21 11:58 ` [PATCH BlueZ 2/3] unit/test-gobex: Add test for g_obex_disconnect Luiz Augusto von Dentz
2014-03-21 11:58 ` [PATCH BlueZ 3/3] obexd/client: Fix not sending OBEX Disconnect when disconnecting Luiz Augusto von Dentz
2014-03-21 14:15 ` [PATCH BlueZ 1/3] gobex: Add g_obex_disconnect Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox