Date: Sun, 18 May 2008 19:51:52 +0930 From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com> Cc: "freebsd-bluetooth@freebsd.org" <freebsd-bluetooth@freebsd.org> Subject: Re: cvs commit: src/usr.bin/bluetooth/rfcomm_sppd rfcomm_sppd.1 rfcomm_sppd.c Message-ID: <200805181952.00112.doconnor@gsoft.com.au> In-Reply-To: <bb4a86c70805150657m23d90dcdp681f454b45c72ea@mail.gmail.com> References: <200805141647.m4EGlUP1021019@repoman.freebsd.org> <200805151814.14386.doconnor@gsoft.com.au> <bb4a86c70805150657m23d90dcdp681f454b45c72ea@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 ~. <press ctrl-c in rfcomm_sppd terminal> ^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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805181952.00112.doconnor>