return SR_ERR_ARG;
case SP_ERR_FAIL:
error = sp_last_error_message();
- sr_err("Error opening port: %s.", error);
+ sr_err("Error opening port (%d): %s.",
+ sp_last_error_code(), error);
sp_free_error_message(error);
return SR_ERR;
}
return SR_ERR_ARG;
case SP_ERR_FAIL:
error = sp_last_error_message();
- sr_err("Error closing port: %s.", error);
+ sr_err("Error closing port (%d): %s.",
+ sp_last_error_code(), error);
sp_free_error_message(error);
return SR_ERR;
}
return SR_ERR_ARG;
case SP_ERR_FAIL:
error = sp_last_error_message();
- sr_err("Error flushing port: %s.", error);
+ sr_err("Error flushing port (%d): %s.",
+ sp_last_error_code(), error);
sp_free_error_message(error);
return SR_ERR;
}
return SR_ERR_ARG;
case SP_ERR_FAIL:
error = sp_last_error_message();
- sr_err("Write error: %s.", error);
+ sr_err("Write error (%d): %s.", sp_last_error_code(), error);
sp_free_error_message(error);
return SR_ERR;
}
return SR_ERR_ARG;
case SP_ERR_FAIL:
error = sp_last_error_message();
- sr_err("Read error: %s.", error);
+ sr_err("Read error (%d): %s.", sp_last_error_code(), error);
sp_free_error_message(error);
return SR_ERR;
}
return SR_ERR_ARG;
case SP_ERR_FAIL:
error = sp_last_error_message();
- sr_err("Error setting serial port parameters: %s.", error);
+ sr_err("Error setting serial port parameters (%d): %s.",
+ sp_last_error_code(), error);
sp_free_error_message(error);
return SR_ERR;
}