Return-Path: MIME-Version: 1.0 In-Reply-To: <006d01cfc5e0$6b4df110$41e9d330$@samsung.com> References: <000001cfb169$e4d01bc0$ae705340$@samsung.com> <002101cfb550$afb1f400$0f15dc00$@samsung.com> <006d01cfc5e0$6b4df110$41e9d330$@samsung.com> Date: Mon, 1 Sep 2014 16:07:22 +0300 Message-ID: Subject: Re: Query regarding MAP 1.2 implementation From: Luiz Augusto von Dentz To: Gowtham Anandha Babu Cc: "linux-bluetooth@vger.kernel.org" , Bharat Panda Content-Type: multipart/mixed; boundary=001a113403d0f6da31050200aed0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --001a113403d0f6da31050200aed0 Content-Type: text/plain; charset=UTF-8 Hi, On Mon, Sep 1, 2014 at 3:29 PM, Gowtham Anandha Babu wrote: > The current message-dummy.c looks like, it is creating a virtual folder in the system (Ex. Home/PC-NAME/map-messages/). > So, I created the map-messages directory in home/PC-NAME/. Then I tried SETPATH (mentioned in the previous thread). > The output is... > > obexd[29146]: obexd/src/obex.c:cmd_setpath() > obexd[29146]: SETPATH(0x5), (null)(0xffffffff) > obexd[29146]: obexd/src/obex.c:parse_name() NAME: > obexd[29146]: obexd/plugins/mas.c:mas_setpath() SETPATH: name nonhdr 0x20 > obexd[29146]: SETPATH(0x5), SUCCESS(0x20) > > But When I tried to call GetFolderListing() > The output is... > > obexd[29146]: obexd/src/obex.c:cmd_get() session 0x1008c40 > obexd[29146]: GET(0x3), (null)(0xffffffff) > obexd[29146]: obexd/src/obex.c:parse_type() TYPE: x-obex/folder-listing > obexd[29146]: obexd/plugins/mas.c:mas_get() GET: name (null) type x-obex/folder-listing mas 0x1015c00 > obexd[29146]: obexd/plugins/mas.c:get_params() Error when parsing parameters! > obexd[29146]: GET(0x3), BAD_REQUEST(0x40) > > But I had few folders created inside the map-messages. Bad request is normally when there is something wrong with the command itself, the error comes from here: mas->inparams = g_obex_apparam_decode(buffer, size); if (mas->inparams == NULL) { DBG("Error when parsing parameters!"); return -EBADR; } I suspect the problem is that there is no application parameters set which is fine since all the parameters of GetFolderListing are optional, please try with the attached patch I will send it shortly as a proper patch to the mailing list. -- Luiz Augusto von Dentz --001a113403d0f6da31050200aed0 Content-Type: text/x-patch; charset=US-ASCII; name="0001-obexd-mas-Fix-parsing-of-application-parameters.patch" Content-Disposition: attachment; filename="0001-obexd-mas-Fix-parsing-of-application-parameters.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hzjtmvsr0 RnJvbSBmZjY3ZDg0YjZhMDdlMDUyMmVkZTMyYmI1YzY3ZjhlZjkxNDg4MWNmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMdWl6IEF1Z3VzdG8gdm9uIERlbnR6IDxsdWl6LnZvbi5kZW50 ekBpbnRlbC5jb20+CkRhdGU6IE1vbiwgMSBTZXAgMjAxNCAxNjowMTo0MCArMDMwMApTdWJqZWN0 OiBbUEFUQ0ggQmx1ZVpdIG9iZXhkL21hczogRml4IHBhcnNpbmcgb2YgYXBwbGljYXRpb24gcGFy YW1ldGVycwoKU29tZSBjb21tYW5kcyBkb24ndCBoYXZlIGFueSBtYW5kYXRvcnkgYXBwbGljYXRp b24gcGFyYW1ldGVyIHdoaWNoIG1lYW5zCmlucGFyYW1zIGNhbiBiZSBOVUxMIHdoaWNoIHNob3Vs ZCBub3QgYmUgdHJlYXRlZCBhcyBhIGJhZCByZXF1ZXN0LgotLS0KIG9iZXhkL3BsdWdpbnMvbWFz LmMgfCAyMiArKysrKysrKysrKysrKysrKy0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMTcgaW5zZXJ0 aW9ucygrKSwgNSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9vYmV4ZC9wbHVnaW5zL21hcy5j IGIvb2JleGQvcGx1Z2lucy9tYXMuYwppbmRleCA1NzI5YzIyLi42ZDc4NzFhIDEwMDY0NAotLS0g YS9vYmV4ZC9wbHVnaW5zL21hcy5jCisrKyBiL29iZXhkL3BsdWdpbnMvbWFzL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