Commit 3f3325fa authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in vis-sbi

parent 2f45d86b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -2211,7 +2211,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "404040404"
                    "cellId": "04040404"
                  },
                  "geoData": {
                    "location": {
@@ -2331,7 +2331,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "707070707"
                    "cellId": "07070707"
                  },
                  "geoData": {
                    "location": {
@@ -2713,7 +2713,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "A0A0A0A0A"
                    "cellId": "0A0A0A0A"
                  },
                  "geoData": {
                    "location": {
@@ -2753,7 +2753,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "B0B0B0B0B"
                    "cellId": "0B0B0B0B"
                  },
                  "geoData": {
                    "location": {
@@ -2793,7 +2793,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "C0C0C0C0C"
                    "cellId": "0C0C0C0C"
                  },
                  "geoData": {
                    "location": {
@@ -3594,7 +3594,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "D0D0D0D0D"
                    "cellId": "0D0D0D0D"
                  },
                  "geoData": {
                    "location": {
@@ -3634,7 +3634,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "E0E0E0E0E"
                    "cellId": "0E0E0E0E"
                  },
                  "geoData": {
                    "location": {
@@ -3674,7 +3674,7 @@ const testScenario string = `
                    "packetLoss": null
                  },
                  "poa5GConfig": {
                    "cellId": "F0F0F0F0F"
                    "cellId": "0F0F0F0F"
                  },
                  "geoData": {
                    "location": {
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ echo "MEEP_SANDBOX_NAME: ${MEEP_SANDBOX_NAME}"
echo "MEEP_MEP_NAME: ${MEEP_MEP_NAME}"
echo "MEEP_CODECOV: ${MEEP_CODECOV}"
echo "MEEP_BROKER: ${MEEP_BROKER}" # E.g. mqtt://test.mosquito.org:1338 or amqp://guest:guest@localhost:5672
echo "MEEP_POA_LIST: ${MEEP_POA_LIST}" # E.g. poa-5g1,poa-5g2
echo "MEEP_POA_LIST: ${MEEP_POA_LIST}" # E.g. poa-5g1;poa-5g2

if [[ ! -z "${MEEP_MEP_NAME}" ]]; then
    svcPath="${MEEP_SANDBOX_NAME}/${MEEP_MEP_NAME}"
+21 −5
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
package sbi

import (
	"encoding/binary"
	"encoding/hex"
	"errors"
	"os"
	"strconv"
	"strings"
@@ -389,15 +392,28 @@ func initializeV2xMessageDistribution() (err error) {
					} else if nl.Poa5GConfig != nil {
						cellId = nl.Poa5GConfig.CellId
					}
					//log.Info("=================> cellId: ", cellId)
					//log.Info("=================> mnc: ", mnc)
					//log.Info("=================> mcc: ", mcc)
					if len(cellId)%2 != 0 {
						cellId = "0" + cellId
					}
					log.Info("=================> cellId: ", cellId)
					log.Info("=================> mnc: ", mnc)
					log.Info("=================> mcc: ", mcc)
					// Calculate Ecgi
					cellId_num, err := strconv.Atoi(cellId)
					if err != nil {
						// Hexadump,
						content, err := hex.DecodeString(cellId)
						if err != nil {
							log.Error(err.Error())
							return err
						}
						if len(content) > 4 {
							err = errors.New("Invalid cellId format (TS 36.413: E-UTRAN Cell Identity (ECI) and E-UTRAN Cell Global Identification (ECGI)): " + cellId)
							log.Error(err.Error())
							return err
						}
						cellId_num = int(binary.BigEndian.Uint32(content))
					}
					log.Info("initializeV2xMessageDistribution: cellId_num= ", cellId_num)
					TwentyEigthBits := 0xFFFFFFF //  TS 36.413: E-UTRAN Cell Identity (ECI) and E-UTRAN Cell Global Identification (ECGI)
					eci := cellId_num & TwentyEigthBits
+1 −1
Original line number Diff line number Diff line
@@ -414,7 +414,7 @@ func Init() (err error) {
	// E.g. poa-5g1,poa-5g2
	poa_list := strings.TrimSpace(os.Getenv("MEEP_POA_LIST"))
	if poa_list != "" {
		v2x_poa_list = strings.Split(poa_list, ",")
		v2x_poa_list = strings.Split(poa_list, ";")
		if len(v2x_poa_list) > 1 {
			sort.Strings(v2x_poa_list) // Sorting the PoA list to use search algorithms
		}
+1 −1
Original line number Diff line number Diff line
@@ -1138,7 +1138,7 @@ func initializeVars() {
	v2x_broker = v2xBrokerTest
	os.Setenv("MEEP_BROKER", v2x_broker)
	v2x_poa_list = poaListTest
	os.Setenv("MEEP_POA_LIST", strings.Join(v2x_poa_list, ","))
	os.Setenv("MEEP_POA_LIST", strings.Join(v2x_poa_list, ";"))
}

func initialiseScenario(testScenario string) {
Loading