aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/pcu_sock.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-06-16 03:26:50 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-17 01:24:25 +0000
commit703c2d6eb8f82c319d774ed7e2627f86045e0e02 (patch)
tree65555f45d60adbae1647f7625e9572cbe2eee057 /src/common/pcu_sock.c
parentecd5bc2aefe8611795229980105de2f0bc4e092a (diff)
pcu_sock: add pcu_connected() to query PCU availability
Will be used in upcoming dyn PDCH switching. Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
Diffstat (limited to 'src/common/pcu_sock.c')
-rw-r--r--src/common/pcu_sock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 7c835fb9..ea4267de 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -922,3 +922,13 @@ int osmo_unixsock_listen(struct osmo_fd *bfd, int type, const char *path)
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;
+}