Review at  https://gerrit.osmocom.org/2087

Handle TXT indication from OsmoPCU

* handle OML message
* handle OsmoPCU version message

Change-Id: I16e73198501487a5b1076bf83390b85538d5af73
Related: OS#1614, 1615
---
M src/common/pcu_sock.c
1 file changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/2087/1

diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 85bc880..f5732ff 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -538,6 +538,27 @@
        return rc;
 }
 
+static int pcu_rx_txt_ind(struct gsm_bts *bts,
+                         struct gsm_pcu_if_txt_ind *txt)
+{
+       switch (txt->type) {
+       case PCU_VERSION:
+               LOGP(DPCU, LOGL_INFO, "OsmoPCU version %s connected\n",
+                    txt->text);
+               osmo_signal_dispatch(SS_FAIL, OSMO_EVT_PCU_VERS, txt->text);
+               break;
+       case PCU_OML_ALERT:
+               osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text);
+               break;
+       default:
+               LOGP(DPCU, LOGL_ERROR, "Unknown TXT_IND type %u received\n",
+                    txt->type);
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 static int pcu_rx_act_req(struct gsm_bts *bts,
        struct gsm_pcu_if_act_req *act_req)
 {
@@ -586,6 +607,9 @@
        case PCU_IF_MSG_ACT_REQ:
                rc = pcu_rx_act_req(bts, &pcu_prim->u.act_req);
                break;
+       case PCU_IF_MSG_TXT_IND:
+               rc = pcu_rx_txt_ind(bts, &pcu_prim->u.txt_ind);
+               break;
        default:
                LOGP(DPCU, LOGL_ERROR, "Received unknwon PCU msg type %d\n",
                        msg_type);

-- 
To view, visit https://gerrit.osmocom.org/2087
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16e73198501487a5b1076bf83390b85538d5af73
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>

Reply via email to