sr: session: Deprecate sr_session_halt()
sr_session_halt() in its current state is kind of useless and even dangerous. All it will do is mark the session as not running, but wont signal the devices to stop to capture data. This is not so much of a problem with the blocking sr_session_run(), but once there is support for asynchronous data acquisition by attaching the session sources to the applications mainloop sr_session_halt() basically becomes a no-op. sr_session_stop() already does what needs to be done, marking the session as not running and signal the devices to stop acquisition, so make sr_session_halt() an alias for sr_session_stop() and deprecate its usage. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
9213ad012a
commit
9ffbde0e84
15
session.c
15
session.c
|
@ -321,22 +321,15 @@ SR_API int sr_session_run(void)
|
||||||
/**
|
/**
|
||||||
* Halt the current session.
|
* Halt the current session.
|
||||||
*
|
*
|
||||||
* This requests the current session be stopped as soon as possible, for
|
* This function is deprecated and should not be used in new code, use
|
||||||
* example on receiving an SR_DF_END packet.
|
* sr_session_stop() instead. The behaviour of this function is identical to
|
||||||
|
* sr_session_stop().
|
||||||
*
|
*
|
||||||
* @return SR_OK upon success, SR_ERR_BUG if no session exists.
|
* @return SR_OK upon success, SR_ERR_BUG if no session exists.
|
||||||
*/
|
*/
|
||||||
SR_API int sr_session_halt(void)
|
SR_API int sr_session_halt(void)
|
||||||
{
|
{
|
||||||
if (!session) {
|
return sr_session_stop();
|
||||||
sr_err("session: %s: session was NULL", __func__);
|
|
||||||
return SR_ERR_BUG;
|
|
||||||
}
|
|
||||||
|
|
||||||
sr_info("session: halting");
|
|
||||||
session->running = FALSE;
|
|
||||||
|
|
||||||
return SR_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue