From owner-freebsd-bluetooth@FreeBSD.ORG Sun May 18 10:47:04 2008 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C55E106567A for ; Sun, 18 May 2008 10:47:04 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 087C68FC13 for ; Sun, 18 May 2008 10:47:02 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (ppp121-45-62-238.lns11.adl2.internode.on.net [121.45.62.238]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id m4IAM3Ve023733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 18 May 2008 19:52:04 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: "Maksim Yevmenkin" Date: Sun, 18 May 2008 19:51:52 +0930 User-Agent: KMail/1.9.7 References: <200805141647.m4EGlUP1021019@repoman.freebsd.org> <200805151814.14386.doconnor@gsoft.com.au> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2164479.fP3nVeyr0z"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200805181952.00112.doconnor@gsoft.com.au> X-Spam-Score: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-bluetooth@freebsd.org" Subject: Re: cvs commit: src/usr.bin/bluetooth/rfcomm_sppd rfcomm_sppd.1 rfcomm_sppd.c 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: Sun, 18 May 2008 10:47:04 -0000 --nextPart2164479.fP3nVeyr0z Content-Type: multipart/mixed; boundary="Boundary-01=_CNAMI8LKV8p4ImY" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_CNAMI8LKV8p4ImY Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, 15 May 2008, Maksim Yevmenkin wrote: > > How hard would it be to have a '-t auto' and have it print out the > > pty it just allocated? It would make it much easier for scripts to > > work if that was possible. > > > > (Maybe just call openpty()?) > > not hard at all. however, how would rfcomm_sppd(1) print tty name if, > say, it was asked to run in background? perhaps it would be better to > teach rfcomm_sppd(1) to work with nmdm(4)? I don't think nmdm would make a difference in this respect. I am thinking of an operating mode where a script or daemon runs when a=20 device associates and sets up channels the user has configured. So the=20 script runs rfcomm_sppd and groks the output to find what PTY has been=20 allocated and creates a symlink to a human understandable name=20 (eg /dev/gps0 or whatever) I have attached a patch which uses openpty() and seems to work fine=20 (tested quickly against my BT GPS unit & phone). If the patch doesn't=20 make it you can get it from=20 http://www.gsoft.com.au/~doconnor/rfcomm_sppd-pty.diff On a related note I find I have to 'kill -9' rfcomm_sppd sometimes if I=20 have connected to the PTY and then disconnected, eg.. > sudo ./rfcomm_sppd -t -a GPS rfcomm_sppd[43683]: Starting on /dev/ttyp5 > sudo cu -l /dev/ttyp5 ~. ^Crfcomm_sppd[43683]: Signal 2 received. Total 1 signals received > sudo cu -l /dev/ttyp5 rfcomm_sppd[43683]: Completed on /dev/ttyp5 I can't reproduce it very often though - I have had it happen quite a=20 bit in the past though. PS please CC me as I am not on the list. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --Boundary-01=_CNAMI8LKV8p4ImY-- --nextPart2164479.fP3nVeyr0z Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iD8DBQBIMANI5ZPcIHs/zowRAlJ2AJsHvdVQWZtLccSzi3TcbLhQTZH+VACeMlwy rFpybRFYSu37JoWFplDEpoU= =VK87 -----END PGP SIGNATURE----- --nextPart2164479.fP3nVeyr0z--