|
From: Peter K. <pk...@us...> - 2001-03-09 16:22:03
|
The following file was modified in apps/bluetooth/btd:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.85 1.86=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Turn off pty echo in open_pty() (by Matthias Fuchs).
The diff of the modified file(s):
--- btd.c 2001/03/09 13:18:02 1.85
+++ btd.c 2001/03/09 16:23:51 1.86
@@ -207,7 +207,6 @@
extern int bt_read_proc(char *buf, int len);
bt_stat_struct bt_stat;
static int bt_initdone =3D 0;
-static int ready_for_ppp =3D 0;
rfcomm_con *test_rfcomm;
int test_dlci;
=20
@@ -936,10 +935,6 @@
static void start_pppd(void)
{
=20=20=20
-#ifdef BTD_USERSTACK
- ready_for_ppp =3D 1;
-#endif
-
/* run pppd in a child */
if (!(pppd_pid =3D vfork()))
{
@@ -978,11 +973,6 @@
syslog(LOG_ERR, "Failed to return IP address to IPA\n");
}
#endif
-
-#ifdef BTD_USERSTACK
- ready_for_ppp =3D 0;
-#endif
-
}=20
=20
/* FIXME -- use separate options file 'pppd file <optionfile>' for=20
@@ -2212,10 +2202,38 @@
*/
int open_pty(void)
{
+ struct termios settings;
+ int result;
+
+
printf("Open pty.\n");
- return openpty(&pty_master_fd, &pty_slave_fd, ptydev, NULL, NULL);
+ result =3D openpty(&pty_master_fd, &pty_slave_fd, ptydev, NULL, NULL);
+ if (result < 0)
+ {
+ perror("openpty");
+ return result;
}
=20
+ /* modify pty settinges -> turn off echo - mfuchs */
+ result =3D tcgetattr(pty_master_fd, &settings);
+ if (result < 0)
+ {
+ perror("tcgetattr");
+ return result;
+ }
+
+ cfmakeraw(&settings);
+ settings.c_lflag &=3D ~ECHO;
+
+ result =3D tcsetattr(pty_master_fd, TCSANOW, &settings);
+ if (result < 0)
+ {
+ perror("tcsetattr");
+ return result;
+ }
+ return 0;
+}
+
/* Create a thread that reads data from the pty and=20
passes it to the rfcomm layer */
int init_pty_thread(void)
@@ -2308,11 +2326,6 @@
return len;
}
=20=20=20
- /* FIXME -- why is data echoed back if no application is running on top=
=20
- of PTY ?? */
- if (!ready_for_ppp)
- return len;
-
/* feed this to PTY connected to pppd or whatever application=20
that may be running there... */
=20=20=20
|