From owner-freebsd-bluetooth@FreeBSD.ORG Thu Oct 27 21:53:28 2005 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 91EE816A424; Thu, 27 Oct 2005 21:53:28 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8B0143D48; Thu, 27 Oct 2005 21:53:27 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id j9RLrPJ31507; Thu, 27 Oct 2005 17:53:25 -0400 Message-ID: <43614C53.7020207@savvis.net> Date: Thu, 27 Oct 2005 14:53:23 -0700 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Niki Denev References: <200510271844.52361.nike_d@cytexbg.com> <43610BBE.4070406@savvis.net> <200510272032.26480.nike_d@cytexbg.com> In-Reply-To: <200510272032.26480.nike_d@cytexbg.com> Content-Type: multipart/mixed; boundary="------------020104060604000501010300" Cc: freebsd-bluetooth@freebsd.org, freebsd-current@freebsd.org Subject: Re: rfcomm problems 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: Thu, 27 Oct 2005 21:53:28 -0000 This is a multi-part message in MIME format. --------------020104060604000501010300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Niki, >> have you tried to specify >> >> set device "!/usr/bin/rfcomm_sppd -a gsm -c 1" >> >> inside your /etc/ppp/ppp.conf file? this way ppp(8) will start >> rfcomm_sppd(1) automatically and will use its stdin/stdout. > > No, but i've tried it now and it works! Thank you! sure >> i should probably fix it just to avoid confusion. please find attached patch. the patch will put stdin/stdout into 'raw' mode when no tty was specified. it should fix the problem you were having. keep in mind that there is no escape sequence, so you have to kill rfcomm_sppd(1) by hand to terminate the session. could you please try to use rfcomm_sppd(1) in both stdin/stdout mode and in 'set device ...' ppp(8) mode. >>> When i start rfcomm_pppd the ppp daemon begins to write in the >>> log that he is talking to himself (several "magic is same" >>> errors, and disconnect) >> >> hmmm... thats strange... rfcomm_pppd(8) should not have this >> problem. > > i can test patches, provide more info, etc.. if needed. could you please post /etc/ppp/ppp.conf entry you where using with rfcomm_pppd? thanks, max --------------020104060604000501010300 Content-Type: text/plain; name="rfcomm_sppd.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rfcomm_sppd.patch.txt" Index: rfcomm_sppd.1 =================================================================== RCS file: /usr/local/cvs/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1,v retrieving revision 1.6 diff -u -r1.6 rfcomm_sppd.1 --- rfcomm_sppd.1 3 Nov 2004 20:16:02 -0000 1.6 +++ rfcomm_sppd.1 27 Oct 2005 21:44:49 -0000 @@ -91,6 +91,10 @@ .It Fl t Ar tty Slave pseudo tty name. If not set stdin/stdout will be used. +All input and output processing on stdin/stdout will be disabled, +giving a +.Dq raw I/O +path. This option is required if .Fl b option was specified. Index: rfcomm_sppd.c =================================================================== RCS file: /usr/local/cvs/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c,v retrieving revision 1.8 diff -u -r1.8 rfcomm_sppd.c --- rfcomm_sppd.c 3 Nov 2004 20:16:02 -0000 1.8 +++ rfcomm_sppd.c 27 Oct 2005 21:34:29 -0000 @@ -73,6 +73,7 @@ int n, background, channel, s, amaster, aslave, fd; fd_set rfd; char *tty = NULL, buf[SPPD_BUFFER_SIZE]; + struct termios defterm, term; memcpy(&addr, NG_HCI_BDADDR_ANY, sizeof(addr)); background = channel = 0; @@ -118,6 +119,9 @@ usage(); /* NOT REACHED */ + if (tty == NULL && background) + errx(1, "Must specify tty name to run in background mode"); + /* Set signal handlers */ memset(&sa, 0, sizeof(sa)); sa.sa_handler = sppd_sighandler; @@ -147,11 +151,13 @@ /* Open TTYs */ if (tty == NULL) { - if (background) - usage(); - amaster = STDIN_FILENO; fd = STDOUT_FILENO; + + tcgetattr(amaster, &defterm); + term = defterm; + cfmakeraw(&term); + tcsetattr(amaster, TCSADRAIN, &term); } else { if (sppd_ttys_open(tty, &amaster, &aslave) < 0) exit(1); @@ -159,7 +165,6 @@ fd = amaster; } - /* Open RFCOMM connection */ memset(&ra, 0, sizeof(ra)); ra.rfcomm_len = sizeof(ra); @@ -264,7 +269,8 @@ if (tty != NULL) { close(aslave); close(amaster); - } + } else + tcsetattr(amaster, TCSADRAIN, &defterm); return (0); } --------------020104060604000501010300--