This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
- if ((ret = serial_write(serial, cmd, strlen(cmd))) < 0) {
+ if ((ret = serial_write_blocking(serial, cmd, strlen(cmd))) < 0) {
sr_err("Error sending '%s' command: %d.", cmd, ret);
return SR_ERR;
}
sr_err("Error sending '%s' command: %d.", cmd, ret);
return SR_ERR;
}