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
Changes for go-apps/meep-rnis/server/rnis.go: 19 added lines, 20 removed lines.
Original line number 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");
 * you may not use this file except in compliance with the License.
@@ -147,7 +147,7 @@ type UeData struct {
	Name          string       `json:"name"`
	ErabId        int32        `json:"erabId"`
	Ecgi          *Ecgi        `json:"ecgi"`
	Nrcgi         *NRcgi       `json:"nrcgi"`
	Nrcgi         *Nrcgi       `json:"nrcgi"`
	Qci           int32        `json:"qci"`
	ParentPoaName string       `json:"parentPoaName"`
	InRangePoas   []InRangePoa `json:"inRangePoas"`
@@ -175,7 +175,7 @@ type AppStats struct {
type PoaInfo struct {
	Type         string  `json:"type"`
	Ecgi         Ecgi    `json:"ecgi"`
	Nrcgi        NRcgi   `json:"nrcgi"`
	Nrcgi        Nrcgi   `json:"nrcgi"`
	Latency      int32   `json:"latency"`
	ThroughputUL int32   `json:"throughputUL"`
	ThroughputDL int32   `json:"throughputDL"`
@@ -713,8 +713,8 @@ func updateUeData(obj sbi.UeDataSbi) {
	newEcgi.CellId = obj.CellId
	newEcgi.Plmn = &plmn

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

	var ueData UeData
@@ -755,7 +755,7 @@ func updateUeData(obj sbi.UeDataSbi) {
			if ueDataObj.Nrcgi != nil {
				oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc
				oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc
				oldNrCellId = ueDataObj.Nrcgi.NrcellId
				oldNrCellId = ueDataObj.Nrcgi.NrCellId
			}
			// Keep previous measurements
			ueData.InRangePoas = ueDataObj.InRangePoas
@@ -801,7 +801,7 @@ func updateUeData(obj sbi.UeDataSbi) {
		//keep erabId info that was there
		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
			_ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData))
		}
@@ -850,8 +850,8 @@ func updatePoaInfo(obj sbi.PoaInfoSbi) {
		ecgi.Plmn = &plmn
		poaInfo.Ecgi = ecgi
	case poaType5G:
		var nrcgi NRcgi
		nrcgi.NrcellId = obj.CellId
		var nrcgi Nrcgi
		nrcgi.NrCellId = obj.CellId
		nrcgi.Plmn = &plmn
		poaInfo.Nrcgi = nrcgi
	default:
@@ -957,13 +957,13 @@ func checkForExpiredSubscriptions() {
				expiryTimeStamp.Seconds = int32(expiryTime)

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

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

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

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

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

			if match {
				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 {
					match = false
				}
@@ -2002,8 +2002,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e
						switch poaInfo.Type {
						case poaType5G:
							var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo
							//not using nrcgi but nrcellId, error in the spec... but going along
							neighborCell.Nrcgi = poaInfo.Nrcgi.NrcellId
							neighborCell.Nrcgi = &poaInfo.Nrcgi
							var measQuantityResultsNr MeasQuantityResultsNr
							measQuantityResultsNr.Rsrp = poa.Rsrp
							measQuantityResultsNr.Rsrq = poa.Rsrq
@@ -2463,7 +2462,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
		}

		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")
				http.Error(w, "For non null nrcgi,  plmn and cellId are mandatory", http.StatusBadRequest)
				return