Commit 9e95e92d authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

remove ue meas updates on mobility event + prevent meas notif if parent poa has no measurements

parent 15d62500
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -267,9 +267,6 @@ func processActiveScenarioUpdate() {

	//get all measurements to update without waiting for ticker
	if len(ueNameList) > 0 {
		//no need to have the map if no ue to update
		ueMeasMap, _ := sbi.gisCache.GetAllMeasurements()

		for _, name := range ueNameList {
			// Ignore disconnected UEs
			if !isUeConnected(name) {
@@ -336,9 +333,6 @@ func processActiveScenarioUpdate() {
							throughputUL = ue.NetChar.ThroughputUl
						}

						//update measurements, don't wait for ticker
						poaNamesInRange, rsrpsInRange, rsrqsInRange := getMeas(name, "", ueMeasMap)

						var ueDataSbi = UeDataSbi{
							Name:          name,
							Mnc:           mnc,
@@ -352,9 +346,6 @@ func processActiveScenarioUpdate() {
							ThroughputDL:  throughputDL,
							PacketLoss:    ploss,
							ParentPoaName: poa.Name,
							InRangePoas:   poaNamesInRange,
							InRangeRsrps:  rsrpsInRange,
							InRangeRsrqs:  rsrqsInRange,
						}
						sbi.updateUeDataCB(ueDataSbi)
					}
@@ -501,12 +492,8 @@ func processActiveScenarioUpdate() {
}

func refreshMeasurements() {

	// Update UE measurements
	ueMeasMap, _ := sbi.gisCache.GetAllMeasurements()

	log.Error("KEV: SBI get all measurements from GIS cache")

	ueNameList := sbi.activeModel.GetNodeNames("UE")
	for _, name := range ueNameList {

@@ -524,7 +511,6 @@ func refreshMeasurements() {
			sbi.updateMeasInfoCB(name, "", nil, nil, nil)
		}
	}

}

func getMeas(ue string, poaName string, ueMeasMap map[string]*gc.UeMeasurement) ([]string, []int32, []int32) {
+16 −44
Original line number Diff line number Diff line
@@ -478,17 +478,6 @@ func updateUeData(obj sbi.UeDataSbi) {
	ueData.ThroughputUL = obj.ThroughputUL
	ueData.ThroughputDL = obj.ThroughputDL
	ueData.PacketLoss = obj.PacketLoss

	var inRangePoas []InRangePoa
	for index := range obj.InRangePoas {
		var inRangePoa InRangePoa
		inRangePoa.Name = obj.InRangePoas[index]
		inRangePoa.Rsrp = obj.InRangeRsrps[index]
		inRangePoa.Rsrq = obj.InRangeRsrqs[index]
		inRangePoas = append(inRangePoas, inRangePoa)
	}

	ueData.InRangePoas = inRangePoas
	ueData.ParentPoaName = obj.ParentPoaName

	oldPlmn := new(Plmn)
@@ -499,7 +488,6 @@ func updateUeData(obj sbi.UeDataSbi) {
	oldNrPlmnMnc := ""
	oldNrPlmnMcc := ""
	oldNrCellId := ""
	var oldInRangePoas []InRangePoa

	//get from DB
	jsonUeData, _ := rc.JSONGetEntry(baseKey+"UE:"+obj.Name, ".")
@@ -520,7 +508,8 @@ func updateUeData(obj sbi.UeDataSbi) {
				oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc
				oldNrCellId = ueDataObj.Nrcgi.NrcellId
			}
			oldInRangePoas = ueDataObj.InRangePoas
			// Keep previous measurements
			ueData.InRangePoas = ueDataObj.InRangePoas
		}
	}
	//updateDB if changes occur (4G section)
@@ -567,23 +556,6 @@ func updateUeData(obj sbi.UeDataSbi) {
			//update because nrcgi changed
			_ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData))
		}
		//update if poa in range and signal powers changed
		//as soon as there is one difference... need an update
		updateMeas := false
		if len(oldInRangePoas) != len(inRangePoas) {
			updateMeas = true
		} else {
			for index := range oldInRangePoas {
				if oldInRangePoas[index].Name != inRangePoas[index].Name || oldInRangePoas[index].Rsrp != inRangePoas[index].Rsrp || oldInRangePoas[index].Rsrq != inRangePoas[index].Rsrq {
					updateMeas = true
					break
				}
			}
		}
		if updateMeas {
			//update because power signals changed
			_ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData))
		}
	}
}

@@ -605,8 +577,6 @@ func updateMeasInfo(name string, parentPoaName string, inRangePoaNames []string,
			}
			ueDataObj.InRangePoas = inRangePoas
		}
		InRangePoasStr := fmt.Sprintf("%+v", ueDataObj.InRangePoas)
		log.Error("KEV: RNIS DB update UE: ", name, " POAs in range: ", InRangePoasStr)
		_ = rc.JSONSetEntry(baseKey+"UE:"+name, ".", convertUeDataToJson(ueDataObj))
	}
}
@@ -1607,7 +1577,6 @@ func checkMrNotificationRegisteredSubscriptions(key string, jsonInfo string, ext
				}

				subscription := convertJsonToMeasRepUeSubscription(jsonInfo)
				log.Info("Sending RNIS notification ", subscription.CallbackReference)

				var notif MeasRepUeNotification
				notif.NotificationType = MEAS_REP_UE_NOTIFICATION
@@ -1624,10 +1593,12 @@ func checkMrNotificationRegisteredSubscriptions(key string, jsonInfo string, ext
				notif.AssociateId = append(notif.AssociateId, *assocId)

				//adding the data of all reachable cells
				parentMeasExists := false
				for _, poa := range ueData.InRangePoas {
					if poa.Name == ueData.ParentPoaName {
						notif.Rsrp = poa.Rsrp
						notif.Rsrq = poa.Rsrq
						parentMeasExists = true
					} else {
						jsonInfo, _ := rc.JSONGetEntry(baseKey+"POA:"+poa.Name, ".")
						if jsonInfo == "" {
@@ -1659,11 +1630,14 @@ func checkMrNotificationRegisteredSubscriptions(key string, jsonInfo string, ext
					}
				}

				if parentMeasExists {
					log.Info("Sending RNIS notification ", subscription.CallbackReference)
					go sendMrNotification(subscription.CallbackReference, notif)
					log.Info("Meas_Rep_Ue Notification" + "(" + subsIdStr + ")")
				}
			}
		}
	}
	return nil
}

@@ -1671,7 +1645,6 @@ func checkNrMrPeriodicTrigger(trigger int32) {

	//only check if there is at least one subscription
	if len(nrMrSubscriptionMap) >= 1 {
		log.Error("KEV: RNIS DB get UEs")
		keyName := baseKey + "UE:*"
		err := rc.ForEachJSONEntry(keyName, checkNrMrNotificationRegisteredSubscriptions, int32(trigger))
		if err != nil {
@@ -1713,7 +1686,6 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
			match := isMatchFilterCriteriaAssociateId(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, assocId)

			if match {

				if ueData.Nrcgi != nil {
					match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrcellId, "")
				} else {
@@ -1726,7 +1698,6 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
			}

			if match {

				subsIdStr := strconv.Itoa(subsId)
				jsonInfo, _ := rc.JSONGetEntry(baseKey+"subscriptions:"+subsIdStr, ".")
				if jsonInfo == "" {
@@ -1734,7 +1705,6 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
				}

				subscription := convertJsonToNrMeasRepUeSubscription(jsonInfo)
				log.Info("Sending RNIS notification ", subscription.CallbackReference)

				var notif NrMeasRepUeNotification
				notif.NotificationType = NR_MEAS_REP_UE_NOTIFICATION
@@ -1760,6 +1730,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e

				strongestRsrp := int32(0)
				//adding the data of all reachable cells
				parentMeasExists := false
				for _, poa := range ueData.InRangePoas {
					if poa.Name == ueData.ParentPoaName {
						var measQuantityResultsNr MeasQuantityResultsNr
@@ -1768,8 +1739,8 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
						var nrMeasRepUeNotificationSCell NrMeasRepUeNotificationSCell
						nrMeasRepUeNotificationSCell.MeasQuantityResultsSsbCell = &measQuantityResultsNr
						notif.ServCellMeasInfo[0].SCell = &nrMeasRepUeNotificationSCell
						parentMeasExists = true
					} else {
						log.Error("KEV: RNIS DB get POA: ", poa.Name)
						jsonInfo, _ := rc.JSONGetEntry(baseKey+"POA:"+poa.Name, ".")
						if jsonInfo == "" {
							log.Info("POA cannot be found in: ", baseKey+"POA:"+poa.Name)
@@ -1812,13 +1783,14 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
					notif.EutraNeighCellMeasInfo = nil
				}

				notifStr := fmt.Sprintf("%+v", notif)
				log.Error("KEV: RNIS send notif for UE: ", ueData.Name, " Notif: ", notifStr)
				if parentMeasExists {
					log.Info("Sending RNIS notification ", subscription.CallbackReference)
					go sendNrMrNotification(subscription.CallbackReference, notif)
					log.Info("Nr_Meas_Rep_Ue Notification" + "(" + subsIdStr + ")")
				}
			}
		}
	}
	return nil
}