diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c
index 23b1823..8eefe5f 100644
--- a/obexd/plugins/mas.c
+++ b/obexd/plugins/mas.c
#include "mimetype.h"
#include "filesystem.h"
#include "manager.h"
+#include "map_ap.h"
#include "messages.h"
gboolean finished;
gboolean nth_call;
GString *buffer;
+ map_ap_t *inparams;
};
static const uint8_t MAS_TARGET[TARGET_SIZE] = {
0xbb, 0x58, 0x2b, 0x40, 0x42, 0x0c, 0x11, 0xdb,
0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 };
+static int get_params(struct obex_session *os, struct mas_session *mas)
+{
+ const uint8_t *buffer;
+ ssize_t size;
+
+ size = obex_get_apparam(os, &buffer);
+ if (size < 0)
+ size = 0;
+
+ mas->inparams = map_ap_decode(buffer, size);
+ if (mas->inparams == NULL) {
+ DBG("Error when parsing parameters!");
+ return -EBADR;
+ }
+
+ return 0;
+}
+
static void reset_request(struct mas_session *mas)
{
if (mas->buffer) {
mas->buffer = NULL;
}
+ map_ap_free(mas->inparams);
+ mas->inparams = NULL;
+
mas->nth_call = FALSE;
mas->finished = FALSE;
}
if (type == NULL)
return -EBADR;
+ ret = get_params(os, mas);
+ if (ret < 0)
+ goto failed;
+
ret = obex_get_stream_start(os, name);
if (ret < 0)
goto failed;
if (type == NULL)
return -EBADR;
+ ret = get_params(os, mas);
+ if (ret < 0)
+ goto failed;
+
ret = obex_put_stream_start(os, name);
if (ret < 0)
goto failed;