Hi Zhenhua, >> static void server_destroy(gpointer user) >> @@ -706,15 +825,11 @@ static void server_destroy(gpointer user) >> >> static void set_raw_mode(int fd) >> { >> - struct termios options; >> - >> - tcgetattr(fd,&options); >> - >> - /* Set TTY as raw mode to disable echo back of input characters >> - * when they are received from Modem to avoid feedback loop */ >> - options.c_lflag&= ~(ICANON | ECHO | ECHOE | ISIG); + struct >> termios ti; >> >> - tcsetattr(fd, TCSANOW,&options); >> + tcflush(fd, TCIOFLUSH); >> + cfmakeraw(&ti); >> + tcsetattr(fd, TCSANOW,&ti); >> } >> >> static gboolean create_tty(const char *modem_path) > > I found above changes does not contain latest git tree. The part of change is necessary when I tried to use bluetooth serial proxy between two machines. Without cfmakeraw, the server responses: > '\r\nOK\r\n' > would change to: > '\n\nOK\n\n' > > And this issue doesn't exist if both server and client on the same machine. The above code was causing valgrind to complain, so I left it out, apologies for not mentioning it, had a bit of a filesystem disaster happen after I pushed :) The present code seems to be completely in line with man cfmakeraw. The cause is probably more subtle or has to do with the RFCOMM tty layer in the kernel. Could you please investigate some more? Regards, -Denis