* [PATCH] Modify PBAP SDP record. @ 2009-08-06 20:03 Jaikumar Ganesh 2009-08-06 20:09 ` Marcel Holtmann 0 siblings, 1 reply; 4+ messages in thread From: Jaikumar Ganesh @ 2009-08-06 20:03 UTC (permalink / raw) To: linux-bluetooth; +Cc: Zhu Lan From: Zhu Lan <mtcb47@motorola.com> Fix to pass PTS case TC_SDAS_BV_03_I(since PTS3.2 update2). The code tried to append the UINT type value to the supported respositories. However, the wrong function sdp_seq_alloc() was used. This function adds 2 redundant bytes (SDP_SEQ8 as 0x35, seq) ahead of 0x08, so that latest PTS IOPT will fail. According to spec, PBAP attributes should report 0x08 0x01 or 0x08 0x03 right after 0x0314. The correct function to use is sdp_data_alloc(), with clean 0x08 0x01 appended as SDP_ATTR_SUPPORTED_REPOSITORIES. --- tools/sdptool.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/sdptool.c b/tools/sdptool.c index 5fddb82..c1fdcd4 100644 --- a/tools/sdptool.c +++ b/tools/sdptool.c @@ -1829,7 +1829,7 @@ static int add_pbap(sdp_session_t *session, svc_info_t *si) sdp_record_t record; uint8_t chan = si->channel ? si->channel : 19; sdp_data_t *channel; - uint8_t formats[] = {0x03}; + uint8_t formats[] = {0x01}; void *dtds[sizeof(formats)], *values[sizeof(formats)]; int i; uint8_t dtd = SDP_UINT8; @@ -1869,12 +1869,7 @@ static int add_pbap(sdp_session_t *session, svc_info_t *si) aproto = sdp_list_append(0, apseq); sdp_set_access_protos(&record, aproto); - - for (i = 0; i < sizeof(formats); i++) { - dtds[i] = &dtd; - values[i] = &formats[i]; - } - sflist = sdp_seq_alloc(dtds, values, sizeof(formats)); + sflist = sdp_data_alloc(dtd,formats); sdp_attr_add(&record, SDP_ATTR_SUPPORTED_REPOSITORIES, sflist); sdp_set_info_attr(&record, "OBEX Phonebook Access Server", 0, 0); -- 1.6.2.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Modify PBAP SDP record. 2009-08-06 20:03 [PATCH] Modify PBAP SDP record Jaikumar Ganesh @ 2009-08-06 20:09 ` Marcel Holtmann 2009-08-06 21:00 ` Jaikumar Ganesh 0 siblings, 1 reply; 4+ messages in thread From: Marcel Holtmann @ 2009-08-06 20:09 UTC (permalink / raw) To: Jaikumar Ganesh; +Cc: linux-bluetooth, Zhu Lan Hi Jaikumar, > Fix to pass PTS case TC_SDAS_BV_03_I(since PTS3.2 update2). > The code tried to append the UINT type value to the supported > respositories. However, the wrong function sdp_seq_alloc() > was used. This function adds 2 redundant bytes (SDP_SEQ8 as > 0x35, seq) ahead of 0x08, so that latest PTS IOPT will fail. > According to spec, PBAP attributes should report 0x08 0x01 > or 0x08 0x03 right after 0x0314. The correct function to use > is sdp_data_alloc(), with clean 0x08 0x01 appended as > SDP_ATTR_SUPPORTED_REPOSITORIES. > --- > tools/sdptool.c | 9 ++------- > 1 files changed, 2 insertions(+), 7 deletions(-) can I get a version of this patch that applies cleanly when using git am please. Regards Marcel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Modify PBAP SDP record. 2009-08-06 20:09 ` Marcel Holtmann @ 2009-08-06 21:00 ` Jaikumar Ganesh 2009-08-06 21:12 ` Marcel Holtmann 0 siblings, 1 reply; 4+ messages in thread From: Jaikumar Ganesh @ 2009-08-06 21:00 UTC (permalink / raw) To: Marcel Holtmann; +Cc: linux-bluetooth, Zhu Lan [-- Attachment #1.1: Type: text/plain, Size: 892 bytes --] Hi Marcel, On Thu, Aug 6, 2009 at 1:09 PM, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Jaikumar, > > > Fix to pass PTS case TC_SDAS_BV_03_I(since PTS3.2 update2). > > The code tried to append the UINT type value to the supported > > respositories. However, the wrong function sdp_seq_alloc() > > was used. This function adds 2 redundant bytes (SDP_SEQ8 as > > 0x35, seq) ahead of 0x08, so that latest PTS IOPT will fail. > > According to spec, PBAP attributes should report 0x08 0x01 > > or 0x08 0x03 right after 0x0314. The correct function to use > > is sdp_data_alloc(), with clean 0x08 0x01 appended as > > SDP_ATTR_SUPPORTED_REPOSITORIES. > > --- > > tools/sdptool.c | 9 ++------- > > 1 files changed, 2 insertions(+), 7 deletions(-) > > can I get a version of this patch that applies cleanly when using git am > please. Attached. Thanks > > > Regards > > Marcel > > > [-- Attachment #1.2: Type: text/html, Size: 1475 bytes --] [-- Attachment #2: 0001-Modify-PBAP-SDP-record.patch --] [-- Type: text/x-diff, Size: 1751 bytes --] From d002cc2fdea61b836709bcf7735679e0018d9826 Mon Sep 17 00:00:00 2001 From: Zhu Lan <mtcb47@motorola.com> Date: Mon, 3 Aug 2009 17:19:39 +0800 Subject: [PATCH] Modify PBAP SDP record. Fix to pass PTS case TC_SDAS_BV_03_I(since PTS3.2 update2). The code tried to append the UINT type value to the supported respositories. However, the wrong function sdp_seq_alloc() was used. This function adds 2 redundant bytes (SDP_SEQ8 as 0x35, seq) ahead of 0x08, so that latest PTS IOPT will fail. According to spec, PBAP attributes should report 0x08 0x01 or 0x08 0x03 right after 0x0314. The correct function to use is sdp_data_alloc(), with clean 0x08 0x01 appended as SDP_ATTR_SUPPORTED_REPOSITORIES. --- tools/sdptool.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/sdptool.c b/tools/sdptool.c index 8b122b9..d0a56e2 100644 --- a/tools/sdptool.c +++ b/tools/sdptool.c @@ -1829,7 +1829,7 @@ static int add_pbap(sdp_session_t *session, svc_info_t *si) sdp_record_t record; uint8_t chan = si->channel ? si->channel : 19; sdp_data_t *channel; - uint8_t formats[] = {0x03}; + uint8_t formats[] = {0x01}; void *dtds[sizeof(formats)], *values[sizeof(formats)]; unsigned int i; uint8_t dtd = SDP_UINT8; @@ -1869,12 +1869,7 @@ static int add_pbap(sdp_session_t *session, svc_info_t *si) aproto = sdp_list_append(0, apseq); sdp_set_access_protos(&record, aproto); - - for (i = 0; i < sizeof(formats); i++) { - dtds[i] = &dtd; - values[i] = &formats[i]; - } - sflist = sdp_seq_alloc(dtds, values, sizeof(formats)); + sflist = sdp_data_alloc(dtd,formats); sdp_attr_add(&record, SDP_ATTR_SUPPORTED_REPOSITORIES, sflist); sdp_set_info_attr(&record, "OBEX Phonebook Access Server", 0, 0); -- 1.6.2.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Modify PBAP SDP record. 2009-08-06 21:00 ` Jaikumar Ganesh @ 2009-08-06 21:12 ` Marcel Holtmann 0 siblings, 0 replies; 4+ messages in thread From: Marcel Holtmann @ 2009-08-06 21:12 UTC (permalink / raw) To: Jaikumar Ganesh; +Cc: linux-bluetooth, Zhu Lan Hi Jaikumar, > > Fix to pass PTS case TC_SDAS_BV_03_I(since PTS3.2 update2). > > The code tried to append the UINT type value to the > supported > > respositories. However, the wrong function sdp_seq_alloc() > > was used. This function adds 2 redundant bytes (SDP_SEQ8 as > > 0x35, seq) ahead of 0x08, so that latest PTS IOPT will fail. > > According to spec, PBAP attributes should report 0x08 0x01 > > or 0x08 0x03 right after 0x0314. The correct function to use > > is sdp_data_alloc(), with clean 0x08 0x01 appended as > > SDP_ATTR_SUPPORTED_REPOSITORIES. > > --- > > tools/sdptool.c | 9 ++------- > > 1 files changed, 2 insertions(+), 7 deletions(-) > > > can I get a version of this patch that applies cleanly when > using git am > please. > > Attached. make[2]: Entering directory `/data/devel/bluez/tools' CC sdptool.o gcc1: warnings being treated as errors sdptool.c: In function ‘add_pbap’: sdptool.c:1834: error: unused variable ‘i’ sdptool.c:1833: error: unused variable ‘values’ sdptool.c:1833: error: unused variable ‘dtds’ I thought that I make myself clear that every patch has to compile without any compiler warnings. What is this here? We hack around as we like and don't bother? Use freaking --enable-maintainer-mode or set the same compiler options BlueZ uses upstream. Patch pushed and also fixed now. Regards Marcel ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-06 21:12 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-08-06 20:03 [PATCH] Modify PBAP SDP record Jaikumar Ganesh 2009-08-06 20:09 ` Marcel Holtmann 2009-08-06 21:00 ` Jaikumar Ganesh 2009-08-06 21:12 ` Marcel Holtmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox