<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-netif/+/15403">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stream: Introduce API osmo_stream_cli_is_connected<br><br>Can be used by users to fetch current status of the stream.<br><br>Change-Id: I5402430e5f39eef22dfa18f33807ab6b1e771f1b<br>---<br>M include/osmocom/netif/stream.h<br>M src/stream.c<br>2 files changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/03/15403/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h</span><br><span>index f1c160c..3427df5 100644</span><br><span>--- a/include/osmocom/netif/stream.h</span><br><span>+++ b/include/osmocom/netif/stream.h</span><br><span>@@ -67,6 +67,7 @@</span><br><span> void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, int (*disconnect_cb)(struct osmo_stream_cli *cli));</span><br><span> void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli));</span><br><span> void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli);</span><br><span style="color: hsl(120, 100%, 40%);">+bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli);</span><br><span> </span><br><span> struct osmo_stream_cli *osmo_stream_cli_create(void *ctx);</span><br><span> void osmo_stream_cli_destroy(struct osmo_stream_cli *cli);</span><br><span>diff --git a/src/stream.c b/src/stream.c</span><br><span>index 3d0b665..74fe8b6 100644</span><br><span>--- a/src/stream.c</span><br><span>+++ b/src/stream.c</span><br><span>@@ -184,6 +184,14 @@</span><br><span>       cli->state = STREAM_CLI_STATE_CONNECTING;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! \brief Check if Osmocom Stream Client is in connected state</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] cli Osmocom Stream Client</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      return cli->state == STREAM_CLI_STATE_CONNECTED;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! \brief Close an Osmocom Stream Client</span><br><span>  *  \param[in] cli Osmocom Stream Client to be closed</span><br><span>  *  We unregister the socket fd from the osmocom select() loop</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-netif/+/15403">change 15403</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmo-netif/+/15403"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-netif </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I5402430e5f39eef22dfa18f33807ab6b1e771f1b </div>
<div style="display:none"> Gerrit-Change-Number: 15403 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>