From owner-freebsd-bluetooth@FreeBSD.ORG Tue Jun 13 22:14:40 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 0C35316A47B for ; Tue, 13 Jun 2006 22:14:40 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail.ukfsn.org (s2.ukfsn.org [217.158.120.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8025243D45 for ; Tue, 13 Jun 2006 22:14:38 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: from rya-online.net (du213-130-141-11.as15444.net [213.130.141.11]) by mail.ukfsn.org (Postfix) with SMTP id C07CFE6F04; Tue, 13 Jun 2006 23:04:34 +0100 (BST) Received: (nullmailer pid 237 invoked by uid 1000); Tue, 13 Jun 2006 12:05:07 -0000 Date: Tue, 13 Jun 2006 13:05:07 +0100 (BST) To: Maksim Yevmenkin MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1150200307.649295.228.nullmailer@galant.ukfsn.org> From: Iain Hibbert 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: Tue, 13 Jun 2006 22:14:40 -0000 On Mon, 12 Jun 2006, Maksim Yevmenkin wrote: > > 1. sdp_open[_local]() may return a handle even though there is an error. > > 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 another world? :) > 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. I thought there was some generic 'unknown error' errno but I dont see it now - I guess for something protocol specific then EPROTO could be used. Actually, I'm not so sure that is some kind of fixed standard, if an error exists that is not covered then there are still unallocated numbers.. I would say though, that setting errno is exactly what a library is supposed to do - it conveys extra information rather than 'failed' and its not really abusing it to set it when an operation fails.. so far as I can see, its not just for (eg) libc. > > 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). Yeah, I thought that was probably the case - my thought was that the daemon would at least validate the array before publishing it which at least covers 'consistent', and since registering a profile is privileged then the 'correct' is up to the sysadmin (or, whoever wrote the client) > > 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 :( I might look at it again, just trying to finish something else now (and, my time has been limited for a few weeks) though I have to say, the SDP specification is not clear at all. I thought of some way, possibly extending the attrlist that you used for sdp_search() to specify values that could be automatically extracted and leaving all the parsing inside the library. > 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. I chose /usr/include/netbt just to match with the other protocol family directories (and BTPROTO_ aswell) - not sure what FreeBSD does, I guess netgraph complicates things but actually, exact location is not so important because mostly I think should be enough. I did think to move all the kernel stuff into xxxvar.h so that the files hci.h, l2cap.h, rfcomm.h etc would only contain the 'bluetooth' spec stuff though interdependencies get a bit confusing when you split the files up. I think, that it might go in as-is for now, as they are close to branching for 4.0 and it would be nice to be in for that, even if that means the API will change slightly later. regards, iain