The unified diff between revisions [8a242f0b..] and [7087b631..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'svr-chansession.c'
#
#
# patch "svr-chansession.c"
# from [dab4b6dd7a8d03c86f357d5e9511b9a9985f055e]
# to [bd6a54e7ec2a89714d0e2c95cb4a3c567b3abf42]
#
============================================================
--- svr-chansession.c dab4b6dd7a8d03c86f357d5e9511b9a9985f055e
+++ svr-chansession.c bd6a54e7ec2a89714d0e2c95cb4a3c567b3abf42
@@ -647,6 +647,7 @@ static void serial_connect(struct Channe
static void serial_connect(struct Channel *channel) {
int serial_fd;
+ struct termios options;
TRACE(("enter serial_connect"))
@@ -659,8 +660,25 @@ static void serial_connect(struct Channe
}
TRACE(("success serial_connect"))
- /* XXX TODO - code to set the serial fd to the right baud/settings etc */
+ /* set some serial options. XXX needs attention */
+ tcgetattr(serial_fd, &options);
+
+ cfsetispeed(&options, B9600);
+ cfsetospeed(&options, B9600);
+
+ options.c_cflag &= ~CSIZE; /* Mask the character size bits */
+ options.c_cflag |= CS8; /* Select 8 data bits */
+ options.c_cflag &= ~PARENB;
+ options.c_cflag &= ~CSTOPB;
+ options.c_cflag &= ~CSIZE;
+
+ options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
+ options.c_iflag |= (INPCK | ISTRIP);
+
+ tcsetattr(serial_fd, TCSANOW, &options);
+
+
ses.maxfd = MAX(serial_fd, channel->writefd);
setnonblocking(serial_fd);