From owner-freebsd-bluetooth@FreeBSD.ORG Mon Jun 12 18:19:15 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D832C16A473 for ; Mon, 12 Jun 2006 18:19:15 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B0C143D46 for ; Mon, 12 Jun 2006 18:19:15 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate1b.savvis.net (Postfix) with ESMTP id 41AAA3C149; Mon, 12 Jun 2006 13:19:14 -0500 (CDT) Received: from mailgate1b.savvis.net ([127.0.0.1]) by localhost (mailgate1b.savvis.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 27065-01-11; Mon, 12 Jun 2006 13:19:14 -0500 (CDT) Received: from [10.254.186.111] (sntc04ep01.savvis.net [64.14.1.106]) by mailgate1b.savvis.net (Postfix) with ESMTP id C56C63BEE5; Mon, 12 Jun 2006 13:19:13 -0500 (CDT) Message-ID: <448DB020.2010409@savvis.net> Date: Mon, 12 Jun 2006 11:19:12 -0700 From: Maksim Yevmenkin User-Agent: Thunderbird 1.5.0.2 (X11/20060603) MIME-Version: 1.0 To: Iain Hibbert References: <1150023133.421908.1633.nullmailer@galant.ukfsn.org> In-Reply-To: <1150023133.421908.1633.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at savvis.net Cc: freebsd-bluetooth@freebsd.org Subject: Re: SDP X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2006 18:19:16 -0000 Iain, > in part of my work in Bluetooth for NetBSD* I just took the SDP > implementation from FreeBSD direct to get a leg up and didnt look at it > very much at first though I did make some changes, which basically > comprised: [...] sounds good > so what I have is still compatible at source level with FreeBSD. However, > in adding the headset support I took a better look and I'm not sure I like > the API exactly. I havent especially looked at the competing > implementations, took a glance at the BlueZ one but they dont seem strong > on documentation (and I didnt see any) and I'm hesitant to change the API > as what we really dont need is yet another incompatible implementation. > > Some things I am uneasy with then: > > 1. sdp_open[_local]() may return a handle even though there is an error. > Really, this is terrible! If there is an error in open, it should just > return NULL and set errno accordingly. sdp_error() should not be > necessary.. well, its just the personal taste, imo :) personally, i do not like when libraries (ab)use errno. while "errno-style" seems to be de-facto standard in unix world, sometimes, there is a need to have more sophisticated error reporting. in my personal experience, sometimes, i cannot find an adequate "errno" error to describe the nature of error. the existing sdp(3), imo, is a middle ground. > 2. to register a profile with the sdp daemon, the daemon itself must > already know about the profile, even though its just a string of binary. > It would be nice if a client program could just prepare this array and > send it. correct. the idea was to make sure that advertised sdp records are somewhat consistent (and correct), and, to make life a little bit easier for clients. i guess, we could add sdp_register_raw() what would simply use the data from the client (after running some consistency checks). > 3. parsing results of an sdp query is annoyingly ugly, it would be nice if > there was some lib function that could be used to extract values from the > result in a generic way. ahem... there *were* supposed to be helper functions, a-la sdp_get_next_whatever() to simply advance pointers and copy data from them. i just never got around to write them :( > So well, I'm not so sure if anybody else besides Max has done any work in > this arena, but any input is good.. your comments are very good. thanks a lot. > *latest archive is http://homepages.rya-online.net/plunky/netbt.32.tar.gz i took a brief look at this. it looks really good. i think we should start and integrate our headers, i.e. make them the same and move them into some reasonable please, say, /usr/include/bluetooth it certainly would be possible to get rid of NG_ prefix in freebsd include files and do other tweaks as well. thanks, max