This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/libosmo-netif/+/15403 )
Change subject: stream: Introduce API osmo_stream_cli_is_connected
......................................................................
stream: Introduce API osmo_stream_cli_is_connected
Can be used by users to fetch current status of the stream.
Change-Id: I5402430e5f39eef22dfa18f33807ab6b1e771f1b
---
M include/osmocom/netif/stream.h
M src/stream.c
2 files changed, 9 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index f1c160c..3427df5 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -67,6 +67,7 @@
void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, int (*disconnect_cb)(struct osmo_stream_cli *cli));
void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli));
void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli);
+bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli);
struct osmo_stream_cli *osmo_stream_cli_create(void *ctx);
void osmo_stream_cli_destroy(struct osmo_stream_cli *cli);
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 @@
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
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/15403
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I5402430e5f39eef22dfa18f33807ab6b1e771f1b
Gerrit-Change-Number: 15403
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190905/d81d35f3/attachment.htm>