serial: Use new sp_set_config instead of sp_set_params.
This commit is contained in:
parent
066d42b1c8
commit
e385e2ed90
|
@ -277,6 +277,7 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char *error;
|
char *error;
|
||||||
|
struct sp_port_config config;
|
||||||
|
|
||||||
if (!serial) {
|
if (!serial) {
|
||||||
sr_dbg("Invalid serial port.");
|
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,
|
sr_spew("Setting serial parameters on port %s (fd %d).", serial->port,
|
||||||
serial->fd);
|
serial->fd);
|
||||||
|
|
||||||
ret = sp_set_params(serial->data, baudrate, bits, parity, stopbits,
|
config.baudrate = baudrate;
|
||||||
flowcontrol, rts, dtr);
|
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) {
|
switch (ret) {
|
||||||
case SP_ERR_ARG:
|
case SP_ERR_ARG:
|
||||||
|
|
Loading…
Reference in New Issue