]> sigrok.org Git - libsigrok.git/commitdiff
serial: Use new sp_set_config instead of sp_set_params.
authorMartin Ling <redacted>
Thu, 14 Nov 2013 18:52:57 +0000 (18:52 +0000)
committerUwe Hermann <redacted>
Tue, 19 Nov 2013 13:26:18 +0000 (14:26 +0100)
hardware/common/serial.c

index 05e6f3b4eb4768c4e244582e18d7944c092b49f4..75c4a47d6e69f89b197892d9504d3c9eb2471b55 100644 (file)
@@ -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: