From 962bf9a48eed418354685dc733b8271d2dd62c27 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 4 Sep 2019 17:04:12 +0200 Subject: stream: Introduce API osmo_stream_cli_is_connected Can be used by users to fetch current status of the stream. Change-Id: I5402430e5f39eef22dfa18f33807ab6b1e771f1b --- src/stream.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/stream.c b/src/stream.c index 3d0b665..74fe8b6 100644 --- a/src/stream.c +++ b/src/stream.c @@ -184,6 +184,14 @@ void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli) cli->state = STREAM_CLI_STATE_CONNECTING; } +/*! \brief Check if Osmocom Stream Client is in connected state + * \param[in] cli Osmocom Stream Client + */ +bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli) +{ + return cli->state == STREAM_CLI_STATE_CONNECTED; +} + /*! \brief Close an Osmocom Stream Client * \param[in] cli Osmocom Stream Client to be closed * We unregister the socket fd from the osmocom select() loop -- cgit v1.2.3