- if (serial_write(serial, buf, sizeof(buf)) == -1) {
- sr_err("Write error for cmd=%c: %d %s", cmd, errno, strerror(errno));
+ if (serial_write_blocking(serial, buf, sizeof(buf),
+ serial_timeout(serial, sizeof(buf))) < (int)sizeof(buf)) {
+ sr_err("Write error for cmd=%c", cmd);