diff --git a/obexd/gwobex/gw-obex.c b/obexd/gwobex/gw-obex.c
index ef32ff8..e656692 100644
--- a/obexd/gwobex/gw-obex.c
+++ b/obexd/gwobex/gw-obex.c
return ret;
}
+gboolean gw_obex_get_buf_with_apparam(GwObex *ctx,
+ const gchar *remote,
+ const gchar *type,
+ const guint8 *apparam,
+ gint apparam_size,
+ gchar **buf,
+ gint *buf_size,
+ gint *error) {
+ gboolean ret;
+ GW_OBEX_LOCK(ctx);
+ CHECK_DISCONNECT(FALSE, error, ctx);
+ ret = gw_obex_get(ctx, NULL, remote, type, apparam, apparam_size, buf, buf_size, -1, FALSE);
+ if (ret == FALSE)
+ gw_obex_get_error(ctx, error);
+ GW_OBEX_UNLOCK(ctx);
+ return ret;
+}
+
+gboolean gw_obex_put_buf_with_apparam(GwObex *ctx,
+ const gchar *remote,
+ const gchar *type,
+ const guint8 *apparam,
+ gint apparam_size,
+ const gchar *buf,
+ gint buf_size,
+ gint time,
+ gint *error) {
+ gboolean ret;
+ GW_OBEX_LOCK(ctx);
+ CHECK_DISCONNECT(FALSE, error, ctx);
+ ret = gw_obex_put(ctx, NULL, remote, type, apparam, apparam_size, buf, buf_size, time, -1, FALSE);
+ if (ret == FALSE)
+ gw_obex_get_error(ctx, error);
+ GW_OBEX_UNLOCK(ctx);
+ return ret;
+}
+
gboolean gw_obex_chdir(GwObex *ctx, const gchar *dir, gint *error) {
gboolean ret;
GW_OBEX_LOCK(ctx);
diff --git a/obexd/gwobex/gw-obex.h b/obexd/gwobex/gw-obex.h
index fcbb40a..6f99430 100644
--- a/obexd/gwobex/gw-obex.h
+++ b/obexd/gwobex/gw-obex.h
const gchar *buf, gint buf_size, gint time, gint *error);
+/** Get an object from the remote device and store it in a memory buffer.
+ * Either remote filename or type must be supplied (or both).
+ *
+ * @param ctx Pointer returned by gw_obex_setup()
+ * @param remote Remote filename (null terminated UTF-8)
+ * @param type MIME-type of the object
+ * @param apparam Application parameters of the object
+ * @param apparam_size Application parameters size
+ * @param buf Buffer to store the object in.
+ * g_free() when not needed anymore.
+ * @param buf_size Place to store length of fetched object
+ * @param error Place to store error code on failure
+ * (NULL if not interested)
+ *
+ * @returns TRUE on success, FALSE on failure
+ */
+gboolean gw_obex_get_buf_with_apparam(GwObex *ctx, const gchar *remote, const gchar *type,
+ const guint8 *apparam, gint apparam_size,
+ gchar **buf, gint *buf_size, gint *error);
+
+
+/** Send a object located in a memory buffer to the remote device.
+ * Either remote filename or type must be supplied (or both)
+ *
+ * @param ctx Pointer returned by gw_obex_setup()
+ * @param remote Remote filename (null terminated UTF-8)
+ * @param type MIME-type of the object
+ * @param apparam Application parameters of the object
+ * @param apparam_size Application parameters size
+ * @param buf Buffer containing the object
+ * @param buf_size Buffer (object) size
+ * @param time Last modification time of object (or -1 if not known)
+ * @param error Place to store error code on failure
+ * (NULL if not interested)
+ *
+ * @returns TRUE on success, FALSE on failure
+ */
+gboolean gw_obex_put_buf_with_apparam(GwObex *ctx, const gchar *remote, const gchar *type,
+ const guint8 *apparam, gint apparam_size,
+ const gchar *buf, gint buf_size, gint time, gint *error);
+
+
/** Change directory (relative to the current one).
*
* @param ctx Pointer returned by gw_obex_setup()