Commit 478b3bd1 authored by berge's avatar berge
Browse files

Added new configs (05 - 06 - 07)

parent 07281450
Loading
Loading
Loading
Loading
+294 −13
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ module LibItsGeoNetworking_Functions {
                connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            
            activate(a_cf02Down());
            activate(a_cf03Down());
            
            //Initialze the IUT
            if(p_mainUtComponent == c_compMTC) {
@@ -313,8 +313,6 @@ module LibItsGeoNetworking_Functions {
        
        /**
         * @desc Deletes configuration cf03
         * @param p_nodeB   Component for NodeB
         * @param p_nodeC   Component for NodeC
         */
        function f_cf03Down() runs on ItsMtc {
            
@@ -373,7 +371,7 @@ module LibItsGeoNetworking_Functions {
                connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            
            activate(a_cf02Down());
            activate(a_cf04Down());
            
            //Initialze the IUT
            if(p_mainUtComponent == c_compMTC) {
@@ -401,9 +399,6 @@ module LibItsGeoNetworking_Functions {
        
        /**
         * @desc Deletes configuration cf04
         * @param p_nodeB   Component for NodeB
         * @param p_nodeC   Component for NodeC
         * @param p_nodeD   Component for NodeD
         */
        function f_cf04Down() runs on ItsMtc {
            
@@ -422,6 +417,250 @@ module LibItsGeoNetworking_Functions {
            
        } // end f_cf04Down

        /**
         * @desc This configuration features:
         *       - one ITS node (IUT)
         *       - one ITS node (NodeB)
         *       - one ITS node not in direction of NodeB and having
         *         longest distance to NodeB (NodeE)
         *       - Area1 which only includes NodeB, NodeD and IUT
         * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages
         */
        function f_cf05Up(in charstring p_mainUtComponent := c_compMTC) runs on ItsMtc {
            
            // Variables
            var PositionTable v_positionTable := {};
            var GeoAreaTable v_areaTable := {};
            var ItsGeoNetworking v_component;
            var integer i;
            
            // Select components
            vc_componentTable := {{c_compNodeB, omit}, {c_compNodeE, omit}};
            
            // Create components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive;
            }
            
            // Map & Connect
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            connect(self:syncPort, mtc:syncPort);
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                map(vc_componentTable[i].gnComponent:acPort, system:acPort);
                map(vc_componentTable[i].gnComponent:utPort, system:utPort);
                map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort);
                connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            
            activate(a_cf05Down());
            
            //Initialze the IUT
            if(p_mainUtComponent == c_compMTC) {
                // MTC intializes IUT
                f_initialState();
            }
            else {
                v_component := f_getComponent(p_mainUtComponent);
                v_component.start(f_initialState());
                v_component.done;   
            }
            
            // Positions & Areas
            f_preparePositionsAndAreas(v_positionTable, v_areaTable);
            
            // Initialize components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName));
            }
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent.done;
            }
        }
        
        /**
         * @desc Deletes configuration cf05
         */
        function f_cf05Down() runs on ItsMtc {
            
            var integer i;
            
            // Unmap & Disconnect
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { 
                unmap(vc_componentTable[i].gnComponent:utPort, system:utPort);
                unmap(vc_componentTable[i].gnComponent:acPort, system:acPort);
                unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort);
                disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            disconnect(self:syncPort, mtc:syncPort);
            
        } // end f_cf05Down
        
        /**
         * @desc This configuration features:
         *       - one ITS node (IUT)
         *       - one ITS node (NodeB)
         *       - one ITS node not in direction of NodeB and having
         *         shortest distance to NodeB (NodeF)
         *       - Area1 which only includes NodeB, NodeD and IUT
         *       - IUT not in sectorial area of NodeB-NodeF
         * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages
         */
        function f_cf06Up(in charstring p_mainUtComponent := c_compMTC) runs on ItsMtc {
                    
            // Variables
            var PositionTable v_positionTable := {};
            var GeoAreaTable v_areaTable := {};
            var ItsGeoNetworking v_component;
            var integer i;
            
            // Select components
            vc_componentTable := {{c_compNodeB, omit}, {c_compNodeF, omit}};
            
            // Create components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive;
            }
            
            // Map & Connect
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            connect(self:syncPort, mtc:syncPort);
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                map(vc_componentTable[i].gnComponent:acPort, system:acPort);
                map(vc_componentTable[i].gnComponent:utPort, system:utPort);
                map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort);
                connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            
            activate(a_cf06Down());
            
            //Initialze the IUT
            if(p_mainUtComponent == c_compMTC) {
                // MTC intializes IUT
                f_initialState();
            }
            else {
                v_component := f_getComponent(p_mainUtComponent);
                v_component.start(f_initialState());
                v_component.done;   
            }
            
            // Positions & Areas
            f_preparePositionsAndAreas(v_positionTable, v_areaTable);
            
            // Initialize components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName));
            }
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent.done;
            }
        }
        
        /**
         * @desc Deletes configuration cf06
         */
        function f_cf06Down() runs on ItsMtc {
            
            var integer i;
            
            // Unmap & Disconnect
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { 
                unmap(vc_componentTable[i].gnComponent:utPort, system:utPort);
                unmap(vc_componentTable[i].gnComponent:acPort, system:acPort);
                unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort);
                disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            disconnect(self:syncPort, mtc:syncPort);
            
        } // end f_cf06Down

        /**
         * @desc This configuration features:
         *       - one ITS node (IUT)
         *       - one ITS node (NodeB)
         *       - one ITS node in direction of NodeB and having
         *         shortest distance to NodeB (NodeD)
         *       - Area1 which only includes NodeB, NodeD and IUT
         * @param p_mainUtComponent Name of the component that will initialize IUT and handle default UT messages
         */
        function f_cf07Up(in charstring p_mainUtComponent := c_compMTC) runs on ItsMtc {
                    
            // Variables
            var PositionTable v_positionTable := {};
            var GeoAreaTable v_areaTable := {};
            var ItsGeoNetworking v_component;
            var integer i;
            
            // Select components
            vc_componentTable := {{c_compNodeB, omit}, {c_compNodeD, omit}};
            
            // Create components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent := ItsGeoNetworking.create(vc_componentTable[i].componentName) alive;
            }
            
            // Map & Connect
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            connect(self:syncPort, mtc:syncPort);
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                map(vc_componentTable[i].gnComponent:acPort, system:acPort);
                map(vc_componentTable[i].gnComponent:utPort, system:utPort);
                map(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort);
                connect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            
            activate(a_cf07Down());
            
            //Initialze the IUT
            if(p_mainUtComponent == c_compMTC) {
                // MTC intializes IUT
                f_initialState();
            }
            else {
                v_component := f_getComponent(p_mainUtComponent);
                v_component.start(f_initialState());
                v_component.done;   
            }
            
            // Positions & Areas
            f_preparePositionsAndAreas(v_positionTable, v_areaTable);
            
            // Initialize components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent.start(f_initialiseComponent(v_positionTable, v_areaTable, vc_componentTable[i].componentName));
            }
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
                vc_componentTable[i].gnComponent.done;
            }
        }
        
        /**
         * @desc Deletes configuration cf06
         */
        function f_cf07Down() runs on ItsMtc {
            
            var integer i;
            
            // Unmap & Disconnect
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { 
                unmap(vc_componentTable[i].gnComponent:utPort, system:utPort);
                unmap(vc_componentTable[i].gnComponent:acPort, system:acPort);
                unmap(vc_componentTable[i].gnComponent:geoNetworkingPort, system:geoNetworkingPort);
                disconnect(vc_componentTable[i].gnComponent:syncPort, self:syncPort);
            }
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            disconnect(self:syncPort, mtc:syncPort);
            
        } // end f_cf06Down
        
        /**
         * @desc    Behavior function for initializing component's variables and tables
         * @param   p_positionTable Table containing position vectors of all nodes
@@ -498,7 +737,7 @@ module LibItsGeoNetworking_Functions {
            inout GeoAreaTable p_areaTable
        ) runs on ItsBaseGeoNetworking {
            
    		var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA, v_longPosVectorNodeB, v_longPosVectorNodeC, v_longPosVectorNodeD;
    		var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA, v_longPosVectorNodeB, v_longPosVectorNodeC, v_longPosVectorNodeD, v_longPosVectorNodeE, v_longPosVectorNodeF;
            
            // Get positions
            v_longPosVectorIut := f_getIutLongPosVector();
@@ -506,12 +745,16 @@ module LibItsGeoNetworking_Functions {
            v_longPosVectorNodeB := f_computePosition(v_longPosVectorIut, c_longitudeFactorNodeB, c_latitudeFactorNodeB);
            v_longPosVectorNodeC := f_computePosition(v_longPosVectorIut, c_longitudeFactorNodeC, c_latitudeFactorNodeC);
            v_longPosVectorNodeD := f_computePosition(v_longPosVectorIut, c_longitudeFactorNodeD, c_latitudeFactorNodeD);
            v_longPosVectorNodeE := f_computePosition(v_longPosVectorIut, c_longitudeFactorNodeE, c_latitudeFactorNodeE);
            v_longPosVectorNodeF := f_computePosition(v_longPosVectorIut, c_longitudeFactorNodeF, c_latitudeFactorNodeF);
            
            // Propagate GN addresses
            v_longPosVectorNodeA.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
            v_longPosVectorNodeB.gnAddr := f_getTsGnLocalAddress(c_compNodeB);
            v_longPosVectorNodeC.gnAddr := f_getTsGnLocalAddress(c_compNodeC);
            v_longPosVectorNodeD.gnAddr := f_getTsGnLocalAddress(c_compNodeD);
            v_longPosVectorNodeE.gnAddr := f_getTsGnLocalAddress(c_compNodeE);
            v_longPosVectorNodeF.gnAddr := f_getTsGnLocalAddress(c_compNodeF);
            
            // Position table
            f_addPosition(p_positionTable, c_compIut, v_longPosVectorIut);
@@ -519,12 +762,14 @@ module LibItsGeoNetworking_Functions {
            f_addPosition(p_positionTable, c_compNodeB, v_longPosVectorNodeB);
            f_addPosition(p_positionTable, c_compNodeC, v_longPosVectorNodeC);
            f_addPosition(p_positionTable, c_compNodeD, v_longPosVectorNodeD);
            f_addPosition(p_positionTable, c_compNodeE, v_longPosVectorNodeE);
            f_addPosition(p_positionTable, c_compNodeF, v_longPosVectorNodeF);
            
            // Area table
            f_addArea(p_areaTable, c_area1,
                f_computeCircularArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeD, float2int(5.0 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            f_addArea(p_areaTable, c_area2,
                f_computeCircularArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));               
                f_computeCircularArea(v_longPosVectorNodeB, float2int(1.5 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));               
            
        }
        
@@ -661,8 +906,6 @@ module LibItsGeoNetworking_Functions {
        return GeoBroadcastArea {
            var GeoBroadcastArea v_broadcastArea;
            
            log(p_area);
            
            if (p_area.shape == e_geoCircle) {
                v_broadcastArea.geoBroadcastSubType := e_geoBroadcastCircle;
            }
@@ -918,6 +1161,38 @@ module LibItsGeoNetworking_Functions {
            }
        }

        /**
         * @desc Default handling cf05 de-initialisation.
         */
        altstep a_cf05Down() runs on ItsMtc {
            [] a_shutdown() {
                f_cf05Down();
                log("*** a_cf05Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        }
        
        /**
         * @desc Default handling cf06 de-initialisation.
         */
        altstep a_cf06Down() runs on ItsMtc {
            [] a_shutdown() {
                f_cf06Down();
                log("*** a_cf06Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        }
        
        /**
         * @desc Default handling cf07 de-initialisation.
         */
        altstep a_cf07Down() runs on ItsMtc {
            [] a_shutdown() {
                f_cf07Down();
                log("*** a_cf07Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        }        
        group geoGeoUnicastAltsteps {
            
            /**
@@ -1805,6 +2080,12 @@ module LibItsGeoNetworking_Functions {
            return v_maxAreaSize;
        } // end f_getGnMaxAreaSize
        
        function f_getAdvancedGbcForwardingMaxCounter() return integer {        
            var integer v_maxCounter := PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER;
            
            return v_maxCounter;  
        }
        
        /**
         * @desc    Set the number of neighbour in the Location Table.
         * @see     PX_MIN_NR_NEIGHBOUR
+6 −0
Original line number Diff line number Diff line
@@ -160,6 +160,12 @@ module LibItsGeoNetworking_Pics {
         */
        modulepar integer PICS_GN_BC_FORWARDING_PACKET_BUFFER_SIZE := 1024;
        
         /**
         * @desc MAX_COUNTER used in Advanced GBC forwarding
         * @see  ETSI TS 102 871-1 v2.1.1 A.32/38
         */
        modulepar integer PICS_GN_ADVANCED_BC_FORWARDING_MAX_COUNTER := 3;
        
        /**
         * @desc IUT's Mac address
         */
+6 −3
Original line number Diff line number Diff line
@@ -30,15 +30,18 @@ module LibItsGeoNetworking_TypesAndValues {
        const charstring c_area1 := "AREA1";
        const charstring c_area2 := "AREA2";
        
        const integer c_latitudeFactorNodeA := 3;
        const integer c_latitudeFactorNodeA := 10;
        const integer c_latitudeFactorNodeB := 2;
        const integer c_latitudeFactorNodeC := -1;
        const integer c_latitudeFactorNodeC := -10;
        const integer c_latitudeFactorNodeD := 1;
        const integer c_latitudeFactorNodeE := -1;
        const integer c_latitudeFactorNodeF := 2;
        const integer c_longitudeFactorNodeA := 0;
        const integer c_longitudeFactorNodeB := 0;
        const integer c_longitudeFactorNodeC := 0;
        const integer c_longitudeFactorNodeD := 0;
        
        const integer c_longitudeFactorNodeE := 0;
        const integer c_longitudeFactorNodeF := -3;
    } // end geoConfigurationValues
    
    group geoSyncMessages {