From ff25699ae2f5cec72b263e1960c96d00b23bf6fc Mon Sep 17 00:00:00 2001 From: svchao Date: Fri, 17 Dec 2021 13:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E4=BD=8D9?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modbus-rtu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modbus-rtu.c b/src/modbus-rtu.c index a25b965..4523622 100644 --- a/src/modbus-rtu.c +++ b/src/modbus-rtu.c @@ -693,7 +693,7 @@ static int _modbus_rtu_connect(modbus_t *ctx) tios.c_cflag |= (CREAD | CLOCAL); /* CSIZE, HUPCL, CRTSCTS (hardware flow control) */ - /* Set data bits (5, 6, 7, 8 bits) + /* Set data bits (5, 6, 7, 8, 9, bits) CSIZE Bit mask for data bits */ tios.c_cflag &= ~CSIZE; @@ -707,6 +707,9 @@ static int _modbus_rtu_connect(modbus_t *ctx) case 7: tios.c_cflag |= CS7; break; + case 9: + tios.c_cflag |= CS9; + break; case 8: default: tios.c_cflag |= CS8;