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/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/291 pcu_sock: add pcu_connected() to query PCU availability Will be used in upcoming dyn PDCH switching. Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a --- M include/osmo-bts/pcu_if.h M src/common/pcu_sock.c 2 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/291/1 diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 0c4fb69..3ce4d0b 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -19,4 +19,6 @@ int pcu_sock_init(const char *path); void pcu_sock_exit(void); +bool pcu_connected(void); + #endif /* _PCU_IF_H */ diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 7c835fb..ea4267d 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -922,3 +922,13 @@ return 0; } +bool pcu_connected(void) { + struct gsm_network *net = &bts_gsmnet; + struct pcu_sock_state *state = net->pcu_state; + + if (!state) + return false; + if (state->conn_bfd.fd <= 0) + return false; + return true; +} -- To view, visit https://gerrit.osmocom.org/291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>