Commit 0a70c316 authored by tepelmann's avatar tepelmann
Browse files

Re-engineered test adapter functions for GN.

parent 374aff2c
Loading
Loading
Loading
Loading
+11 −26
Original line number Diff line number Diff line
@@ -290,17 +290,13 @@ module LibItsGeoNetworking_Functions {
        function f_startBeingNeighbour() runs on ItsNt {
            
            activate(a_neighbourDefault());
            f_taStartBeaconing(
                m_beaconHeader(
                    f_getPosition(vc_componentName)
                )
            );    
            f_taTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader));
            
        } // end f_startBeingNeighbour
        
        function f_stopBeingNeighbour() runs on ItsNt  {
            
            f_taStopBeaconing(vc_componentName);
            f_taTriggerEvent(m_stopBeaconing(vc_componentName));
            deactivate; // FIXME: probably too brutal
            activate(a_default());
            
@@ -892,28 +888,17 @@ module LibItsGeoNetworking_Functions {
    
    group testAdapter {
        
        function f_taStartBeaconing(in template (value) Header p_beaconHeader) {
            
            //TODO
            
        }
        
        function f_taStopBeaconing(in charstring p_compName) {
            
            //TODO
            
        }
        
        function f_taStartPassBeaconing(in template (value) Header p_beaconHeader) {
            
            //TODO
            
        }
        
        function f_taStopPassBeaconing() {
        /**
         * @desc Triggers event in the test system adaptation.
         * @param p_event The event to trigger
         * @return
         */
        function f_taTriggerEvent(template (value) TaGNEvent p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO
            acPort.send(p_event);
            
            return v_ret;
        }
        
    } // end testAdapter
+42 −0
Original line number Diff line number Diff line
@@ -29,6 +29,48 @@ module LibItsGeoNetworking_Templates {
            msgIn := p_geoNwMsg
        }
    
        group taPrimitives {
            
            /**
             * @desc Testsystem will start beaconing for the given neighbor
             * @param p_beaconHeader The neighbor information
             */
            template (value) TaGNEvent m_startBeaconing(BeaconHeader p_beaconHeader) := {
                startBeaconing := {
                    beaconHeader := p_beaconHeader
                }
            }
            
            /**
             * @desc Testsystem will stop beaconing for the given neighbor
             * @param p_compName The neighbor
             */
            template TaGNEvent m_stopBeaconing(charstring p_compName) := {
                stopBeaconing:= {
                    compName := p_compName
                }
            }
            
            /**
             * @desc Testsystem will pass received to the TTCN-3
             * @param p_beaconHeader The neighbor information
             */
            template TaGNEvent m_startPassBeaconing(BeaconHeader p_beaconHeader) := {
                startPassBeaconing := {
                    beaconHeader := p_beaconHeader
                }
            }
            
            /**
             * @desc Testsystem will stop passing beacon information to the TTCN-3
             */
            template TaGNEvent m_stopPassBeaconing := {
                stopPassBeaconing := {
                }
            }
        
        } // end taPrimitives
            
    } // geoNwPrimitivesTemplates
    
    group geoNwPduTemplates {
+27 −0
Original line number Diff line number Diff line
@@ -842,6 +842,33 @@ module LibItsGeoNetworking_TypesAndValues {
     	}
        
    } // end geoNwPicsTypes

    group taPrimitives {
        
        type union TaGNEvent {
            TaStartBeaconing startBeaconing,
            TaStopBeaconing stopBeaconing,
            TaStartPassBeaconing startPassBeaconing,
            TaStopPassBeaconing stopPassBeaconing
        }
        
        type record TaStartBeaconing {
            BeaconHeader beaconHeader
        }
        
        type record TaStopBeaconing {
            charstring compName
        }
        
        type record TaStartPassBeaconing {
            BeaconHeader beaconHeader
        }
        
        type record TaStopPassBeaconing {
        }
        
    }
    
}
with {
    encode "LibItsGeoNetworking_TypesAndValues"
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ module LibIts_Interface {
    import from LibItsBtp_TypesAndValues all;
    import from LibItsCam_TypesAndValues all;
    import from LibItsDenm_TypesAndValues all;
    import from LibItsGeoNetworking_TypesAndValues all;
    
    import from LibCommon_BasicTypesAndValues all;
        
@@ -30,7 +31,7 @@ module LibIts_Interface {
        	 * @desc Adapter control port
        	 */
        	type port AdapterControlPort message {
        	    in integer; //TODO: remove me
        	    out TaGNEvent;
        	} // end AdapterControlPort
    
        	/**