Commit d67d1a77 authored by muhammadh's avatar muhammadh
Browse files

update model names in rnis.go as per new Mec012 v2.2.1

parent d701c0ab
Loading
Loading
Loading
Loading
+19 −20
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 * Copyright (c) 2022  InterDigital Communications, Inc
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * you may not use this file except in compliance with the License.
@@ -147,7 +147,7 @@ type UeData struct {
	Name          string       `json:"name"`
	Name          string       `json:"name"`
	ErabId        int32        `json:"erabId"`
	ErabId        int32        `json:"erabId"`
	Ecgi          *Ecgi        `json:"ecgi"`
	Ecgi          *Ecgi        `json:"ecgi"`
	Nrcgi         *NRcgi       `json:"nrcgi"`
	Nrcgi         *Nrcgi       `json:"nrcgi"`
	Qci           int32        `json:"qci"`
	Qci           int32        `json:"qci"`
	ParentPoaName string       `json:"parentPoaName"`
	ParentPoaName string       `json:"parentPoaName"`
	InRangePoas   []InRangePoa `json:"inRangePoas"`
	InRangePoas   []InRangePoa `json:"inRangePoas"`
@@ -175,7 +175,7 @@ type AppStats struct {
type PoaInfo struct {
type PoaInfo struct {
	Type         string  `json:"type"`
	Type         string  `json:"type"`
	Ecgi         Ecgi    `json:"ecgi"`
	Ecgi         Ecgi    `json:"ecgi"`
	Nrcgi        NRcgi   `json:"nrcgi"`
	Nrcgi        Nrcgi   `json:"nrcgi"`
	Latency      int32   `json:"latency"`
	Latency      int32   `json:"latency"`
	ThroughputUL int32   `json:"throughputUL"`
	ThroughputUL int32   `json:"throughputUL"`
	ThroughputDL int32   `json:"throughputDL"`
	ThroughputDL int32   `json:"throughputDL"`
@@ -713,8 +713,8 @@ func updateUeData(obj sbi.UeDataSbi) {
	newEcgi.CellId = obj.CellId
	newEcgi.CellId = obj.CellId
	newEcgi.Plmn = &plmn
	newEcgi.Plmn = &plmn


	var newNrcgi NRcgi
	var newNrcgi Nrcgi
	newNrcgi.NrcellId = obj.NrCellId
	newNrcgi.NrCellId = obj.NrCellId
	newNrcgi.Plmn = &plmn
	newNrcgi.Plmn = &plmn


	var ueData UeData
	var ueData UeData
@@ -755,7 +755,7 @@ func updateUeData(obj sbi.UeDataSbi) {
			if ueDataObj.Nrcgi != nil {
			if ueDataObj.Nrcgi != nil {
				oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc
				oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc
				oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc
				oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc
				oldNrCellId = ueDataObj.Nrcgi.NrcellId
				oldNrCellId = ueDataObj.Nrcgi.NrCellId
			}
			}
			// Keep previous measurements
			// Keep previous measurements
			ueData.InRangePoas = ueDataObj.InRangePoas
			ueData.InRangePoas = ueDataObj.InRangePoas
@@ -801,7 +801,7 @@ func updateUeData(obj sbi.UeDataSbi) {
		//keep erabId info that was there
		//keep erabId info that was there
		ueData.ErabId = oldErabId
		ueData.ErabId = oldErabId


		if newNrcgi.Plmn.Mnc != oldNrPlmnMnc || newNrcgi.Plmn.Mcc != oldNrPlmnMcc || newNrcgi.NrcellId != oldNrCellId {
		if newNrcgi.Plmn.Mnc != oldNrPlmnMnc || newNrcgi.Plmn.Mcc != oldNrPlmnMcc || newNrcgi.NrCellId != oldNrCellId {
			//update because nrcgi changed
			//update because nrcgi changed
			_ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData))
			_ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData))
		}
		}
@@ -850,8 +850,8 @@ func updatePoaInfo(obj sbi.PoaInfoSbi) {
		ecgi.Plmn = &plmn
		ecgi.Plmn = &plmn
		poaInfo.Ecgi = ecgi
		poaInfo.Ecgi = ecgi
	case poaType5G:
	case poaType5G:
		var nrcgi NRcgi
		var nrcgi Nrcgi
		nrcgi.NrcellId = obj.CellId
		nrcgi.NrCellId = obj.CellId
		nrcgi.Plmn = &plmn
		nrcgi.Plmn = &plmn
		poaInfo.Nrcgi = nrcgi
		poaInfo.Nrcgi = nrcgi
	default:
	default:
@@ -957,13 +957,13 @@ func checkForExpiredSubscriptions() {
				expiryTimeStamp.Seconds = int32(expiryTime)
				expiryTimeStamp.Seconds = int32(expiryTime)


				link := new(ExpiryNotificationLinks)
				link := new(ExpiryNotificationLinks)
				link.Self = cbRef
				link.Subscription.Href = cbRef
				notif.Links = link
				notif.Links = link


				notif.TimeStamp = &timeStamp
				notif.TimeStamp = &timeStamp
				notif.ExpiryDeadline = &expiryTimeStamp
				notif.ExpiryDeadline = &expiryTimeStamp


				sendExpiryNotification(link.Self, notif)
				sendExpiryNotification(link.Subscription.Href, notif)
				_ = delSubscription(baseKey, subsIdStr, true)
				_ = delSubscription(baseKey, subsIdStr, true)
			}
			}
		}
		}
@@ -1460,13 +1460,13 @@ func isMatchNrMrFilterCriteriaNrcgi(filterCriteria interface{}, newPlmn *Plmn, o
			}
			}
		}
		}
		if matchingPlmn {
		if matchingPlmn {
			if nrcgi.NrcellId == "" {
			if nrcgi.NrCellId == "" {
				return true
				return true
			}
			}
			if newCellId == nrcgi.NrcellId {
			if newCellId == nrcgi.NrCellId {
				return true
				return true
			}
			}
			if oldCellId == nrcgi.NrcellId {
			if oldCellId == nrcgi.NrCellId {
				return true
				return true
			}
			}
		}
		}
@@ -1871,7 +1871,7 @@ func checkMrNotificationRegisteredSubscriptions(key string, jsonInfo string, ext


							var measRepUeNotificationNrNCellInfo MeasRepUeNotificationNrNCellInfo
							var measRepUeNotificationNrNCellInfo MeasRepUeNotificationNrNCellInfo
							measRepUeNotificationNrNCellInfo.NrNCellPlmn = append(measRepUeNotificationNrNCellInfo.NrNCellPlmn, *poaInfo.Nrcgi.Plmn)
							measRepUeNotificationNrNCellInfo.NrNCellPlmn = append(measRepUeNotificationNrNCellInfo.NrNCellPlmn, *poaInfo.Nrcgi.Plmn)
							measRepUeNotificationNrNCellInfo.NrNCellGId = poaInfo.Nrcgi.NrcellId
							measRepUeNotificationNrNCellInfo.NrNCellGId = poaInfo.Nrcgi.NrCellId
							neighborCell.NrNCellInfo = append(neighborCell.NrNCellInfo, measRepUeNotificationNrNCellInfo)
							neighborCell.NrNCellInfo = append(neighborCell.NrNCellInfo, measRepUeNotificationNrNCellInfo)
							notif.NewRadioMeasNeiInfo = append(notif.NewRadioMeasNeiInfo, neighborCell)
							notif.NewRadioMeasNeiInfo = append(notif.NewRadioMeasNeiInfo, neighborCell)
						default:
						default:
@@ -1914,7 +1914,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
		return err
		return err
	}
	}


	if ueData.Nrcgi == nil || ueData.Nrcgi.NrcellId == "" {
	if ueData.Nrcgi == nil || ueData.Nrcgi.NrCellId == "" {
		//that ue is not on a 5G poa
		//that ue is not on a 5G poa
		return nil
		return nil
	}
	}
@@ -1937,7 +1937,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e


			if match {
			if match {
				if ueData.Nrcgi != nil {
				if ueData.Nrcgi != nil {
					match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrcellId, "")
					match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrCellId, "")
				} else {
				} else {
					match = false
					match = false
				}
				}
@@ -2002,8 +2002,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
						switch poaInfo.Type {
						switch poaInfo.Type {
						case poaType5G:
						case poaType5G:
							var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo
							var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo
							//not using nrcgi but nrcellId, error in the spec... but going along
							neighborCell.Nrcgi = &poaInfo.Nrcgi
							neighborCell.Nrcgi = poaInfo.Nrcgi.NrcellId
							var measQuantityResultsNr MeasQuantityResultsNr
							var measQuantityResultsNr MeasQuantityResultsNr
							measQuantityResultsNr.Rsrp = poa.Rsrp
							measQuantityResultsNr.Rsrp = poa.Rsrp
							measQuantityResultsNr.Rsrq = poa.Rsrq
							measQuantityResultsNr.Rsrq = poa.Rsrq
@@ -2463,7 +2462,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
		}
		}


		for _, nrcgi := range subscription.FilterCriteriaNrMrs.Nrcgi {
		for _, nrcgi := range subscription.FilterCriteriaNrMrs.Nrcgi {
			if nrcgi.Plmn == nil || nrcgi.NrcellId == "" {
			if nrcgi.Plmn == nil || nrcgi.NrCellId == "" {
				log.Error("For non null nrcgi, plmn and cellId are mandatory")
				log.Error("For non null nrcgi, plmn and cellId are mandatory")
				http.Error(w, "For non null nrcgi,  plmn and cellId are mandatory", http.StatusBadRequest)
				http.Error(w, "For non null nrcgi,  plmn and cellId are mandatory", http.StatusBadRequest)
				return
				return