Commit e93396b0 authored by tepelmann's avatar tepelmann
Browse files

Initial versions of new testcases(all TODOs!)

Position checking now with delta.
Propagating tester node GN addresses.
Checked TODOs.
parent 1071e5dc
Loading
Loading
Loading
Loading
+77 −28
Original line number Diff line number Diff line
@@ -83,6 +83,10 @@ module LibItsGeoNetworking_Functions {
            // Connect
            f_connect4SelfOrClientSync();
            
            // Propagate GN addresses
            v_nodeALongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
            v_nodeBLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeB);
            
            // Position table            
            f_addPosition(v_positionTable, c_compIut, v_iutLongPosVector);
            f_addPosition(v_positionTable, c_compNodeA, v_nodeALongPosVector);
@@ -148,6 +152,11 @@ module LibItsGeoNetworking_Functions {
            connect(p_nodeB:syncPort, self:syncPort);
            connect(p_nodeD:syncPort, self:syncPort);
        
            // Propagate GN addresses
            v_nodeBLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeB);
            v_nodeCLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeC);
            v_nodeDLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeD);
            
            // Position table
            f_addPosition(v_positionTable, c_compIut, v_iutLongPosVector);
            f_addPosition(v_positionTable, c_compNodeB, v_nodeBLongPosVector);
@@ -220,6 +229,11 @@ module LibItsGeoNetworking_Functions {
            connect(p_nodeB:syncPort, self:syncPort);
            connect(p_nodeC:syncPort, self:syncPort);

            // Propagate GN addresses
            v_nodeALongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
            v_nodeBLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeB);
            v_nodeCLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeC);
            
            // Position table
            f_addPosition(v_positionTable, c_compIut, v_iutLongPosVector);
            f_addPosition(v_positionTable, c_compNodeA, v_nodeALongPosVector);
@@ -300,6 +314,12 @@ module LibItsGeoNetworking_Functions {
            connect(p_nodeC:syncPort, self:syncPort);
            connect(p_nodeD:syncPort, self:syncPort);
            
            // Propagate GN addresses
            v_nodeALongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
            v_nodeBLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeB);
            v_nodeCLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeC);
            v_nodeDLongPosVector.gnAddr := f_getTsGnLocalAddress(c_compNodeD);
            
            // Position table
            f_addPosition(v_positionTable, c_compIut, v_iutLongPosVector);
            f_addPosition(v_positionTable, c_compNodeA, v_nodeALongPosVector);
@@ -405,21 +425,6 @@ module LibItsGeoNetworking_Functions {
            return v_return;
        }
        
        /**
         * @desc Gives the IUT position within the minimum update frequency of local position vector (LPV) in ms	
         * @see  PICS_GN_MINIMUM_UPDATE_FREQUENCY_LPV
         */
        function f_getPositionWithinMinUpdateFreq(
            in PositionTable p_positionTable, 
            in charstring p_positionKey)
        return LongPosVector {
            
            var LongPosVector v_return := valueof(m_dummyLongPosVector);
            // TODO   
            
            return v_return;
        }
        
        function f_computePosition(
            in LongPosVector p_refPosition, 
            in integer p_longitudeFactor, 
@@ -970,6 +975,33 @@ module LibItsGeoNetworking_Functions {
    
    group testerFunctions {
        
        /**
         * @desc Gets the tester GN local address for a specific node
         */
        function f_getTsGnLocalAddress(in charstring p_node) return GN_Address {
            var GN_Address v_gnAddr;
            
            select (p_node) {
                case (c_compNodeA) {
                    v_gnAddr := PX_TS_NODE_A_LOCAL_GN_ADDR;
                }
                case (c_compNodeB) {
                    v_gnAddr := PX_TS_NODE_B_LOCAL_GN_ADDR;
                }
                case (c_compNodeC) {
                    v_gnAddr := PX_TS_NODE_C_LOCAL_GN_ADDR;
                }
                case (c_compNodeD) {
                    v_gnAddr := PX_TS_NODE_D_LOCAL_GN_ADDR;
                }
                case else {
                    f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_getTsGnLocalAddress: Unknown node given ***");
                }
            }
            
            return v_gnAddr;
        }
        
        /**
         * @desc Sends a GeoNetworking message and in case of an included sequence number in the message the 
         *       local sequence number will be increased by one.
@@ -994,11 +1026,34 @@ module LibItsGeoNetworking_Functions {
    
    group iutFunctions {
        
        /**
         * @desc Gets the IUT GN local address
         */
        function f_getIutGnLocalAddress() return GN_Address {
            
            return PICS_GN_LOCAL_GN_ADDR;   
        }
        
        /**
         * @desc Gets the IUT GN local address configuration method
         */
        function f_getIutGnLocalAddressConfigurationMethod() return TypeOfAddress {
            return PICS_GN_LOCAL_ADDR_CONF_METHOD;
        }
        
        /**
         * @desc Gets the GeoUnicast forwarding algorithm
         */
        function f_getGeoUnicastForwardingAlgorithm() return GeoUnicastForwardingAlgorithm {
            return PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM;
        }
        
        /**
         * @desc Gets the IUT default hop limit
         */
        function f_getDefaultHopLimit() return UInt8 {
            return PICS_GN_DEFAULT_HOP_LIMIT;
        }
        
        /**
         * @desc Gets the LS retransmission timer.. Valid for NetRepInterval = default (cong. ctrl).
@@ -1045,11 +1100,9 @@ module LibItsGeoNetworking_Functions {
         * @return 
         */
        function f_getAppRetransmitTimerMedium() return float {
            var float v_itsGnLocationServiceRetransmitTimer := 2.0;
            
            //TODO get the value from PIXIT or MIB
            var float v_itsGnLocationApplicationRetransmitTimerMedium := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MEDIUM/1000);
            
            return v_itsGnLocationServiceRetransmitTimer;
            return v_itsGnLocationApplicationRetransmitTimerMedium;
        }
        
        /**
@@ -1057,11 +1110,9 @@ module LibItsGeoNetworking_Functions {
         * @return 
         */
        function f_getAppRetransmitTimerMaximum() return float {
            var float v_itsGnLocationServiceRetransmitTimer := 3.0;
            
            //TODO get the value from PIXIT or MIB
            var float v_itsGnLocationApplicationRetransmitTimerMaximum := int2float(PX_GN_APPLICATION_RETRANSMIT_TIMER_MAXIMUM/1000);
            
            return v_itsGnLocationServiceRetransmitTimer;
            return v_itsGnLocationApplicationRetransmitTimerMaximum;
        }
        
        /**
@@ -1079,11 +1130,9 @@ module LibItsGeoNetworking_Functions {
         * @return 
         */
        function f_getAppMaxRetrans() return integer {
            var integer v_itsGnLocationServiceMaxRetrans := 10;
            var integer v_itsGnApplicationMaxRetrans := PICS_GN_APPLICATION_MAX_RETRANS;
            
            //TODO get the value from PIXIT or MIB
            
            return v_itsGnLocationServiceMaxRetrans;
            return v_itsGnApplicationMaxRetrans;
        }
        
        /**
+36 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ module LibItsGeoNetworking_Templates {
    // LibIts
    import from LibIts_Interface all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsGeoNetworking_Pixits all;
    import from LibItsCommon_TypesAndValues all;
    
    group geoNwPrimitivesTemplates {
@@ -519,6 +520,40 @@ module LibItsGeoNetworking_Templates {
                    altitudeAccuracy := ?
            }
         
            /**
             * @desc    Receive template for long position vector with position check with delta
             * @param   p_longPosVector The base long position vector
             */
            template LongPosVector mw_longPosVectorPosition(
                in template (value) LongPosVector p_longPosVector
            ) := {
                    gnAddr := p_longPosVector.gnAddr,
                    timestamp := ?,
                    latitude := (p_longPosVector.latitude-PX_POS_DELTA..p_longPosVector.latitude+PX_POS_DELTA),
                    longitude := (p_longPosVector.longitude-PX_POS_DELTA..p_longPosVector.longitude+PX_POS_DELTA),
                    speed := (p_longPosVector.speed-PX_POS_DELTA..p_longPosVector.speed+PX_POS_DELTA),
                    heading := p_longPosVector.heading,
                    altitude := (p_longPosVector.altitude-PX_POS_DELTA..p_longPosVector.altitude+PX_POS_DELTA),
                    timeAccuracy := ?,
                    posAccuracy := ?,
                    speedAccuracy := ?,
                    headingAccuracy := ?,
                    altitudeAccuracy := ?
            }
            
            /**
             * @desc    Receive template for short position vector with position check with delta
             * @param   p_shortPosVector The base short position vector
             */
            template ShortPosVector mw_shortPosVectorPosition(
                in template (value) ShortPosVector p_shortPosVector
            ) := {
                    gnAddr := p_shortPosVector.gnAddr,
                    timestamp := ?,
                    latitude := (p_shortPosVector.latitude-PX_POS_DELTA..p_shortPosVector.latitude+PX_POS_DELTA),
                    longitude := (p_shortPosVector.longitude-PX_POS_DELTA..p_shortPosVector.longitude+PX_POS_DELTA)
            }
            
        } // end geoNwCommonHeaderTemplates
    
        group geoUnicastHeaderTemplates {