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

Save PCU version reported by BTS

When BTS reports PCU disconnect - clear it.

Change-Id: Idb32c73036413ee912f633604150ee17b611cfa7
Related: OS#1615
---
M openbsc/src/libbsc/abis_nm.c
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/89/2289/1

diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 56b6fcf..85f6440 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -302,7 +302,7 @@
        LOGPC(DNM, LOGL_ERROR, "\n");
 }
 
-static inline void handle_manufact_report(const struct gsm_bts *bts,
+static inline void handle_manufact_report(struct gsm_bts *bts,
                                          const uint8_t *p_val, const char 
*type,
                                          const char *severity, const char 
*text)
 {
@@ -310,23 +310,23 @@
 
        switch (cause) {
        case OSMO_EVT_PCU_VERS:
-               if (text)
+               if (text) {
                        LOGPC(DNM, LOGL_NOTICE,
                              "BTS %u reported connected PCU version %s\n",
                              bts->nr, text);
-               else
+                       osmo_strlcpy(bts->pcu_version, text, 
MAX_VERSION_LENGTH);
+               } else {
                        LOGPC(DNM, LOGL_ERROR,
-                             "BTS %u sent %s without actual version string.\n",
-                             bts->nr,
-                             get_value_string(abis_mm_event_cause_names,
-                                              cause));
+                             "BTS %u reported PCU disconnection.\n", bts->nr);
+                       bts->pcu_version[0] = '\0';
+               }
                break;
        default:
                log_oml_fail_rep(bts, type, severity, p_val, text);
        };
 }
 
-static int rx_fail_evt_rep(struct msgb *mb, const struct gsm_bts *bts)
+static int rx_fail_evt_rep(struct msgb *mb, struct gsm_bts *bts)
 {
        struct abis_om_hdr *oh = msgb_l2(mb);
        struct abis_om_fom_hdr *foh = msgb_l3(mb);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb32c73036413ee912f633604150ee17b611cfa7
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>

Reply via email to