Commit d4a5d3ce authored by kristofferse's avatar kristofferse
Browse files

TC TC_PMR_0801_01 implemented.

New file dPMR_ExtFunctions.ttcn added.
parent 1dfaaa45
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
 
/*
 *	@author 	STF 340
 *  @version    $vx.x.x$
 *	@desc		External functions used in dPMR.
 *
 */
 

module dPMR_ExtFunctions {

	//LibCommon
	import from LibCommon_Sync all;
	import from LibCommon_VerdictControl all;
	import from LibCommon_BasicTypesAndValues all;
	import from LibCommon_DataStrings all;
	//Ats
	import from dPMR_Types all;
	
	

	//@Desc: fx_calcDialString calculates and returns the dialstring
	//		 that corresponds to the specified address.
	
	external function fx_calcDialString( CSFAddress p_addr )
	return DialString;



}  // end module dPMR_ExtFunctions


+83 −1
Original line number Diff line number Diff line
@@ -19,10 +19,11 @@
	import from dPMR_Values all;
	import from dPMR_Types all;
	import from dPMR_TestSystem all;
	import from dPMR_ExtFunctions all;

	
	
	function f_msConfig_Ut( MsCfgParams p_msCfgParams , FncRetCode p_ret )
	function f_msConfig_Ut( template MsCfgParams p_msCfgParams , FncRetCode p_ret )
	runs on Ut return FncRetCode{
		if(p_ret != e_success){
			return e_error;
@@ -64,4 +65,85 @@
//
//	} // end UtilityFunctions

	//@Desc: f_iutMsTxInit_Ut is used to prepare the MS for transmission and 
	//          sets the following parameters
	//          ColourCode 
	//			PoliteLvl   (PoliteAll, PoliteCc, Impolite)
	//          CallType    (Voice, DataTp1, DataTp2, DataTp2)

	function f_iutMsTxInit_Ut(template MsCfgParams p_msCfgParams, FncRetCode p_ret)
	runs on Ut return FncRetCode{
		if(p_ret != e_success){
			return e_error;
		}
		utPort.send(p_msCfgParams);
		tc_maxTimeCfgActRly.start;
		alt{
			[]utPort.receive(e_success){
				setverdict(pass);
				tc_maxTimeCfgActRly.stop;
				return e_success;
			}
			[]utPort.receive(e_error){
				setverdict(fail);
				tc_maxTimeCfgActRly.stop;
				log("*** f_iutMsInit_Ut: Error message received on upper tester ***");
				return e_error;
			}
			[]tc_maxTimeCfgActRly.timeout{
				setverdict(fail);
				log("*** f_iutMsInit_Ut: timeout of configuration or action ***");
				return e_error;
			}
		}
		return e_error;
	} //end f_iutMsTxInit_Ut



 	//@Desc: f_iutMsAction_Ut is used to ask IUT ms to do following actions
	//			Action Type:=  PressPtt, DekeyPtt, 

	function f_iutMsAction_Ut(template MsActParams p_msActParams, FncRetCode p_ret)
	runs on Ut return FncRetCode{
		if(p_ret != e_success){
			return e_error;
		}
		utPort.send(p_msActParams);
		return e_success;
	} //end f_iutMsAction_Ut



 	//@Desc: f_getCommonId returns the Common ID from an ISF address.
	//		 This function shall be called only with a ISF address, if called with
	//       an CSF address it will return the reserved Common ID value 0.

	function f_getCommonId( MSAddress p_msAddress )
	runs on Ut return Common_ID {
		if (ischosen(p_msAddress.isfAddress)) {
			return p_msAddress.isfAddress.common_ID; }
		else {
			return c_reserved8bits;
		}
	} // end f_getCommonId



 	//@Desc: f_getDialString returns the Dial string from an CSF address as an out parameter.
	//       The return result is successful only if the function is called with an
	//       CSF address. If called with an ISF address the functions returns an
	//       error and non-dialable address "0000000", 

	function f_getDialString( MSAddress p_msAddress )
	runs on Ut return DialString {
		if (ischosen(p_msAddress.csfAddress)) {
			return fx_calcDialString( p_msAddress.csfAddress ) ; }
		else {
			return c_nonUsedDialStr;   // Return non-used dial string
		}
	} // end f_getCommonId



} // end module dPMR_Functions
+11 −1
Original line number Diff line number Diff line
@@ -18,4 +18,14 @@ module dPMR_Pics {



}
 No newline at end of file

	
	// @desc: Radio kind ISF or CSF
	modulepar {RadioKind PIC_ISF_OR_CSF := e_isf}


	// @desc: Colour Code used by the IUT
	modulepar {ColourCode PIC_COLOUR_CODE := { isfColourCode := '577577'O }}


} // end module dPMR_PICS
 No newline at end of file
+48 −2
Original line number Diff line number Diff line
@@ -28,15 +28,57 @@ module dPMR_Pixits {
	modulepar {Payload PXT_VOICE_TEST_TONE_F3}
	modulepar {Payload PXT_VOICE_TEST_TONE_F4}


	// @desc: Type of call 
	modulepar { CallType PXT_CALL_TYPE := e_voiceGrp }

	// @desc: Address value of TE
	modulepar {MSAddress PXT_TE_ADDRESS := { csfAddress := '111111110000000000000000'B }}  // Note this value shall be overwritten. Only valid for CSF

	// @desc: Address value of IUT
	modulepar {MSAddress PXT_IUT_ADDRESS := { csfAddress := '111111110000000000000001'B }} // Note this value shall be overwritten. Only valid for CSF

	// @desc: Value of IUT Address
	modulepar {CalledId PXT_CALLED_ID} 
	//:= {isfAddress := {commonID := '11111111'B, fixedPart := '0000000000000000'B}}}


	//:= {isfAddress := {commonID := '11111111'B, fixedPart := '0000000000000000'B}}}
 	// @desc: Value of Tester Address
	modulepar {OwnId PXT_OWN_ID } //:= '111111110000000000000001'B}



// THE FOLLOWING 4 ADDRESS VALUES SHOULED BE DELETED AND REPLACED BY THE
// TWO GENERAL ADDRESSES ABOVE

	// @desc: Value of IUT Address when TE transmits
//	modulepar {CalledId PXT_TE_TX_CALLED_ID := '111111110000000000000000'B}


	// @desc: Value of Tester Address when TE transmits
//	modulepar {OwnId PXT_TE_TX_OWN_ID := '111111110000000000000001'B}


	// @desc: Value of Tester Address when IUT transmits
//	modulepar {CalledId PXT_IUT_TX_CALLED_ID := '111111110000000000000000'B}


	// @desc: Value of IUT Address when IUT transmits
//	modulepar {OwnId PXT_IUT_TX_OWN_ID := '111111110000000000000001'B}




	// @desc: The politeness level to be used by the IUT attempts to transmit
	modulepar {PoliteLvl PXT_POLITE_LVL := e_impolite}


	// @desc: The ISF common ID used by IUT 
	modulepar {Common_ID PXT_ISF_COM_ID := '00000001'B}

	// @desc: The Dialstring of the CSF address to be dialled by the IUT
	modulepar { DialString PXT_CSF_DIALSTRING := "1234567" }


	// @desc: Max Time of IUT sending back response of configuration/action's func/msg
	modulepar {float PXT_MAX_TIME_CFG_ACT_RLY := 200E-3}  // Value To be checked !!!

@@ -58,4 +100,8 @@ module dPMR_Pixits {
  // On expiry of this timer, it is considered that the action will not succeed, and thus the test case will be terminated.
  modulepar {float PXT_TWAIT := 60.0} 


  // @desc: Time of Max Case Execution
  modulepar {float PXT_MAX_CASE_EXEC_PERIOD := 5000E-3}

} // end module dPMR_Pixits 
+237 −50
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@


 module dPMR_Templates {

	//LibCommon
	import from LibCommon_DataStrings all;
	import from LibCommon_BasicTypesAndValues all;
@@ -21,17 +22,21 @@
//	import from dPMR_Functions all;


group MessageTemplates {

	template PayloadContTransmission m_payloadContTransmission ( template HeaderFrame p_headerFrame ,
																 template SuperFrameList p_superFrameList ,
																 template EndFrame p_endFrame ) := {
			headerFrame := p_headerFrame ,
			sfList := p_superFrameList,
			endFrame := p_endFrame 
	}
	} // end template m_payloadContTransmission


	template SuperFrameList m_superFrameListWith4Frames ( template SuperFrame p_superFrame) := {
	  p_superFrame,p_superFrame,p_superFrame,p_superFrame //,m_superFrame,m_superFrame,m_superFrame
	}
	} // end template m_superFrameListWith4Frames


	template SuperFrame m_superFrame (  template Frame1 m_frame1,
										template Frame2 m_frame2,
@@ -41,7 +46,8 @@
		frame2 := m_frame2,
		frame3 := m_frame3,
		frame4 := m_frame4
	}
	} // end template m_superFrame


 	template Frame1 m_frame1AudibleTestTone (	CalledId p_calledID,
												Payload p_payload)  := {
@@ -53,7 +59,8 @@
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	}
	} // end template m_frame1AudibleTestTone


  	template Frame2 m_frame2AudibleTestTone (	CalledId p_calledID,
												Payload p_payload, ColourCode p_cc)  := {
@@ -65,7 +72,8 @@
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	}
	} // end template m_frame2AudibleTestTone


  	template Frame3 m_frame3AudibleTestTone (	OwnId p_ownID,
												Payload p_payload)  := {
@@ -77,7 +85,8 @@
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	}
	} // end template m_frame3AudibleTestTone


  	template Frame4 m_frame4AudibleTestTone (	OwnId p_ownID,
												Payload p_payload, ColourCode p_cc)  := {
@@ -89,31 +98,77 @@
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := p_payload
	}
	} // end tamplate m_frame4AudibleTestTone


 	template Frame1 mw_frame1Voice ( CalledId p_calledID )  := {
		frameSync := c_fs2,
		frameNumber := e_frame1,
		calledIdUP := f_calledId2Upper(p_calledID), // & 'FFF000'H,
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := ?
	} // end template mw_frame1Voice


  	template Frame2 mw_frame2Voice ( CalledId p_calledID, ColourCode p_cc)  := {
		colourCode := p_cc,
		frameNumber := e_frame2,
		calledIdLP := f_calledId2Lower(p_calledID),
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := ?
	} // end template mw_frame2Voice
 

  	template Frame3 mw_frame3Voice ( OwnId p_ownID )  := {
		frameSync := c_fs2,
		frameNumber := e_frame3,
		ownIdUP := f_ownId2Upper(p_ownID),
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := ?
	} // end template mw_frame3Voice


  	template Frame4 mw_frame4Voice ( OwnId p_ownID, ColourCode p_cc)  := {
		colourCode := p_cc,
		frameNumber := e_frame4,
		ownIdLP := f_ownId2Lower(p_ownID),
   		communicationsMode := e_voice,
        commsFormat := ?,
        reserved2bit := c_reserved2bits,
        slowData := c_slowDataInVoiceEmpty,
        payload := ?
	} // end template mw_frame4Voice

		
	template CallOrSrvReq m_callOrSrvReq( template HeaderFrame p_headerFrame ,
										  template EndFrame p_endFrame ) := {
			headerFrame := p_headerFrame ,
			endFrame := p_endFrame 
		}
	} // end template m_callOrSrvReq


	template EndFrame m_endFrame ( template EndInformation p_endInfo ) := {
		frameSync3 := c_fs3,
		endInformation0 := p_endInfo,
		endInformation1 := p_endInfo
	} // end template m_EndFrame 

 	template HeaderInformation  m_headerInformation ( CalledId p_calledId , 
												      OwnId    p_ownId, 
												      CommunicationsMode p_commMode,
												      CommsFormat p_commFormat
												     ) := {
		headerType := e_connReqHeader,
  		calledId := p_calledId,
  		ownId := p_ownId,
  		communicationsMode := p_commMode,
    	commsFormat := p_commFormat,
  		reserved2bit := c_reserved2bits,
  		callInformation := { 
			ciInformationNormalOrPws :=c_ciInformationNormal }
	} // end m_headerInformation

} // end group MessageTemplates


group FrameTemplates {

	// This template should be deleted and replaced by the general template m_headerFrame
 	template HeaderFrame m_headerFrameConnectReq (in template HeaderInformation p_headerInformation, 
															  ColourCode        p_cc) := { 
		preamble := c_preamble,
@@ -121,7 +176,8 @@
		headerInformation0 := p_headerInformation,
		colourCode := p_cc,
		headerInformation1 := p_headerInformation
	}// end m_headerFrameConnectReq
	} // end template m_headerFrameConnectReq


 	template HeaderFrame m_headerFrame (in template HeaderInformation p_headerInformation, 
															  ColourCode        p_cc) := { 
@@ -130,7 +186,8 @@
		headerInformation0 := p_headerInformation,
		colourCode := p_cc,
		headerInformation1 := p_headerInformation
	}// end m_headerFrameConnectReq
	} // end template m_headerFrameConnectReq


	template EndInformation  m_endInformation := {
		endType := e_endFrame ,
@@ -138,20 +195,16 @@
  		txWait := e_noSpecTime,
  		statusMessage := c_dummyStatusValue,
  		reserved4bit := c_reserved4bits
	}// end m_endInformation
	} // end template m_endInformation


	template EndFrame m_endFrameConnectReq := {
		frameSync3 := c_fs3,
		endInformation0 := m_endInformation,
		endInformation1 := m_endInformation
	}
	} // end template m_endFrameConnectReq



 	template MsCfgParams m_msCfgParams( ColourCode p_cc ) := {
		colourCode := p_cc
	}

	template AckFrame mw_acknowledgementAckOnConnectReq( in template HeaderInformation p_headerInformation, 
															  ColourCode        p_cc) := { 
		preamble := c_preamble,
@@ -159,8 +212,14 @@
		headerInformation0 := p_headerInformation,
		colourCode := p_cc,
		headerInformation1 := p_headerInformation
	}
	} // end template mw_acknowledgementAckOnConnectReq


} // end group FrameTemplates


group UtilityFunctions {

		function f_calledId2Upper(CalledId p_calledId) return CalledIdUP {
			//var CalledIdUP p_tmp := CalledIdUP(p_calledId & 'FFF000'H);
			var CalledId t1 := p_calledId;
@@ -169,6 +228,8 @@
			var Common_ID t4 := t3.common_ID
			var FixedPart t5 := t3.fixedPart;

 	

			var CalledIdUP retval;
			var CalledIdUP tmp;

@@ -233,6 +294,7 @@

			return retval;
		}

	function f_ownId2Lower(OwnId p_ownId) return OwnIdLP {
		var OwnId t1 := p_ownId;
		var MSAddress t2 := p_ownId;
@@ -255,5 +317,130 @@

		return retval;
	}
	}
} //end UtilityFunctions

group InformationElementTemplates {

 	template HeaderInformation  m_headerInformation( HeaderType p_hdrTp,
													 CalledId p_calledId , 
												     OwnId    p_ownId, 
												     CommunicationsMode p_commMode,
												     CommsFormat p_commFormat
												    ) := {
		headerType := p_hdrTp,
  		calledId := p_calledId,
  		ownId := p_ownId,
  		communicationsMode := p_commMode,
    	commsFormat := p_commFormat,
  		reserved2bit := c_reserved2bits,
  		callInformation := { 
			ciInformationNormalOrPws :=c_ciInformationNormal }
	} // end m_headerInformation


 	template HeaderInformation  mw_headerInformationVoiceTx ( CalledId p_calledId , 
												      		  OwnId    p_ownId, 
												      		  CommunicationsMode p_commMode,
												          	  CommsFormat p_commFormat
												     		) := {
		headerType := e_connReqHeader,
  		calledId := p_calledId,
  		ownId := p_ownId,
  		communicationsMode := p_commMode,
    	commsFormat := p_commFormat,
  		reserved2bit := c_reserved2bits,
  		callInformation := ?
	} // end mw_headerInformationVoiceTx


	template EndInformation  mw_endInformation( AckRequest p_ackReq ) := { 
		endType := e_endFrame ,
  		ackRequest := p_ackReq,
  		txWait := ?,
  		statusMessage := ?,
  		reserved4bit := c_reserved4bits
	} // end m_endInformation





	template MSAddress m_msAddressFromIsfAddr( ISFAddress p_iadr ) := {
		isfAddress := p_iadr 
	} // end m_msAddressFromIsfAddr


	template MSAddress m_msAddressFromCsfAddr( CSFAddress p_cadr ) := {
		csfAddress := p_cadr 
	} // end m_msAddressFromCsfAddr

} //end group InformationElementTemplates 


	template ISFAddress m_isfAddrFromCommonId( Common_ID p_cid ) := {
		common_ID := p_cid,
		fixedPart := c_fixedPartAddr
	} // end m_msAddressFromCommonId


group ConfigurationTemplates {


	template MsCfgParams m_msCfgParamsIsfRx( ColourCode p_cc, Common_ID p_cid ) := {
  		colourCode := p_cc,
		politeLvl  := omit,
		callType   := omit,
		dialString := omit,
		isfCidAddr := p_cid
	} // m_msCfgParamsIsfRx


	template MsCfgParams m_msCfgParamsCsfRx( ColourCode p_cc, DialString p_dialstr ) := {
  		colourCode := p_cc,
		politeLvl  := omit,
		callType   := omit,
		dialString := p_dialstr,
		isfCidAddr := omit
	} // m_msCfgParamsCsfRx


 	template MsCfgParams m_msCfgParamsIsfTx( ColourCode p_cc, PoliteLvl p_pl, CallType p_ct, Common_ID p_cid ) := {
		colourCode := p_cc,
   		politeLvl  := p_pl,  
		callType   := p_ct,   
		dialString := omit,
		isfCidAddr := p_cid
	} // m_msCfgParamsIsf


	template MsCfgParams m_msCfgParamsCsfTx( ColourCode p_cc, PoliteLvl p_pl, CallType p_ct, DialString p_dialStr) := {
		colourCode := p_cc,
   		politeLvl  := p_pl,  
		callType   := p_ct,   
		dialString := p_dialStr,
		isfCidAddr := omit
	} // m_msCfgParamsCsfTx


	/*@desc Upper tester indicates the positive confirmation of an audiable Test tone
	**		from the IUT.
	*/
	template IutIndMsg m_testToneDetected := e_testTone;



	/*@desc Action to be performed communicated via Upper tester interface.
	*/
	template MsActParams m_msActPressPtt := e_pressPtt;


	/*@desc Action to be performed communicated via Upper tester interface.
	*/
	template MsActParams m_msActDekeyPtt := e_dekeyPtt;



} // end group ConfigurationTemplates


} // end module dPMR_Templates
Loading