From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 12 17:34:42 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 C523616A404 for ; Wed, 12 Apr 2006 17:34:42 +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 5C08D43D46 for ; Wed, 12 Apr 2006 17:34:42 +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 957823BE6C; Wed, 12 Apr 2006 12:34:41 -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 21009-01-8; Wed, 12 Apr 2006 12:34:41 -0500 (CDT) Received: from [10.254.186.111] (sntc04ep01.savvis.net [64.14.1.106]) by mailgate1b.savvis.net (Postfix) with ESMTP id 21C823BE60; Wed, 12 Apr 2006 12:34:41 -0500 (CDT) Message-ID: <443D3A30.2020109@savvis.net> Date: Wed, 12 Apr 2006 10:34:40 -0700 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Iain Hibbert References: <20060314181140.GB6870@lbl.pl> <44170EDA.5000406@savvis.net> <1144841743.207833.9946.nullmailer@galant.ukfsn.org> In-Reply-To: <1144841743.207833.9946.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: amavisd-new at savvis.net Cc: freebsd-bluetooth@freebsd.org Subject: Re: headset/sco support in freebsd 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: Wed, 12 Apr 2006 17:34:42 -0000 Iain, >> i have not committed it yet. there is also a bluetooth sco sockets >> layer to simplify programming api. > > Max, I am working on this now for NetBSD - I had it in mind to use > SOCK_STREAM type with 'HCI' protocol for this but I notice that BlueZ > have declared a BTPROTO_SCO and are using SOCK_SEQPACKET instead. > > My feeling is that I am going with SOCK_STREAM since its clearly a > stream of data, do you have an opinion? well, yes and no. "yes" because sco primary goal is to carry audio/video streams. "no" is because of bluetooth specific. SOCK_STREAM "... provides sequenced, reliable, two-way, connection-based byte streams ..." SOCK_DGRAM "... datagrams (connectionless, unreliable mesĀ­sages of a fixed maximum length) ..." SOCK_SEQPACKET "... provides a sequenced, reliable, two-way connection based data transmission path for datagrams of fixed maximum length; a consumer is required to read an entire packet with each read system call ..." please keep in mind that sco is not really a protocol. it is more of a transport. sco has fixed packet length. sco is not reliable. the way i understand it, sco packets cannot be re-ordered but can be dropped. imo, none of the SOCK_xxx types describes sco exactly. to me its either SOCK_DGRAM/SOCK_SEQPACKET (more preferred) or SOCK_STREAM (less preferred). in my code, i opted for SOCK_SEQPACKET (just like linux) to describe properties of sco "protocol/transport". i guess, it is up to the one who implements sco sockets to choose if SOCK_xxx type describes "protocol" properties or what "protocol" can be used for. in other words sco "protocol" has (some) SOCK_SEQPACKET properties vs. sco "protocol" is/can be used to transfer SOCK_STREAM type of data. thanks, max