From: Martin Ling Date: Thu, 14 Nov 2013 18:52:57 +0000 (+0000) Subject: serial: Use new sp_set_config instead of sp_set_params. X-Git-Tag: libsigrok-0.3.0~552 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e385e2ed90d9f66ed72124c8c4c9a04f771fe5e1;p=libsigrok.git serial: Use new sp_set_config instead of sp_set_params. --- diff --git a/hardware/common/serial.c b/hardware/common/serial.c index 05e6f3b4..75c4a47d 100644 --- a/hardware/common/serial.c +++ b/hardware/common/serial.c @@ -277,6 +277,7 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate, { int ret; char *error; + struct sp_port_config config; if (!serial) { sr_dbg("Invalid serial port."); @@ -292,8 +293,15 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate, sr_spew("Setting serial parameters on port %s (fd %d).", serial->port, serial->fd); - ret = sp_set_params(serial->data, baudrate, bits, parity, stopbits, - flowcontrol, rts, dtr); + config.baudrate = baudrate; + config.bits = bits; + config.parity = parity; + config.stopbits = stopbits; + config.flowcontrol = flowcontrol; + config.rts = rts; + config.dtr = dtr; + + ret = sp_set_config(serial->data, &config); switch (ret) { case SP_ERR_ARG: