Skip to contentSkip to conversation

Query regarding MAP 1.2 implementation

DISCUSSION Gowtham Anandha Babu 2 participants 12 messages Aug 6, 2014 – Sep 3, 2014 2 messages not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi All,

I am currently working on MAP implementation in BlueZ.
I am trying below things to make MAS connect with remote MCE client.

Below are the steps we followed;

On MCE device:
--> MAS search
--> MAS connect
--> SET PATH (/)

On Bluez, obexd:
--> Run "bluetoothd"
--> Run "obexd"
--> On SET_PATH command it sends the obex session value as NULL.

obexd[32713]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E
obexd[32713]: obexd/src/obex.c:obex_session_start() obexd[32713]: obexd/src/obex.c:cmd_connect()
obexd[32713]: CONNECT(0x0), (null)(0xffffffff)
obexd[32713]: obexd/src/obex.c:cmd_connect() Selected driver: Message Access server
obexd[32713]: obexd/plugins/mas.c:mas_connect()
obexd[32713]: CONNECT(0x0), (null)(0x0)
obexd[32713]: obexd/src/obex.c:cmd_setpath()
obexd[32713]: obexd/src/obex.c:cmd_setpath() (null) obexd[32713]: SETPATH(0x5), (null)(0xffffffff)
obexd[32713]: obexd/src/obex.c:parse_name() NAME:
obexd[32713]: obexd/plugins/mas.c:mas_setpath() SETPATH: name nonhdr 0x20 obexd[32713]: SETPATH(0x5), NOT_FOUND(0x44)

Do we need to configure or run anything else before starting up obexd?

#1 lore raw

Hi,

Quoted 34 lines · Gowtham Anandha Babu

Hi All,

I am currently working on MAP implementation in BlueZ.
I am trying below things to make MAS connect with remote MCE client.

Below are the steps we followed;

On MCE device:
--> MAS search
--> MAS connect
--> SET PATH (/)

On Bluez, obexd:
--> Run "bluetoothd"
--> Run "obexd"
--> On SET_PATH command it sends the obex session value as NULL.

obexd[32713]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E
obexd[32713]: obexd/src/obex.c:obex_session_start() obexd[32713]: obexd/src/obex.c:cmd_connect()
obexd[32713]: CONNECT(0x0), (null)(0xffffffff)
obexd[32713]: obexd/src/obex.c:cmd_connect() Selected driver: Message Access server
obexd[32713]: obexd/plugins/mas.c:mas_connect()
obexd[32713]: CONNECT(0x0), (null)(0x0)
obexd[32713]: obexd/src/obex.c:cmd_setpath()
obexd[32713]: obexd/src/obex.c:cmd_setpath() (null) obexd[32713]: SETPATH(0x5), (null)(0xffffffff)
obexd[32713]: obexd/src/obex.c:parse_name() NAME:
obexd[32713]: obexd/plugins/mas.c:mas_setpath() SETPATH: name nonhdr 0x20 obexd[32713]: SETPATH(0x5), NOT_FOUND(0x44)

Quoted 1 line

Do we need to configure or run anything else before starting up obexd?

You are probably missing a backend implementation for your message database, currently we are building with dummy as backend but the idea is that we switch to a runtime solution probably we a D-Bus agent interface to interact with these requests using a file descriptor to optimize the data transfer. iirc samsung has done a D-Bus backend for BlueZ 4 in Tizen perhaps you can star by looking what kind of interface is there.

Signature · 1 line
Luiz Augusto von Dentz

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CABBYNZL5OBA6iNhzTkpKTmSEj+5R_oU5KLOAsFcK0ZDHvridMw@mail.gmail.com

#4 lore raw

Hi Luiz,

Quoted 98 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Monday, August 11, 2014 4:39 PM
To: Gowtham Anandha Babu
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Well you can start over a new implementation, in fact that was what I suggest but first we need to agree on the D-Bus API which I expect you guys have something in mind since Tizen backend did use D-Bus in its backend if Im not mistaken, I have no idea about the Tizen solution really so I guess you will need to figure it out if you want to reuse its code or not but there will be changes to the interface thus my suggestion to start with the API definition.

Quoted 2 lines · Gowtham Anandha Babu

Hi Luiz,
Backend implementation for message database in tizen is showing so many

dependencies while setting up.

Quoted 1 line

When I am trying to install/Make map-agent, its is giving me "package vconf

not found" error.

Quoted 1 line

When I am trying to install/Make vconf, its giving me some other packages

not found error.

Quoted 2 lines

It goes on.
Is there any other way/procedure to implement the backend message

database for MAS?

Quoted 13 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Wednesday, August 06, 2014 5:33 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

On Wed, Aug 6, 2014 at 2:30 PM, Gowtham Anandha Babu

Quoted 18 lines · <[email protected]> wrote:
Quoted 18 lines

Hi All,

I am currently working on MAP implementation in BlueZ.
I am trying below things to make MAS connect with remote MCE client.

Below are the steps we followed;

On MCE device:
--> MAS search
--> MAS connect
--> SET PATH (/)

On Bluez, obexd:
--> Run "bluetoothd"
--> Run "obexd"
--> On SET_PATH command it sends the obex session value as NULL.

Quoted 6 lines
Quoted 6 lines

obexd[32713]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E obexd[32713]: obexd/src/obex.c:obex_session_start() obexd[32713]: obexd/src/obex.c:cmd_connect() obexd[32713]: CONNECT(0x0), (null)(0xffffffff) obexd[32713]: obexd/src/obex.c:cmd_connect() Selected driver:

Message

Quoted 8 lines
Quoted 8 lines

Access server
obexd[32713]: obexd/plugins/mas.c:mas_connect() obexd[32713]: CONNECT(0x0), (null)(0x0) obexd[32713]: obexd/src/obex.c:cmd_setpath() obexd[32713]: obexd/src/obex.c:cmd_setpath() (null) obexd[32713]: SETPATH(0x5), (null)(0xffffffff) obexd[32713]: obexd/src/obex.c:parse_name() NAME:
obexd[32713]: obexd/plugins/mas.c:mas_setpath() SETPATH: name

nonhdr

Quoted 6 lines
Quoted 4 lines

0x20
obexd[32713]: SETPATH(0x5), NOT_FOUND(0x44)

Do we need to configure or run anything else before starting up obexd?

You are probably missing a backend implementation for your message

database, currently we are building with dummy as backend but the idea is that we switch to a runtime solution probably we a D-Bus agent interface to interact with these requests using a file descriptor to optimize the data transfer. iirc samsung has done a D-Bus backend for BlueZ 4 in Tizen perhaps you can star by looking what kind of interface is there.

Quoted 9 lines

--
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 2 lines

--
Luiz Augusto von Dentz

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.

Regards,
Gowtham Anandha Babu

#5 lore raw

Hi,

Quoted 13 lines · Gowtham Anandha Babu

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...

Quoted 8 lines

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.

Signature · 1 line
Luiz Augusto von Dentz

From ff67d84b6a07e0522ede32bb5c67f8ef914881cf Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <[email protected]>
Date: Mon, 1 Sep 2014 16:01:40 +0300
Subject: [PATCH BlueZ] obexd/mas: Fix parsing of application parameters

Some commands don't have any mandatory application parameter which means inparams can be NULL which should not be treated as a bad request.

---
 obexd/plugins/mas.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
obexd/plugins/mas.c +17 -5
index 5729c22..6d7871a 100644
@@ -84,7 +84,7 @@ static int get_params(struct obex_session *os, struct mas_session *mas)
 
 	size = obex_get_apparam(os, &buffer);
 	if (size < 0)
-		size = 0;
+		return 0;
 
 	mas->inparams = g_obex_apparam_decode(buffer, size);
 	if (mas->inparams == NULL) {
@@ -249,7 +249,9 @@ static void get_messages_listing_cb(void *session, int err, uint16_t size,
 		return;
 	}
 
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
+	if (mas->inparams)
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT,
+									&max);
 
 	if (max == 0) {
 		if (!entry)
@@ -397,7 +399,9 @@ static void get_folder_listing_cb(void *session, int err, uint16_t size,
 		return;
 	}
 
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
+	if (mas->inparams)
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT,
+									&max);
 
 	if (max == 0) {
 		if (err != -EAGAIN)
@@ -493,8 +497,12 @@ static void *folder_listing_open(const char *name, int oflag, mode_t mode,
 
 	DBG("name = %s", name);
 
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET, &offset);
+	if (mas->inparams) {
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT,
+									&max);
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET,
+								&offset);
+	}
 
 	*err = messages_get_folder_listing(mas->backend_data, name, max,
 					offset, get_folder_listing_cb, mas);
@@ -526,6 +534,9 @@ static void *msg_listing_open(const char *name, int oflag, mode_t mode,
 		return NULL;
 	}
 
+	if (!mas->inparams)
+		goto done;
+
 	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
 	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET, &offset);
 	g_obex_apparam_get_uint8(mas->inparams, MAP_AP_SUBJECTLENGTH,
@@ -548,6 +559,7 @@ static void *msg_listing_open(const char *name, int oflag, mode_t mode,
 	g_obex_apparam_get_uint8(mas->inparams, MAP_AP_FILTERPRIORITY,
 						&filter.priority);
 
+done:
 	*err = messages_get_messages_listing(mas->backend_data, name, max,
 			offset, subject_len, &filter,
 			get_messages_listing_cb, mas);
Signature · 1 line
1.9.3
#6 lore raw

Hi Luiz,

Quoted 50 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 1 line · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 1 line

So, I created the map-messages directory in home/PC-NAME/. Then I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 7 lines

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!

Quoted 3 lines

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;
}
Quoted 7 lines

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

I applied the patch which was attached in the previous reply. Still I am getting the same error.
I tried printing the "size" inside the get_params function. Its value is '0' for GetFolderListing request. If size=0, then g_obex_apparam_decode() function always return NULL, which leads to "Error when parsing parameters!".

Regards,
Gowtham

#7 lore raw

Hi,

Quoted 58 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 55 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 1 line · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 1 line

So, I created the map-messages directory in home/PC-NAME/. Then I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 7 lines

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!

Quoted 3 lines

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.

Quoted 7 lines
Quoted 2 lines

--
Luiz Augusto von Dentz

I applied the patch which was attached in the previous reply. Still I am getting the same error.
I tried printing the "size" inside the get_params function. Its value is '0' for GetFolderListing request. If size=0, then g_obex_apparam_decode() function always return NULL, which leads to "Error when parsing parameters!".

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Signature · 1 line
Luiz Augusto von Dentz

From e90daba9a202f072d626f3404c7b0181a4aa3ac1 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <[email protected]>
Date: Mon, 1 Sep 2014 16:01:40 +0300
Subject: [PATCH BlueZ] obexd/mas: Fix parsing of application parameters

Some commands don't have any mandatory application parameter which means inparams can be NULL which should not be treated as a bad request.

---
 obexd/plugins/mas.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
obexd/plugins/mas.c +18 -6
index 5729c22..24b26ae 100644
@@ -83,8 +83,8 @@ static int get_params(struct obex_session *os, struct mas_session *mas)
 	ssize_t size;
 
 	size = obex_get_apparam(os, &buffer);
-	if (size < 0)
-		size = 0;
+	if (size <= 0)
+		return 0;
 
 	mas->inparams = g_obex_apparam_decode(buffer, size);
 	if (mas->inparams == NULL) {
@@ -249,7 +249,9 @@ static void get_messages_listing_cb(void *session, int err, uint16_t size,
 		return;
 	}
 
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
+	if (mas->inparams)
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT,
+									&max);
 
 	if (max == 0) {
 		if (!entry)
@@ -397,7 +399,9 @@ static void get_folder_listing_cb(void *session, int err, uint16_t size,
 		return;
 	}
 
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
+	if (mas->inparams)
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT,
+									&max);
 
 	if (max == 0) {
 		if (err != -EAGAIN)
@@ -493,8 +497,12 @@ static void *folder_listing_open(const char *name, int oflag, mode_t mode,
 
 	DBG("name = %s", name);
 
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
-	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET, &offset);
+	if (mas->inparams) {
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT,
+									&max);
+		g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET,
+								&offset);
+	}
 
 	*err = messages_get_folder_listing(mas->backend_data, name, max,
 					offset, get_folder_listing_cb, mas);
@@ -526,6 +534,9 @@ static void *msg_listing_open(const char *name, int oflag, mode_t mode,
 		return NULL;
 	}
 
+	if (!mas->inparams)
+		goto done;
+
 	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MAXLISTCOUNT, &max);
 	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_STARTOFFSET, &offset);
 	g_obex_apparam_get_uint8(mas->inparams, MAP_AP_SUBJECTLENGTH,
@@ -548,6 +559,7 @@ static void *msg_listing_open(const char *name, int oflag, mode_t mode,
 	g_obex_apparam_get_uint8(mas->inparams, MAP_AP_FILTERPRIORITY,
 						&filter.priority);
 
+done:
 	*err = messages_get_messages_listing(mas->backend_data, name, max,
 			offset, subject_len, &filter,
 			get_messages_listing_cb, mas);
Signature · 1 line
1.9.3
#8 lore raw

Hi,

Quoted 66 lines · Luiz Augusto von Dentz

Hi,

Quoted 62 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 57 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 1 line · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 1 line

So, I created the map-messages directory in home/PC-NAME/. Then I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 7 lines

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!

Quoted 3 lines

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

Quoted 6 lines
Quoted 3 lines

I applied the patch which was attached in the previous reply. Still I am getting the same error.
I tried printing the "size" inside the get_params function. Its value is '0' for GetFolderListing request. If size=0, then g_obex_apparam_decode() function always return NULL, which leads to "Error when parsing parameters!".

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Let me know if you can test the patch, I would like to push it asap if it works.

Signature · 1 line
Luiz Augusto von Dentz
#9 lore raw

Hi,

Quoted 87 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 3:57 PM
To: Gowtham Anandha Babu
Cc: [email protected]
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 62 lines · Luiz Augusto von Dentz

Hi,

Quoted 58 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 55 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 2 lines · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 2 lines

So, I created the map-messages directory in home/PC-NAME/. Then I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 7 lines

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!

Quoted 3 lines

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.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

I applied the patch which was attached in the previous reply. Still I am

getting the same error.

Quoted 1 line
Quoted 1 line

I tried printing the "size" inside the get_params function. Its value is '0' for

GetFolderListing request.

Quoted 1 line
Quoted 1 line

If size=0, then g_obex_apparam_decode() function always return NULL,

which leads to "Error when parsing parameters!".

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Let me know if you can test the patch, I would like to push it asap if it works.

--
Luiz Augusto von Dentz

Now I am not getting the BAD_REQUEST error. But when I call the folder-listing, it abruptly ends or terminate.

The below one -- mas-connect

obexd[14651]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E obexd[14651]: obexd/src/obex.c:obex_session_start()
obexd[14651]: obexd/src/obex.c:cmd_connect()
obexd[14651]: CONNECT(0x0), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:cmd_connect() Selected driver: Message Access server obexd[14651]: obexd/plugins/mas.c:mas_connect()
obexd[14651]: CONNECT(0x0), (null)(0x0)

The below one -- mas-setpath

obexd[14651]: obexd/src/obex.c:cmd_setpath()
obexd[14651]: SETPATH(0x5), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:parse_name() NAME:
obexd[14651]: obexd/plugins/mas.c:mas_setpath() SETPATH: name nonhdr 0x20 obexd[14651]: SETPATH(0x5), SUCCESS(0x20)

The below one -- mas-getFolderListing

obexd[14651]: obexd/src/obex.c:cmd_get() session 0x1ecbd80
obexd[14651]: GET(0x3), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:parse_type() TYPE: x-obex/folder-listing
obexd[14651]: obexd/plugins/mas.c:mas_get() GET: name (null) type x-obex/folder-listing mas 0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:folder_listing_open() name = (null)
obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:any_get_next_header()
obexd[14651]: get_next_header(): Resource temporarily unavailable (11)
obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:any_get_next_header() gowtham.ab@gowtham-ab:~/latest_bluez/bluez$

Regards,
Gowtham

#10 lore raw

Hi,

Quoted 121 lines · Gowtham Anandha Babu

Hi,

Quoted 87 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 3:57 PM
To: Gowtham Anandha Babu
Cc: [email protected]
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 62 lines · Luiz Augusto von Dentz

Hi,

Quoted 58 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 55 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 2 lines · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 2 lines

So, I created the map-messages directory in home/PC-NAME/. Then I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 7 lines

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!

Quoted 3 lines

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.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

I applied the patch which was attached in the previous reply. Still I am

getting the same error.

Quoted 1 line
Quoted 1 line

I tried printing the "size" inside the get_params function. Its value is '0' for

GetFolderListing request.

Quoted 1 line
Quoted 1 line

If size=0, then g_obex_apparam_decode() function always return NULL,

which leads to "Error when parsing parameters!".

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Let me know if you can test the patch, I would like to push it asap if it works.

--
Luiz Augusto von Dentz

Now I am not getting the BAD_REQUEST error. But when I call the folder-listing, it abruptly ends or terminate.

The below one -- mas-connect

obexd[14651]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E obexd[14651]: obexd/src/obex.c:obex_session_start()
obexd[14651]: obexd/src/obex.c:cmd_connect()
obexd[14651]: CONNECT(0x0), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:cmd_connect() Selected driver: Message Access server obexd[14651]: obexd/plugins/mas.c:mas_connect()
obexd[14651]: CONNECT(0x0), (null)(0x0)

The below one -- mas-setpath

obexd[14651]: obexd/src/obex.c:cmd_setpath()
obexd[14651]: SETPATH(0x5), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:parse_name() NAME:
obexd[14651]: obexd/plugins/mas.c:mas_setpath() SETPATH: name nonhdr 0x20 obexd[14651]: SETPATH(0x5), SUCCESS(0x20)

The below one -- mas-getFolderListing

Quoted 11 lines

obexd[14651]: obexd/src/obex.c:cmd_get() session 0x1ecbd80
obexd[14651]: GET(0x3), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:parse_type() TYPE: x-obex/folder-listing
obexd[14651]: obexd/plugins/mas.c:mas_get() GET: name (null) type x-obex/folder-listing mas 0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:folder_listing_open() name = (null)
obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:any_get_next_header()
obexd[14651]: get_next_header(): Resource temporarily unavailable (11)
obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:any_get_next_header() gowtham.ab@gowtham-ab:~/latest_bluez/bluez$

I think I know what is the problem, outparams can also be NULL if no application parameter has to be added to the response causing g_obex_apparam_encode to crash, check with attached patch. Btw next time please send the backtrace either using gdb or valgrind is highly recommended.

Signature · 1 line
Luiz Augusto von Dentz
#11 lore raw

Hi,

Quoted 161 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 5:34 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 38 lines · Gowtham Anandha Babu

Hi,

Quoted 36 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 3:57 PM
To: Gowtham Anandha Babu
Cc: [email protected]
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 25 lines · Luiz Augusto von Dentz

Hi,

Quoted 21 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 18 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 2 lines · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 1 line

So, I created the map-messages directory in home/PC-NAME/.

Then

Quoted 53 lines
Quoted 53 lines
Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
Quoted 1 line

I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 8 lines

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!

Quoted 3 lines

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;
}
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

I applied the patch which was attached in the previous reply. Still I am

getting the same error.

Quoted 2 lines
Quoted 2 lines

I tried printing the "size" inside the get_params function. Its value is '0' for

GetFolderListing request.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

If size=0, then g_obex_apparam_decode() function always return NULL,

which leads to "Error when parsing parameters!".

Quoted 3 lines

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Let me know if you can test the patch, I would like to push it asap if it

works.

Quoted 7 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

Now I am not getting the BAD_REQUEST error. But when I call the folder-

listing, it abruptly ends or terminate.

Quoted 13 lines

The below one -- mas-connect

obexd[14651]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E
obexd[14651]: obexd/src/obex.c:obex_session_start() obexd[14651]: obexd/src/obex.c:cmd_connect()
obexd[14651]: CONNECT(0x0), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:cmd_connect() Selected driver: Message Access server
obexd[14651]: obexd/plugins/mas.c:mas_connect() obexd[14651]: CONNECT(0x0), (null)(0x0)

Quoted 6 lines

The below one -- mas-setpath

obexd[14651]: obexd/src/obex.c:cmd_setpath() obexd[14651]: SETPATH(0x5), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:parse_name() NAME:
obexd[14651]: obexd/plugins/mas.c:mas_setpath() SETPATH: name

nonhdr

Quoted 5 lines

0x20
obexd[14651]: SETPATH(0x5), SUCCESS(0x20)

The below one -- mas-getFolderListing

Quoted 15 lines

obexd[14651]: obexd/src/obex.c:cmd_get() session 0x1ecbd80 obexd[14651]: GET(0x3), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:parse_type() TYPE:
x-obex/folder-listing
obexd[14651]: obexd/plugins/mas.c:mas_get() GET: name (null) type x-obex/folder-listing mas 0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:folder_listing_open() name = (null) obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:any_get_next_header() obexd[14651]: get_next_header(): Resource temporarily unavailable (11) obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:any_get_next_header() gowtham.ab@gowtham-ab:~/latest_bluez/bluez$

Quoted 8 lines

I think I know what is the problem, outparams can also be NULL if no application parameter has to be added to the response causing g_obex_apparam_encode to crash, check with attached patch. Btw next time please send the backtrace either using gdb or valgrind is highly recommended.

--
Luiz Augusto von Dentz

Sorry, I didn’t see any patch attached.

Regards,
Gowtham

#12 lore raw

Hi,

Quoted 169 lines · Gowtham Anandha Babu

Hi,

Quoted 167 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 5:34 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 38 lines · Gowtham Anandha Babu

Hi,

Quoted 36 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 3:57 PM
To: Gowtham Anandha Babu
Cc: [email protected]
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 25 lines · Luiz Augusto von Dentz

Hi,

Quoted 21 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 18 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 2 lines · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 1 line

So, I created the map-messages directory in home/PC-NAME/.

Then

Quoted 53 lines
Quoted 53 lines
Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
Quoted 1 line

I tried

SETPATH (mentioned in the previous thread).

Quoted 6 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 8 lines

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!

Quoted 3 lines

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;
}
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

I applied the patch which was attached in the previous reply. Still I am

getting the same error.

Quoted 2 lines
Quoted 2 lines

I tried printing the "size" inside the get_params function. Its value is '0' for

GetFolderListing request.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

If size=0, then g_obex_apparam_decode() function always return NULL,

which leads to "Error when parsing parameters!".

Quoted 3 lines

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Let me know if you can test the patch, I would like to push it asap if it

works.

Quoted 7 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

Now I am not getting the BAD_REQUEST error. But when I call the folder-

listing, it abruptly ends or terminate.

Quoted 13 lines

The below one -- mas-connect

obexd[14651]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E
obexd[14651]: obexd/src/obex.c:obex_session_start() obexd[14651]: obexd/src/obex.c:cmd_connect()
obexd[14651]: CONNECT(0x0), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:cmd_connect() Selected driver: Message Access server
obexd[14651]: obexd/plugins/mas.c:mas_connect() obexd[14651]: CONNECT(0x0), (null)(0x0)

Quoted 6 lines

The below one -- mas-setpath

obexd[14651]: obexd/src/obex.c:cmd_setpath() obexd[14651]: SETPATH(0x5), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:parse_name() NAME:
obexd[14651]: obexd/plugins/mas.c:mas_setpath() SETPATH: name

nonhdr

Quoted 5 lines

0x20
obexd[14651]: SETPATH(0x5), SUCCESS(0x20)

The below one -- mas-getFolderListing

Quoted 15 lines

obexd[14651]: obexd/src/obex.c:cmd_get() session 0x1ecbd80 obexd[14651]: GET(0x3), (null)(0xffffffff)
obexd[14651]: obexd/src/obex.c:parse_type() TYPE:
x-obex/folder-listing
obexd[14651]: obexd/plugins/mas.c:mas_get() GET: name (null) type x-obex/folder-listing mas 0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:folder_listing_open() name = (null) obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:any_get_next_header() obexd[14651]: get_next_header(): Resource temporarily unavailable (11) obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:any_get_next_header() gowtham.ab@gowtham-ab:~/latest_bluez/bluez$

I think I know what is the problem, outparams can also be NULL if no application parameter has to be added to the response causing g_obex_apparam_encode to crash, check with attached patch. Btw next time please send the backtrace either using gdb or valgrind is highly recommended.

Quoted 4 lines
Quoted 2 lines

--
Luiz Augusto von Dentz

Sorry, I didn’t see any patch attached.

There it go.

Signature · 1 line
Luiz Augusto von Dentz

From 62cdfef597ef6bf142623e2cd1a743494102323d Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <[email protected]>
Date: Wed, 3 Sep 2014 14:58:37 +0300
Subject: [PATCH BlueZ] obexd/mas: Fix crash when outparams is NULL

outparams can be NULL meaning no application parameters should be added to the response.

---
 obexd/plugins/mas.c | 3 +++
 1 file changed, 3 insertions(+)
obexd/plugins/mas.c +3 -0
index 24b26ae..fb97fe3 100644
@@ -676,6 +676,9 @@ static ssize_t any_get_next_header(void *object, void *buf, size_t mtu,
 		return 0;
 
 	mas->ap_sent = TRUE;
+	if (!mas->outparams)
+		return 0;
+
 	return g_obex_apparam_encode(mas->outparams, buf, mtu);
 }
 
Signature · 1 line
1.9.3
#13 lore raw

Hi,

Quoted 189 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Wednesday, September 03, 2014 5:49 PM
To: Gowtham Anandha Babu
Cc: [email protected]
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 177 lines · Gowtham Anandha Babu

Hi,

Quoted 174 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 5:34 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 38 lines · Gowtham Anandha Babu

Hi,

Quoted 36 lines

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Wednesday, September 03, 2014 3:57 PM
To: Gowtham Anandha Babu
Cc: [email protected]
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 25 lines · Luiz Augusto von Dentz

Hi,

Quoted 21 lines · Gowtham Anandha Babu

Hi Luiz,

Quoted 18 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Luiz Augusto von Dentz
Sent: Monday, September 01, 2014 6:37 PM
To: Gowtham Anandha Babu
Cc: [email protected]; Bharat Panda
Subject: Re: Query regarding MAP 1.2 implementation

Hi,

Quoted 2 lines · Gowtham Anandha Babu

The current message-dummy.c looks like, it is creating a virtual folder in the

system (Ex. Home/PC-NAME/map-messages/).

Quoted 1 line

So, I created the map-messages directory in home/PC-NAME/.

Then

Quoted 56 lines
Quoted 56 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 1 line

I tried

SETPATH (mentioned in the previous thread).

Quoted 7 lines

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

Quoted 5 lines

0x20
obexd[29146]: SETPATH(0x5), SUCCESS(0x20)

But When I tried to call GetFolderListing() The output is...

Quoted 8 lines

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!

Quoted 3 lines

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;
}
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

I applied the patch which was attached in the previous reply. Still I am

getting the same error.

Quoted 2 lines
Quoted 2 lines

I tried printing the "size" inside the get_params function. Its value is '0' for

GetFolderListing request.

Quoted 2 lines
Quoted 2 lines

If size=0, then g_obex_apparam_decode() function always return NULL,

Quoted 7 lines
Quoted 7 lines

which leads to "Error when parsing parameters!".

Quoted 3 lines

My bad, the check should be size <= 0 otherwise it will still cause this problem.

Let me know if you can test the patch, I would like to push it asap if it

works.

Quoted 8 lines
Quoted 4 lines

--
Luiz Augusto von Dentz

Now I am not getting the BAD_REQUEST error. But when I call the folder-

listing, it abruptly ends or terminate.

Quoted 13 lines

The below one -- mas-connect

obexd[14651]: obexd/plugins/bluetooth.c:profile_new_connection() device /org/bluez/hci0/dev_00_1B_DC_07_33_4E obexd[14651]: obexd/src/obex.c:obex_session_start() obexd[14651]: obexd/src/obex.c:cmd_connect() obexd[14651]: CONNECT(0x0), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:cmd_connect() Selected driver:
Message Access server
obexd[14651]: obexd/plugins/mas.c:mas_connect() obexd[14651]: CONNECT(0x0), (null)(0x0)

Quoted 6 lines

The below one -- mas-setpath

obexd[14651]: obexd/src/obex.c:cmd_setpath() obexd[14651]: SETPATH(0x5), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:parse_name() NAME:
obexd[14651]: obexd/plugins/mas.c:mas_setpath() SETPATH: name

nonhdr

Quoted 14 lines

0x20
obexd[14651]: SETPATH(0x5), SUCCESS(0x20)

The below one -- mas-getFolderListing

obexd[14651]: obexd/src/obex.c:cmd_get() session 0x1ecbd80 obexd[14651]: GET(0x3), (null)(0xffffffff) obexd[14651]: obexd/src/obex.c:parse_type() TYPE:
x-obex/folder-listing
obexd[14651]: obexd/plugins/mas.c:mas_get() GET: name (null) type x-obex/folder-listing mas 0x1ecbc00
obexd[14651]: obexd/plugins/mas.c:folder_listing_open() name = (null)
obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null)

Quoted 8 lines

type=x-obex/folder-listing object=0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:any_get_next_header() obexd[14651]: get_next_header(): Resource temporarily unavailable
(11)
obexd[14651]: obexd/src/obex.c:driver_get_headers() name=(null) type=x-obex/folder-listing object=0x1ecbc00 obexd[14651]: obexd/plugins/mas.c:any_get_next_header() gowtham.ab@gowtham-ab:~/latest_bluez/bluez$

I think I know what is the problem, outparams can also be NULL if no application parameter has to be added to the response causing g_obex_apparam_encode to crash, check with attached patch. Btw next time please send the backtrace either using gdb or valgrind is highly recommended.

--
Luiz Augusto von Dentz

Quoted 6 lines
Quoted 1 line

Sorry, I didn’t see any patch attached.

There it go.

--
Luiz Augusto von Dentz

Finally It worked!!! Before moving on to msg-listing function implementation, we need bMessage parser to check the messages. I saw in the below link
http://comments.gmane.org/gmane.linux.bluez.kernel/22126
that someone had already implemented the parser it seems.
Btw Do we need to implement the D-Bus Api's for this? or a simple function implementation that retrieves and parse all the messages from the system directory, since we don’t have any message service running at the back-end.

Regards,
Gowtham