All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH obexd 1/3] gobex: add defines for possible values of SRM header
@ 2011-12-17 10:17 Luiz Augusto von Dentz
  2011-12-17 10:17 ` [PATCH obexd 2/3] gobex: add defines for possible values of SRMP header Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-12-17 10:17 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 gobex/gobex-header.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gobex/gobex-header.h b/gobex/gobex-header.h
index 2420e75..3320cfa 100644
--- a/gobex/gobex-header.h
+++ b/gobex/gobex-header.h
@@ -60,6 +60,11 @@
 #define G_OBEX_ACTION_MOVE		0x01
 #define G_OBEX_ACTION_SETPERM		0x02
 
+/* SRM header values */
+#define G_OBEX_SRM_DISABLE		0x00
+#define G_OBEX_SRM_ENABLE		0x01
+#define G_OBEX_SRM_INDICATE		0x02
+
 typedef struct _GObexHeader GObexHeader;
 
 gboolean g_obex_header_get_unicode(GObexHeader *header, const char **str);
-- 
1.7.7.4


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

* [PATCH obexd 2/3] gobex: add defines for possible values of SRMP header
  2011-12-17 10:17 [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Luiz Augusto von Dentz
@ 2011-12-17 10:17 ` Luiz Augusto von Dentz
  2011-12-17 10:17 ` [PATCH obexd 3/3] gobex: reduce duplicated code in g_obex_put_req Luiz Augusto von Dentz
  2011-12-21 10:09 ` [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-12-17 10:17 UTC (permalink / raw)
  To: linux-bluetooth

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

Also rename G_OBEX_HDR_SRM_PARAMETERS to just G_OBEX_HDR_SRMP as the spec
normally refer to it.
---
 gobex/gobex-header.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gobex/gobex-header.h b/gobex/gobex-header.h
index 3320cfa..2ee8364 100644
--- a/gobex/gobex-header.h
+++ b/gobex/gobex-header.h
@@ -53,7 +53,7 @@
 #define G_OBEX_HDR_DESTNAME		0x15
 #define G_OBEX_HDR_PERMISSIONS		0xd6
 #define G_OBEX_HDR_SRM			0x97
-#define G_OBEX_HDR_SRM_PARAMETERS	0x98
+#define G_OBEX_HDR_SRMP			0x98
 
 /* Action header values */
 #define G_OBEX_ACTION_COPY		0x00
@@ -65,6 +65,11 @@
 #define G_OBEX_SRM_ENABLE		0x01
 #define G_OBEX_SRM_INDICATE		0x02
 
+/* SRMP header values */
+#define G_OBEX_SRMP_NEXT		0x00
+#define G_OBEX_SRMP_WAIT		0x01
+#define G_OBEX_SRMP_NEXT_WAIT		0x02
+
 typedef struct _GObexHeader GObexHeader;
 
 gboolean g_obex_header_get_unicode(GObexHeader *header, const char **str);
-- 
1.7.7.4


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

* [PATCH obexd 3/3] gobex: reduce duplicated code in g_obex_put_req
  2011-12-17 10:17 [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Luiz Augusto von Dentz
  2011-12-17 10:17 ` [PATCH obexd 2/3] gobex: add defines for possible values of SRMP header Luiz Augusto von Dentz
@ 2011-12-17 10:17 ` Luiz Augusto von Dentz
  2011-12-21 10:09 ` [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-12-17 10:17 UTC (permalink / raw)
  To: linux-bluetooth

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

g_obex_put_req is quite similar to g_obex_put_req_pkt so now it just
call it to avoid duplicating this code.
---
 gobex/gobex-transfer.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/gobex/gobex-transfer.c b/gobex/gobex-transfer.c
index 692d713..0a7a29f 100644
--- a/gobex/gobex-transfer.c
+++ b/gobex/gobex-transfer.c
@@ -277,32 +277,18 @@ guint g_obex_put_req(GObex *obex, GObexDataProducer data_func,
 			GObexFunc complete_func, gpointer user_data,
 			GError **err, guint8 first_hdr_id, ...)
 {
-	struct transfer *transfer;
 	GObexPacket *req;
 	va_list args;
 
 	g_obex_debug(G_OBEX_DEBUG_TRANSFER, "obex %p", obex);
 
-	transfer = transfer_new(obex, G_OBEX_OP_PUT, complete_func, user_data);
-	transfer->data_producer = data_func;
-
 	va_start(args, first_hdr_id);
 	req = g_obex_packet_new_valist(G_OBEX_OP_PUT, FALSE,
 							first_hdr_id, args);
 	va_end(args);
 
-	g_obex_packet_add_body(req, put_get_data, transfer);
-
-	transfer->req_id = g_obex_send_req(obex, req, FIRST_PACKET_TIMEOUT,
-					transfer_response, transfer, err);
-	if (transfer->req_id == 0) {
-		transfer_free(transfer);
-		return 0;
-	}
-
-	g_obex_debug(G_OBEX_DEBUG_TRANSFER, "transfer %u", transfer->id);
-
-	return transfer->id;
+	return g_obex_put_req_pkt(obex, req, data_func, complete_func,
+							user_data, err);
 }
 
 static void transfer_abort_req(GObex *obex, GObexPacket *req, gpointer user_data)
-- 
1.7.7.4


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

* Re: [PATCH obexd 1/3] gobex: add defines for possible values of SRM header
  2011-12-17 10:17 [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Luiz Augusto von Dentz
  2011-12-17 10:17 ` [PATCH obexd 2/3] gobex: add defines for possible values of SRMP header Luiz Augusto von Dentz
  2011-12-17 10:17 ` [PATCH obexd 3/3] gobex: reduce duplicated code in g_obex_put_req Luiz Augusto von Dentz
@ 2011-12-21 10:09 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-12-21 10:09 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Sat, Dec 17, 2011, Luiz Augusto von Dentz wrote:
> ---
>  gobex/gobex-header.h |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

All three patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2011-12-21 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-17 10:17 [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Luiz Augusto von Dentz
2011-12-17 10:17 ` [PATCH obexd 2/3] gobex: add defines for possible values of SRMP header Luiz Augusto von Dentz
2011-12-17 10:17 ` [PATCH obexd 3/3] gobex: reduce duplicated code in g_obex_put_req Luiz Augusto von Dentz
2011-12-21 10:09 ` [PATCH obexd 1/3] gobex: add defines for possible values of SRM header Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.