Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jun 2006 20:43:10 +0100 (BST)
From:      Iain Hibbert <plunky@rya-online.net>
To:        Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: SDP
Message-ID:  <1150486990.380039.25644.nullmailer@galant.ukfsn.org>
In-Reply-To: <4492E9FA.2030708@savvis.net>
References:  <1150200307.649295.228.nullmailer@galant.ukfsn.org> <44904A60.6080105@savvis.net> <1150322381.757072.1713.nullmailer@galant.ukfsn.org> <4492E9FA.2030708@savvis.net>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1397750121-1150486990=:22008
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Fri, 16 Jun 2006, Maksim Yevmenkin wrote:

> > > sdp(3) client knows *exactly* what the format of the
> > > attributes should be. so, sdp(3) library should provide simple api to
> > > locate
> > > given element of given type in raw data and extract data from it. imo,
> > > more
> > > intelligent parsing could require sdp(3) to actually know about the
> > > profile
> > > client is trying use.
> >
> > Yes was thinking along those lines.. the client would provide a structure
> > detailing how to parse the required attributes where to put the values.
>
> may be. so far i have not seen a need for that.

I looked at the BlueZ implementation and for the sdp query function, they
parse the flat results and return a linked list then have a bunch of extra
functions that extract specific values. See attached file for example in
use to find SPP (ie RFCOMM channel)

It does look neater, but I'm not sure I like the exact concept.

iain
--0-1397750121-1150486990=:22008
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=sdp.c
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.64.0606162043100.22008@localhost.>
Content-Description: cups/sdp.c
Content-Disposition: attachment; filename=sdp.c

LyoNCiAqDQogKiAgQmx1ZVogLSBCbHVldG9vdGggcHJvdG9jb2wgc3RhY2sg
Zm9yIExpbnV4DQogKg0KICogIENvcHlyaWdodCAoQykgMjAwMy0yMDA0ICBN
YXJjZWwgSG9sdG1hbm4gP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aGFubmVsID0gY2g7DQoJCQkJcmV0dXJuIDA7DQoJCQl9DQoJCX0NCgl9DQoN
CglyZXR1cm4gLTE7DQp9DQo=

--0-1397750121-1150486990=:22008--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1150486990.380039.25644.nullmailer>