Commit cb3345b4 authored by Yann Garcia's avatar Yann Garcia
Browse files

Validation of meep-vis with TTF T027

parent d9fe3429
Loading
Loading
Loading
Loading
+20 −27
Original line number Diff line number Diff line
@@ -402,6 +402,7 @@ func initializeV2xMessageDistribution() (err error) {
	log.Info("+++ poaNameList: ", poaNameList)
	var validPoaNameList []string
	var ecgi_s []string
	var ecgi_location_s [][]float32
	for _, poaName := range poaNameList {
		node := sbi.activeModel.GetNode(poaName)
		log.Info("+++ Processing node: ", node)
@@ -413,10 +414,11 @@ func initializeV2xMessageDistribution() (err error) {
				mnc := "" // TODO Apply numerical conversion directly, -1 if not initialized
				mcc := ""
				cellId := ""
				cellName := ""
				ecgi := ""
				zone := ""
				var zoneCell []float32
				switch nl.Type_ {
				case mod.NodeTypePoa4G, mod.NodeTypePoa5G:
				case mod.NodeTypePoa4G, mod.NodeTypePoa5G: // Extract PLMN
					poaParent := sbi.activeModel.GetNodeParent(poaName)
					log.Info("+++ poaParent: ", poaParent)
					if zone, ok := poaParent.(*dataModel.Zone); ok {
@@ -428,9 +430,12 @@ func initializeV2xMessageDistribution() (err error) {
								mnc = domain.CellularDomainConfig.Mnc
								mcc = domain.CellularDomainConfig.Mcc
								cellId = domain.CellularDomainConfig.DefaultCellId
								// TODO FSCOM Set broker at Zone node level
							}
						}
					}
					zoneCell = nl.GeoData.Location.Coordinates // e.g. [ 7.420433, 43.729942 ]
					cellName = nl.Name
					if nl.Poa4GConfig != nil {
						cellId = nl.Poa4GConfig.CellId
					} else if nl.Poa5GConfig != nil {
@@ -439,10 +444,11 @@ func initializeV2xMessageDistribution() (err error) {
					if len(cellId)%2 != 0 {
						cellId = "0" + cellId
					}
					log.Info("=================> cellName: ", cellName)
					log.Info("=================> cellId: ", cellId)
					log.Info("=================> mnc: ", mnc)
					log.Info("=================> mcc: ", mcc)
					log.Info("=================> mcc: ", zone)
					log.Info("=================> zoneCell: ", zoneCell)
					// Calculate Ecgi
					cellId_num, err := strconv.Atoi(cellId)
					if err != nil {
@@ -483,11 +489,14 @@ func initializeV2xMessageDistribution() (err error) {
					log.Info("initializeV2xMessageDistribution: ecgi= ", ecgi)
				} // End of 'switch' statement
				ecgi_s = append(ecgi_s, ecgi)
				ecgi_location_s = append(ecgi_location_s, zoneCell)
			}
		}
	} // End of 'for' statement
	log.Info("initializeV2xMessageDistribution: ecgi_s= ", ecgi_s)
	err = sbi.trafficMgr.InitializeV2xMessageDistribution(sbi.poaList, validPoaNameList, ecgi_s)
	log.Info("initializeV2xMessageDistribution: ecgi_location_s= ", ecgi_location_s)

	err = sbi.trafficMgr.InitializeV2xMessageDistribution(sbi.poaList, validPoaNameList, ecgi_s, ecgi_location_s)
	if err != nil {
		log.Error(err.Error())
		return err
@@ -526,6 +535,13 @@ func GetPredictedPowerValues(hour int32, inRsrp int32, inRsrq int32, poaName str
	return outRsrp, outRsrq, err
}

/*
 * GetInfoUuUnicast process the uu_unicast_provisioning_info GETT request and sends the response
 * @param {struct} params HTTP request parameters
 * @param {struct} num_item contains the number of paraneters
 * @return {struct} UuUnicastProvisioningInfoProInfoUuUnicast initialized data structure
 * @see ETSI GS MEC 030 V3.1.1 (2023-03) Clause 7.3.3.1 GET
 */
func GetInfoUuUnicast(params []string, num_item int) (proInfoUuUnicast UuUnicastProvisioningInfoProInfoUuUnicast_list, err error) {
	proInfoUuUnicast = nil
	resp, err := sbi.trafficMgr.GetInfoUuUnicast(params, num_item)
@@ -589,29 +605,6 @@ func GetInfoUuUnicast(params []string, num_item int) (proInfoUuUnicast UuUnicast
			}
		} // End of 'for' statement
	}
	// } else if params[0] == "latitude" {
	// 	// var geocoordinatesList gisClient.GeoCoordinateList
	// 	// geocoordinatesList.GeoCoordinates = geocoordinates
	// 	// powerResp, _, err := gisAppClient.GeospatialDataApi.GetGeoDataPowerValues(context.TODO(), geocoordinatesList)
	// 	// log.Info("GetInfoUuUnicast: powerResp= ", powerResp)
	// 	// if err != nil {
	// 	// 	err = errors.New("GetInfoUuUnicast: GetGeoDataPowerValues failed")
	// 	// 	log.Error(err.Error())
	// 	// 	return proInfoUuUnicast, err
	// 	// }
	// 	proInfoUuUnicast = make([]UuUnicastProvisioningInfoProInfoUuUnicast, len(resp))
	// 	proInfoUuUnicast[0].LocationInfo = new(LocationInfo)
	// 	proInfoUuUnicast[0].LocationInfo.Ecgi = nil
	// 	proInfoUuUnicast[0].LocationInfo.GeoArea = nil
	// 	proInfoUuUnicast[0].NeighbourCellInfo = nil
	// 	err = errors.New("GetInfoUuUnicast: Location not supported yet")
	// 	log.Error(err.Error())
	// 	return proInfoUuUnicast, err
	// } else {
	// 	err = errors.New("GetInfoUuUnicast: Invalid parameter: " + params[0])
	// 	log.Error(err.Error())
	// 	return proInfoUuUnicast, err
	// }

	log.Info("GetInfoUuUnicast: proInfoUuUnicast= ", proInfoUuUnicast)
	return proInfoUuUnicast, err