Diff between 73fa3610f7c4ed51c725d60c56f6f20de29a18f1 and 53dad9731bb059b9ca88d44c4f76fb0e71bf551d

Changed Files

File Additions Deletions Status
obexd/gwobex/gw-obex.h +15 -0 modified
obexd/gwobex/obex-xfer.c +12 -0 modified

Full Patch

diff --git a/obexd/gwobex/gw-obex.h b/obexd/gwobex/gw-obex.h
index 94a6a64..fcbb40a 100644
--- a/obexd/gwobex/gw-obex.h
+++ b/obexd/gwobex/gw-obex.h
@@ -474,6 +474,21 @@ GwObexXfer *gw_obex_put_async(GwObex *ctx, const char *name, const char *type,
  */
 GwObexXfer *gw_obex_get_async(GwObex *ctx, const char *name, const char *type, gint *error);
 
+/** Start a GET operation asynchronously with application parameters
+ *
+ * @param ctx   Pointer returned by gw_obex_setup()
+ * @param name  Name of the object (null terminated UTF-8)
+ * @param type  Type of the object (null terminated UTF-8), or NULL
+ * @param apparam      Application parameters of the object
+ * @param apparam_size Application paramters' size
+ * @param error Place to store error code on failure (NULL if not interested)
+ *
+ * @returns a new GwObexXfer object on success, NULL on failure
+ */
+
+GwObexXfer *gw_obex_get_async_with_apparam(GwObex *ctx, const char *name, const char *type,
+		const guint8  *apparam, gint apparam_size, gint *error);
+
 
 /** Set a callback function for a GwObexXfer object
  * The callback function will be called in the following situations:
diff --git a/obexd/gwobex/obex-xfer.c b/obexd/gwobex/obex-xfer.c
index c7ebbd5..fcbee35 100644
--- a/obexd/gwobex/obex-xfer.c
+++ b/obexd/gwobex/obex-xfer.c
@@ -135,6 +135,18 @@ GwObexXfer *gw_obex_get_async(GwObex *ctx, const char *name, const char *type, g
     return ret ? ctx->xfer : NULL;
 }
 
+GwObexXfer *gw_obex_get_async_with_apparam(GwObex *ctx, const char *name, const char *type,
+		const guint8  *apparam, gint apparam_size, gint *error) {
+    gboolean ret;
+    GW_OBEX_LOCK(ctx);
+    CHECK_DISCONNECT(NULL, error, ctx);
+    ret = gw_obex_get(ctx, NULL, name, type, apparam, apparam_size, NULL, NULL, -1, TRUE);
+    if (ret == FALSE)
+        gw_obex_get_error(ctx, error);
+    GW_OBEX_UNLOCK(ctx);
+    return ret ? ctx->xfer : NULL;
+}
+
 static gboolean gw_obex_put_idle(GwObexXfer *xfer) {
     struct gw_obex *ctx = xfer->ctx;