Add std_serial_dev_close() function.
This commit is contained in:
parent
7faa3e8821
commit
043e899a51
|
@ -190,6 +190,7 @@ SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi,
|
|||
const char *prefix);
|
||||
SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
|
||||
std_dev_clear_t clear_private);
|
||||
SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi);
|
||||
|
||||
/*--- strutil.c -------------------------------------------------------------*/
|
||||
|
||||
|
|
13
std.c
13
std.c
|
@ -230,3 +230,16 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SR_PRIV int std_serial_close(struct sr_dev_inst *sdi)
|
||||
{
|
||||
struct sr_serial_dev_inst *serial;
|
||||
|
||||
serial = sdi->conn;
|
||||
if (serial && serial->fd != -1) {
|
||||
serial_close(serial);
|
||||
sdi->status = SR_ST_INACTIVE;
|
||||
}
|
||||
|
||||
return SR_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue