Commit 26fa816b authored by schmitting's avatar schmitting
Browse files

IN functions added, types/templates modified

parent de22143f
Loading
Loading
Loading
Loading
+384 −3
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@ module LibItsDcc_Functions {
    import from LibCommon_VerdictControl all;
    import from LibCommon_VerdictControl all;
    
    
    // LibIts
    // LibIts
    import from LibItsDcc_TypesAndValues all;
    import from LibItsDcc_Templates all;
    import from LibItsDcc_Templates all;
    import from LibItsDcc_Pixits all;
    import from LibItsDcc_Pixits all;
    import from LibItsDcc_Pics all;
    import from LibItsDcc_Pics all;
@@ -145,9 +146,9 @@ module LibItsDcc_Functions {
            
            
            tc_wait.start;
            tc_wait.start;
            alt {
            alt {
//                        [] utPort.receive(p_event) -> value p_result {
                [] utPort.receive(p_event) -> value p_result {
//                            tc_wait.stop;
                    tc_wait.stop;
//                        }
                }
                [] utPort.receive {
                [] utPort.receive {
                    tc_wait.stop;
                    tc_wait.stop;
                    log("*** f_utCommandIndication: INFO: Another event indicated at application layer, repeating check ***");
                    log("*** f_utCommandIndication: INFO: Another event indicated at application layer, repeating check ***");
@@ -166,7 +167,387 @@ module LibItsDcc_Functions {
     */
     */
    group inFuntions { 
    group inFuntions { 


        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are 
         *       reported as sent with the requested Tx power
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel              Channel on which the frame has been sent
         */
        function f_iN_AllRequestedFramesSent(float   p_testDuration,
                                             float   p_tOff,
                                             integer p_requestedTxPower,
                                             integer p_dCCProfileIdentifier,
                                             Channel p_channel) runs on ItsDcc {
            
            var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd());
            var InSta v_inSta;
            var integer v_frameUnacknowledgedCount := 1;
            
            timer tc_testDuration := p_testDuration;
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            
            inPort.send(m_In_Request(v_commandReference,
                                     PIXIT_REFERENCE_BURST,
                                     p_requestedTxPower,
                                     p_dCCProfileIdentifier));
            tc_testDuration.start;
            
            alt {
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               p_channel,
                                               true)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                    if(v_inSta.achievedSendPower != p_requestedTxPower)
                       {setverdict(fail)}
                    tc_tOff.start;
                    repeat;
                }
                
                [] tc_tOff.timeout {
                    inPort.send(m_In_Request(v_commandReference,
                                PIXIT_REFERENCE_BURST,
                                p_requestedTxPower,
                                p_dCCProfileIdentifier));
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount + 1;
                    repeat;
                }
                                               
                [] tc_testDuration.timeout {
                    if(v_frameUnacknowledgedCount == 0)
                       {setverdict(pass)}
                    else
                      {tc_tOff.start;
                      alt {
                          [] inPort.receive(mw_In_Status(v_commandReference,
                                                         p_channel,
                                                         true)) -> value v_inSta {
                              tc_tOff.stop;
                              v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                              if((v_inSta.achievedSendPower != p_requestedTxPower)
                                 or (v_frameUnacknowledgedCount != 0))
                                 {setverdict(fail)}
                          }
                          
                          [] tc_tOff.timeout {
                             setverdict(fail)}
                         }
                      }     
                }
             }
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        } // End of function f_iN_AllRequestedFramesSent

        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are 
         *       reported as sent with reduced Tx power being lower than the maximum allowed Tx power
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel              Channel on which the frame has been sent
         * @param   p_maxTxPower           Maximum allowed Tx power value
         */
        function f_iN_FramesSentTxPowerReduction(float   p_testDuration,
                                                 float   p_tOff,
                                                 integer p_requestedTxPower,
                                                 integer p_dCCProfileIdentifier,
                                                 Channel p_channel,
                                                 integer p_maxTxPower) runs on ItsDcc {
            
            var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd());
            var InSta v_inSta;
            var integer v_frameUnacknowledgedCount := 1;
            
            timer tc_testDuration := p_testDuration;
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            
            inPort.send(m_In_Request(v_commandReference,
                                     PIXIT_REFERENCE_BURST,
                                     p_requestedTxPower,
                                     p_dCCProfileIdentifier));
            tc_testDuration.start;
            
            alt {
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               p_channel,
                                               true)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                    if(v_inSta.achievedSendPower >= p_maxTxPower)
                       {setverdict(fail)}
                    tc_tOff.start;
                    repeat;
                }
                
                [] tc_tOff.timeout {
                    inPort.send(m_In_Request(v_commandReference,
                                PIXIT_REFERENCE_BURST,
                                p_requestedTxPower,
                                p_dCCProfileIdentifier));
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount + 1;
                    repeat;
                }
                                               
                [] tc_testDuration.timeout {
                    if(v_frameUnacknowledgedCount == 0)
                       {setverdict(pass)}
                    else
                      {tc_tOff.start;
                      alt {
                          [] inPort.receive(mw_In_Status(v_commandReference,
                                                         p_channel,
                                                         true)) -> value v_inSta {
                              tc_tOff.stop;
                              v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                              if((v_inSta.achievedSendPower >= p_maxTxPower)
                                 or (v_frameUnacknowledgedCount != 0))
                                 {setverdict(fail)}
                          }
                          
                          [] tc_tOff.timeout {
                             setverdict(fail)}
                         }
                      }     
                }
             }
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        } // End of function f_iN_FramesSentTxPowerReduction

        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are dropped
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         */
        function f_iN_AllRequestedFramesDropped(float   p_testDuration,
                                                float   p_tOff,
                                                integer p_requestedTxPower,
                                                integer p_dCCProfileIdentifier) runs on ItsDcc {
            
            var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd());
            var InSta v_inSta;
            
            timer tc_testDuration := p_testDuration;
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            
            inPort.send(m_In_Request(v_commandReference,
                                     PIXIT_REFERENCE_BURST,
                                     p_requestedTxPower,
                                     p_dCCProfileIdentifier));
            tc_testDuration.start;
            
            alt {
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               ?,
                                               ?)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    if(v_inSta.transmissionSuccessStatus)
                      {setverdict(fail)}
                    tc_tOff.start;
                    repeat;
                }
                
                
                [] tc_tOff.timeout {
                    inPort.send(m_In_Request(v_commandReference,
                                PIXIT_REFERENCE_BURST,
                                p_requestedTxPower,
                                p_dCCProfileIdentifier));
                    repeat;
                }
                                               
                [] tc_testDuration.timeout {
                    setverdict(pass)
                }
             }
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        } // End of function f_iN_AllRequestedFramesDropped

        /**
         * @desc Request sending of frames via the IN_SAP and check that some frames are 
         *       reported as sent and some reported as dropped
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel              Channel on which the frame has been sent
         */
        function f_iN_SomeRequestedFramesSent(float   p_testDuration,
                                              float   p_tOff,
                                              integer p_requestedTxPower,
                                              integer p_dCCProfileIdentifier,
                                              Channel p_channel) runs on ItsDcc {
            
            var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd());
            var InSta v_inSta;
            var integer v_frameUnacknowledgedCount := 1;
            var boolean v_frameSent, v_frameDropped := false;
            
            timer tc_testDuration := p_testDuration;
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            
            inPort.send(m_In_Request(v_commandReference,
                                     PIXIT_REFERENCE_BURST,
                                     p_requestedTxPower,
                                     p_dCCProfileIdentifier));
            tc_testDuration.start;
            
            alt {
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               p_channel,
                                               true)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                    v_frameSent := true;
                    tc_tOff.start;
                    repeat;
                }
                
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               p_channel,
                                               false)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                    v_frameDropped := true;
                    tc_tOff.start;
                    repeat;
                }
                
                [] tc_tOff.timeout {
                    inPort.send(m_In_Request(v_commandReference,
                                PIXIT_REFERENCE_BURST,
                                p_requestedTxPower,
                                p_dCCProfileIdentifier));
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount + 1;
                    repeat;
                }
                                               
                [] tc_testDuration.timeout {
                    if(not v_frameSent and v_frameDropped)
                       {setverdict(fail)}
                    if(v_frameUnacknowledgedCount == 0)
                       {setverdict(pass)}
                    else
                      {tc_tOff.start;
                      alt {
                          [] inPort.receive(mw_In_Status(v_commandReference,
                                                         p_channel,
                                                         ?)) -> value v_inSta {
                              tc_tOff.stop;
                              v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                              if(v_frameUnacknowledgedCount != 0)
                                 {setverdict(fail)}
                          }
                          
                          [] tc_tOff.timeout {
                             setverdict(fail)}
                         }
                      }     
                }
             }
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        } // End of function f_iN_SomeRequestedFramesSent

        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are 
         *       reported as sent via two different channels
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel_1            First channel on which the frame has been sent
         * @param   p_channel_2            Second channel on which the frame has been sent
         */
        function f_iN_AllRequestedFramesSentOn2Channels(float   p_testDuration,
                                                        float   p_tOff,
                                                        integer p_requestedTxPower,
                                                        integer p_dCCProfileIdentifier,
                                                        Channel p_channel_1,
                                                        Channel p_channel_2) runs on ItsDcc {
            
            var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd());
            var InSta v_inSta;
            var integer v_frameUnacknowledgedCount := 1;
            var boolean v_channel_1, v_channel_2 := false;
            
            timer tc_testDuration := p_testDuration;
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            
            inPort.send(m_In_Request(v_commandReference,
                                     PIXIT_REFERENCE_BURST,
                                     p_requestedTxPower,
                                     p_dCCProfileIdentifier));
            tc_testDuration.start;
            
            alt {
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               p_channel_1,
                                               true)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                    v_channel_1 := true;
                    tc_tOff.start;
                    repeat;
                }
                
                [] inPort.receive(mw_In_Status(v_commandReference,
                                               p_channel_2,
                                               true)) -> value v_inSta {
                    v_commandReference := (v_commandReference + 1) mod c_maxCommandReference;
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                    v_channel_2 := true;
                    tc_tOff.start;
                    repeat;
                }
                
                [] tc_tOff.timeout {
                    inPort.send(m_In_Request(v_commandReference,
                                PIXIT_REFERENCE_BURST,
                                p_requestedTxPower,
                                p_dCCProfileIdentifier));
                    v_frameUnacknowledgedCount := v_frameUnacknowledgedCount + 1;
                    repeat;
                }
                                               
                [] tc_testDuration.timeout {
                    if(not v_channel_1 and v_channel_2)
                       {setverdict(fail)}
                    if(v_frameUnacknowledgedCount == 0)
                       {setverdict(pass)}
                    else
                      {tc_tOff.start;
                      alt {
                          [] inPort.receive(mw_In_Status(v_commandReference,
                                                         ?,
                                                         true)) -> value v_inSta {
                              tc_tOff.stop;
                              v_frameUnacknowledgedCount := v_frameUnacknowledgedCount - 1;
                              if(v_frameUnacknowledgedCount != 0)
                                 {setverdict(fail)}
                          }
                          
                          [] tc_tOff.timeout {
                             setverdict(fail)}
                         }
                      }     
                }
             }
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        } // End of function f_iN_AllRequestedFramesSentOn2Channels


    } // End of group inFunctions
    } // End of group inFunctions
} // End of module LibItsDcc_Functions
} // End of module LibItsDcc_Functions
 No newline at end of file
+6 −9
Original line number Original line Diff line number Diff line
@@ -44,12 +44,10 @@ module LibItsDcc_Templates {
         */
         */
        template UtRadioCommandIndication m_utRadioCommandIndication(Channel p_channel,
        template UtRadioCommandIndication m_utRadioCommandIndication(Channel p_channel,
                                                                     template integer p_measuredPower,
                                                                     template integer p_measuredPower,
                                                                     template integer p_interPacketSpacing_Toff,
                                                                     template integer p_interPacketSpacing_Toff) :=
                                                                     template integer p_burstLength_Ton) :=
           {channel                 := p_channel,
           {channel                 := p_channel,
            measuredPower           := p_measuredPower,
            measuredPower           := p_measuredPower,
            interPacketSpacing_Toff := p_interPacketSpacing_Toff,
            interPacketSpacing_Toff := p_interPacketSpacing_Toff
            burstLength_Ton         := p_burstLength_Ton
           } // End m_utRadioCommandIndication
           } // End m_utRadioCommandIndication
           
           
    } // End of group utPrimitives
    } // End of group utPrimitives
@@ -63,11 +61,11 @@ module LibItsDcc_Templates {
         */
         */
        template InReq m_In_Request(integer     p_commandReference,
        template InReq m_In_Request(integer     p_commandReference,
                                    octetstring p_referenceBurst,
                                    octetstring p_referenceBurst,
                                    integer     p_requestedSendPower,
                                    integer     p_requestedTxPower,
                                    integer     p_dCCProfileIdentifier) :=
                                    integer     p_dCCProfileIdentifier) :=
           {commandReference     := p_commandReference,
           {commandReference     := p_commandReference,
            referenceBurst       := p_referenceBurst,
            referenceBurst       := p_referenceBurst,
            requestedSendPower   := p_requestedSendPower,
            requestedSendPower   := p_requestedTxPower,
            dCCProfileIdentifier := p_dCCProfileIdentifier
            dCCProfileIdentifier := p_dCCProfileIdentifier
            } // End m_In_Request
            } // End m_In_Request
        
        
@@ -76,12 +74,11 @@ module LibItsDcc_Templates {
         */
         */
        template InSta mw_In_Status(template integer p_commandReference,
        template InSta mw_In_Status(template integer p_commandReference,
                                    template Channel p_channel,
                                    template Channel p_channel,
                                    template boolean p_transmissionSuccessStatus,
                                    template boolean p_transmissionSuccessStatus) :=
                                    template integer p_achievedSendPower) :=
           {commandReference          := p_commandReference,
           {commandReference          := p_commandReference,
            channel                   := p_channel,
            channel                   := p_channel,
            transmissionSuccessStatus := p_transmissionSuccessStatus,
            transmissionSuccessStatus := p_transmissionSuccessStatus,
            achievedSendPower         := p_achievedSendPower
            achievedSendPower         := ?
           } // End mw_In_Status
           } // End mw_In_Status
        
        
    } // End of group inSapPrimitives
    } // End of group inSapPrimitives
+7 −2
Original line number Original line Diff line number Diff line
@@ -36,8 +36,7 @@ module LibItsDcc_TypesAndValues {
        type record UtRadioCommandIndication { 
        type record UtRadioCommandIndication { 
            Channel channel,
            Channel channel,
            integer measuredPower,
            integer measuredPower,
            integer interPacketSpacing_Toff,
            integer interPacketSpacing_Toff
            integer burstLength_Ton
        }
        }
        
        
    } // End of group utRadioPrimitives
    } // End of group utRadioPrimitives
@@ -83,6 +82,12 @@ module LibItsDcc_TypesAndValues {
        }
        }
            
            
    } // End of group subFields
    } // End of group subFields
    
    group Constants {
        
        const integer c_maxCommandReference := 256;
     
     } // End of group Constants
}
}
with {
with {
    encode "LibItsDcc_TypesAndValues"
    encode "LibItsDcc_TypesAndValues"