Commit d4bc7ebb authored by tepelmann's avatar tepelmann
Browse files

Re-engineered upper tester functions for DENM.

parent b6a9b363
Loading
Loading
Loading
Loading
+27 −168
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ module LibItsDenm_Functions {
        
        
        // map ports
        // map ports
        map(p_ptcDenm:denmPort, system:denmPort);
        map(p_ptcDenm:denmPort, system:denmPort);
        map(p_ptcDenm:utPort, system:utPort);
        
        
    } // end f_ptcDenmUp       
    } // end f_ptcDenmUp       
    
    
@@ -51,6 +52,7 @@ module LibItsDenm_Functions {
            }
            }
        }
        }
        unmap(p_ptcDenm:denmPort);
        unmap(p_ptcDenm:denmPort);
        unmap(p_ptcDenm:utPort);
        
        
    } // end f_ptcDenmDown
    } // end f_ptcDenmDown
    
    
@@ -137,7 +139,7 @@ module LibItsDenm_Functions {
                );
                );
            }
            }
            else {
            else {
                v_ret := f_triggerEventCancellation(p_event);
                v_ret := f_utTriggerEvent(m_utEventCancellation(p_event, c_dataVersionCancellation));
            }
            }
            f_setVerdictPreOrPostamble(v_ret);
            f_setVerdictPreOrPostamble(v_ret);
            
            
@@ -148,190 +150,47 @@ module LibItsDenm_Functions {
    
    
    group eventFunctions {
    group eventFunctions {
        
        
        //TODO check if type Situation is suitable
        /**
        /**
         * @desc Triggers event from the application layer
         * @desc Triggers event from the application layer
         * @param p_event The event cause and subcause.
         * @param p_event The event to trigger.
         * @return 
         * @return 
         */
         */
        function f_triggerEvent(template (value) Situation p_event) runs on ItsFa return FncRetCode {
        function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            var UtTrigger v_utMsg := { p_event };
            
            
            //TODO raise action or send message via port
            utPort.send(v_utMsg);
            
            return v_ret;
        }
        
        /**
         * @desc Triggers cancellation event from the application layer
         * @param p_event The event cause and subcause.
         * @return 
         */
        function f_triggerEventCancellation(template (value) Situation p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            var DataVersion v_dataVersion := c_dataVersionCancellation;
            
            //TODO raise action or send message via port
            
            return v_ret;
        }
        
        /**
         * @desc Triggers event negation from the application layer
         * @param p_event The event cause and subcause.
         * @return 
         */
        function f_triggerEventNegation(template (value) Situation p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            var DecentralizedEnvironmentalNotificationMessage.management.isNegation v_isNegation := true;
            
            //TODO raise action or send message via port
            
            return v_ret;
        }
        
        /**
         * @desc Triggers event with additional TrafficFlowEffect information field included from the application layer
         * @param p_event The event cause and subcause.
         * @param p_tfe The Traffic Flow Effect.
         * @return 
         */
        function f_triggerEventTrafficFlowEffect(
            template (value) Situation p_event, 
            template (value) TrafficFlowEffect p_tfe
            ) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
        }
        
        /**
         * @desc Triggers event with additional LinkedCause information field included from the application layer
         * @param p_event The event cause and subcause.
         * @param p_linkedCause The linked event.
         * @return 
         */
        function f_triggerEventLinkedCause(
            template (value) Situation p_event, 
            template (value) Situation p_linkedCause
            ) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
        }

		/**
         * @desc Triggers event with expiration time information field and frequency information field 
         * 		  included from the application layer
         * @param p_event The event cause and subcause.
         * @param p_expirationTime The expiration time.
         * @param p_frequency The frequency.
         * @return 
         */        
        function f_triggerEventExpirationTimeFrequency(
            template (value) Situation p_event, 
            template (value) TimeStamp p_expirationTime,
            template (value) DecentralizedSituationManagement.frequency p_frequency
            ) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            
            return v_ret;
            return v_ret;
        }
        }
        
        
        /**
        /**
         * @desc Triggers event with expiration time information field included from the application layer
         * @desc Checks that the event was indicated at the application layer
         * @param p_event The event cause and subcause.
         * @param p_event The event to check.
         * @param p_expirationTime The expiration time.
         * @return 
         * @return 
         */
         */
        function f_triggerEventExpirationTime(
        function f_utCheckEvent(template (value) UtEvent p_event) runs on ItsFa return FncRetCode {
            template (value) Situation p_event, 
            template (value) TimeStamp p_expirationTime
            ) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            
            
            //TODO raise action or send message via port
            var UtCheck v_utMsg := { p_event };
            
            return v_ret;
        }
            
            
        /**
            utPort.send(v_utMsg);
         * @desc Triggers update of event's expiration time
            tc_ac.start;
         * @param p_event The event cause and subcause.
            alt {
         * @param p_expirationTime The new expiration time.
                [] utPort.receive(UtResult:true) {
         * @return 
                    setverdict (pass, "Event correctly indicated at application layer");
         */        
                    v_ret := e_success;
        function f_triggerEventExpirationTimeUpdate(
            template (value) Situation p_event, 
            template (value) TimeStamp p_expirationTime
            ) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
                }
                }
               
                [] utPort.receive {
        /**
                    setverdict (fail, "Event not correctly indicated at application layer");
         * @desc Triggers event with additional Event Characteristics information field included from the application layer
                    v_ret := e_error;
         * @param p_event The event cause and subcause.
         * @param p_eventCharact The event characteristics.
         * @return 
         */
        function f_triggerEventEventCharact(
            template (value) Situation p_event, 
            template (value) DecentralizedSituation.eventCharact p_eventCharact
            ) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
                }
                }
        
                [] tc_ac.timeout {
        //TODO check if type Situation is suitable
                    setverdict (inconc, "Timeout while waiting for event check result");
        /**
                    v_ret := e_timeout;
         * @desc Checks that the event was indicated the application layer
         * @param p_event The event cause and subcause.
         * @return 
         */
        function f_checkEvent(template (value) Situation p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
                }
                }
        
        /**
         * @desc Checks that the event cancellation was indicated to the application layer
         * @param p_event The event cause and subcause.
         * @return 
         */
        function f_checkEventCancellation(template (value) Situation p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
            }
            }
            
            
        /**
         * @desc Checks that the event negation was indicated to the application layer
         * @param p_event The event cause and subcause.
         * @return 
         */
        function f_checkEventNegation(template (present) Situation p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            //TODO raise action or send message via port
            
            return v_ret;
            return v_ret;
        }
        }
        
        
+76 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,82 @@ module LibItsDenm_Templates {
            receptionTime := ?
            receptionTime := ?
        }
        }
        
        
        group utPrimitives {
            
            template UtEvent m_utEvent(Situation p_situation) := {
                situation := p_situation,
                eventOption := omit
            }
            
            template UtEvent m_utEventCancellation(
                Situation p_situation, 
                DataVersion p_dataVersion
            ) modifies m_utEvent := {
                eventOption := {
                  eventCancellation := p_dataVersion
                }
            }
            
            template UtEvent m_utEventNegation(
                Situation p_situation, 
                DecentralizedEnvironmentalNotificationMessage.management.isNegation p_isNegation
            ) modifies m_utEvent := {
                eventOption := {
                  eventNegation := p_isNegation
                }
            }
            
            template UtEvent m_utEeventTrafficFlowEffect(
                Situation p_situation, 
                TrafficFlowEffect p_trafficFlowEffect
            ) modifies m_utEvent := {
                eventOption := {
                  eventTrafficFlowEffect := p_trafficFlowEffect
                }
            }
            
            template UtEvent m_utEventLinkedCause(
                Situation p_situation, 
                Situation p_linkedCause
            ) modifies m_utEvent := {
                eventOption := {
                  eventLinkedCause := p_linkedCause
                }
            }
            
            template UtEvent m_utEventExpirationTime(
                Situation p_situation, 
                TimeStamp p_expirationTime
            ) modifies m_utEvent := {
                eventOption := {
                    eventExpirationTime := p_expirationTime
                }
            }
            
            template UtEvent m_utEventExpirationTimeFrequency(
                Situation p_situation, 
                TimeStamp p_expirationTime,
                DecentralizedSituationManagement.frequency p_frequency
            ) modifies m_utEvent := {
                eventOption := {
                    eventExpirationTimeFrequency := {
                        p_expirationTime,
                        p_frequency
                    }
                }
            }
            
            template UtEvent m_utEventCharact(
                Situation p_situation, 
                DecentralizedSituation.eventCharact p_eventCharact
            ) modifies m_utEvent := {
                eventOption := {
                    eventCharact := p_eventCharact
                }
            }
            
        } // end utPrimitives
      
    } // end primitives
    } // end primitives
    
    
    group denmPduTemplates {
    group denmPduTemplates {
+33 −0
Original line number Original line Diff line number Diff line
@@ -113,4 +113,37 @@ module LibItsDenm_TypesAndValues {
        
        
    } // end denmTimeConstants
    } // end denmTimeConstants
    
    
    group utPrimitives {
        
        type record UtTrigger {
            UtEvent utEvent
        }
        
        type record UtCheck {
            UtEvent utEvent
        }
        
        type boolean UtResult;
        
        type record UtEvent {
            Situation situation,
            EventOption eventOption optional
        }
        
        type union EventOption {
            DataVersion eventCancellation,
            DecentralizedEnvironmentalNotificationMessage.management.isNegation eventNegation,
            TrafficFlowEffect eventTrafficFlowEffect,
            Situation eventLinkedCause,
            TimeStamp eventExpirationTime,
            EventTimeFrequency eventExpirationTimeFrequency,
            DecentralizedSituation.eventCharact eventCharact
        }
        
        type record EventTimeFrequency {
            TimeStamp expirationTime,
            DecentralizedSituationManagement.frequency frequency
        }
        
    } // end utPrimitives
}
}
 No newline at end of file
+5 −3
Original line number Original line Diff line number Diff line
@@ -13,6 +13,7 @@ module LibIts_Interface {
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsDenm_TypesAndValues all;
    
    
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_BasicTypesAndValues all;
        
        
@@ -35,7 +36,8 @@ module LibIts_Interface {
        	 * @desc Upper Tester port
        	 * @desc Upper Tester port
        	 */
        	 */
        	type port UpperTesterPort message {
        	type port UpperTesterPort message {
        	    in integer; //TODO: remove me
        	    out UtTrigger, UtCheck;
        	    in UtResult
        	} // end UpperTesterPort
        	} // end UpperTesterPort
        	
        	
        } // end portDefinitions
        } // end portDefinitions