This call was previously nonblocking, but there is no handling of partial
writes. It is called from config_set where it is free to block.
Also fix error handling: serial_write can return any negative error code,
not just -1.
params[0] = 5;
params[1] = 5;
create_cmd_14(devc->addr, 6, params, msg);
- if (serial_write(sdi->conn, msg, sizeof(msg)) == -1)
+ if (serial_write_blocking(sdi->conn, msg, sizeof(msg)) < 0)
return SR_ERR;
else
g_usleep(2000000); /* Wait to ensure transfer before interface switched off. */