serial: Use new sp_set_config instead of sp_set_params.

This commit is contained in:
Martin Ling 2013-11-14 18:52:57 +00:00 committed by Uwe Hermann
parent 066d42b1c8
commit e385e2ed90
1 changed files with 10 additions and 2 deletions

View 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: