Support receiving SI13 from BTS

* store SI13 in BTS struct
* check and handle BCCH SAPI

Change-Id: I610a93ce23725b182ec14e3507331295bd542f74
Related: OS#2400
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 97eee9b..7112b04 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -245,6 +245,27 @@
 	return pdch->rcv_block(data, len, fn, meas);
 }
 
+static int pcu_rx_data_ind_bcch(uint8_t *data, uint8_t len)
+{
+	struct gprs_rlcmac_bts *bts = bts_main_data();
+
+	if (len == 0) {
+		bts->si13_is_set = false;
+		LOGP(DL1IF, LOGL_INFO, "Received PCU data indication with empty SI13: cache cleaned\n");
+		return 0;
+	}
+
+	if (len != GSM_MACBLOCK_LEN) {
+		LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 with unexpected length %u\n", len);
+		return -EINVAL;
+	}
+
+	memcpy(bts->si13, data, GSM_MACBLOCK_LEN);
+	bts->si13_is_set = true;
+
+	return 0;
+}
+
 static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind)
 {
 	struct gprs_rlcmac_bts *bts = bts_main_data();
@@ -271,6 +292,9 @@
 			data_ind->data, data_ind->len, data_ind->fn,
 			&meas);
 		break;
+	case PCU_IF_SAPI_BCCH:
+		rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len);
+		break;
 	default:
 		LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with "
 			"unsupported sapi %d\n", data_ind->sapi);