sr_spew("Opening serial port '%s' (flags %d).", serial->port, flags);
- ret = sp_open(&serial->data, serial->port, flags);
+ sp_get_port_by_name(serial->port, &serial->data);
+
+ ret = sp_open(serial->data, flags);
switch (ret)
{
}
#ifndef _WIN32
- serial->fd = serial->data.fd;
+ serial->fd = serial->data->fd;
#endif
if (serial->serialcomm)
sr_spew("Closing serial port %s (fd %d).", serial->port, serial->fd);
ret = SR_OK;
- ret = sp_close(&serial->data);
+ ret = sp_close(serial->data);
switch (ret)
{
sr_spew("Flushing serial port %s (fd %d).", serial->port, serial->fd);
- ret = sp_flush(&serial->data);
+ ret = sp_flush(serial->data);
switch (ret)
{
return -1;
}
- ret = sp_write(&serial->data, buf, count);
+ ret = sp_write(serial->data, buf, count);
switch (ret)
{
return -1;
}
- ret = sp_read(&serial->data, buf, count);
+ ret = sp_read(serial->data, buf, count);
switch (ret)
{
sr_spew("Setting serial parameters on port %s (fd %d).", serial->port,
serial->fd);
- ret = sp_set_params(&serial->data, baudrate, bits, parity, stopbits,
+ ret = sp_set_params(serial->data, baudrate, bits, parity, stopbits,
flowcontrol, rts, dtr);
switch (ret)