diff --git a/obexd/gwobex/gw-obex.c b/obexd/gwobex/gw-obex.c
index 061e9e9..ef32ff8 100644
--- a/obexd/gwobex/gw-obex.c
+++ b/obexd/gwobex/gw-obex.c
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_get(ctx, local, remote, type, NULL, NULL, -1, FALSE);
+ ret = gw_obex_get(ctx, local, remote, type, NULL, 0, NULL, NULL, -1, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_get(ctx, NULL, remote, type, NULL, NULL, fd, FALSE);
+ ret = gw_obex_get(ctx, NULL, remote, type, NULL, 0, NULL, NULL, fd, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_put(ctx, NULL, remote, type, NULL, 0, -1, fd, FALSE);
+ ret = gw_obex_put(ctx, NULL, remote, type, NULL, 0, NULL, 0, -1, fd, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_put(ctx, local, remote, type, NULL, 0, -1, -1, FALSE);
+ ret = gw_obex_put(ctx, local, remote, type, NULL, 0, NULL, 0, -1, -1, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_get(ctx, NULL, remote, type, buf, buf_size, -1, FALSE);
+ ret = gw_obex_get(ctx, NULL, remote, type, NULL, 0, buf, buf_size, -1, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_put(ctx, NULL, remote, type, buf, buf_size, time, -1, FALSE);
+ ret = gw_obex_put(ctx, NULL, remote, type, NULL, 0, buf, buf_size, time, -1, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_get(ctx, NULL, dir ? dir : "", LST_TYPE, buf, buf_size, -1, FALSE);
+ ret = gw_obex_get(ctx, NULL, dir ? dir : "", LST_TYPE, NULL, 0, buf, buf_size, -1, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
else if (*buf_size > 0) {
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_put(ctx, NULL, name, NULL, NULL, 0, -1, -1, FALSE);
+ ret = gw_obex_put(ctx, NULL, name, NULL, NULL, 0, NULL, 0, -1, -1, FALSE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(FALSE, error, ctx);
- ret = gw_obex_get(ctx, NULL, NULL, CAP_TYPE, cap, cap_len, -1, FALSE);
+ ret = gw_obex_get(ctx, NULL, NULL, CAP_TYPE, NULL, 0, cap, cap_len, -1, FALSE);
if (ret == FALSE) {
*cap = NULL;
*cap_len = 0;
diff --git a/obexd/gwobex/obex-priv.c b/obexd/gwobex/obex-priv.c
index 7352cdc..d67a4ac 100644
--- a/obexd/gwobex/obex-priv.c
+++ b/obexd/gwobex/obex-priv.c
gboolean gw_obex_get(GwObex *ctx,
const gchar *local, const gchar *remote, const gchar *type,
+ const guint8 *apparam, gint apparam_size,
gchar **buf, gint *buf_size, int stream_fd,
gboolean async) {
gboolean ret = FALSE;
OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_CONNECTION, hv, 4, 0);
}
+ if (apparam && apparam_size > 0) {
+ hv.bs = (unsigned char *)apparam;
+ OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_APPARAM, hv, apparam_size, 0);
+ }
+
if (type) {
hv.bs = (unsigned char *)type;
OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_TYPE, hv, strlen(type) + 1, 0);
gboolean gw_obex_put(GwObex *ctx,
const gchar *local, const gchar *remote, const gchar *type,
+ const guint8 *apparam, gint apparam_size,
const gchar *buf, gint object_size, time_t object_time,
int stream_fd, gboolean async) {
gboolean ret = FALSE;
OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_TYPE, hv, strlen(type) + 1, 0);
}
+ if (apparam && apparam_size > 0) {
+ hv.bs = (unsigned char *)apparam;
+ OBEX_ObjectAddHeader(ctx->handle, object, OBEX_HDR_APPARAM, hv, apparam_size, 0);
+ }
+
/* Try to figure out modification time if none was given */
if (ctx->xfer->stream_fd >= 0) {
struct stat stats;
diff --git a/obexd/gwobex/obex-priv.h b/obexd/gwobex/obex-priv.h
index b6cbbf6..01d7b8b 100644
--- a/obexd/gwobex/obex-priv.h
+++ b/obexd/gwobex/obex-priv.h
*/
gboolean gw_obex_get(GwObex *ctx,
const gchar *local, const gchar *remote, const gchar *type,
+ const guint8 *apparam, gint apparam_size,
gchar **buf, gint *buf_size, int stream_fd,
gboolean async);
*/
gboolean gw_obex_put(GwObex *ctx,
const gchar *local, const gchar *remote, const gchar *type,
+ const guint8 *apparam, gint apparam_size,
const gchar *buf, gint buf_size, time_t object_time,
int stream_fd, gboolean async);
diff --git a/obexd/gwobex/obex-xfer.c b/obexd/gwobex/obex-xfer.c
index 0f3248d..c7ebbd5 100644
--- a/obexd/gwobex/obex-xfer.c
+++ b/obexd/gwobex/obex-xfer.c
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(NULL, error, ctx);
- ret = gw_obex_put(ctx, NULL, name, type, NULL, size, time, -1, TRUE);
+ ret = gw_obex_put(ctx, NULL, name, type, NULL, 0, NULL, size, time, -1, TRUE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);
gboolean ret;
GW_OBEX_LOCK(ctx);
CHECK_DISCONNECT(NULL, error, ctx);
- ret = gw_obex_get(ctx, NULL, name, type, NULL, NULL, -1, TRUE);
+ ret = gw_obex_get(ctx, NULL, name, type, NULL, 0, NULL, NULL, -1, TRUE);
if (ret == FALSE)
gw_obex_get_error(ctx, error);
GW_OBEX_UNLOCK(ctx);