/** * @author ETSI / STF405 * @version $URL$ * $Id$ * @desc Module containing functions for GeoNetworking * */ module LibItsGeoNetworking_Functions { // Libcommon import from LibCommon_BasicTypesAndValues all; // LibIts import from LibIts_TestSystem all; import from LibIts_Interface all; import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Templates all; /** * @desc Create Facility component and connects GeoNetworking port * @remark Only used when ItsFa is a PTC * @param p_ptcDenm returned Facility component variable */ function f_ptcGeoNetworkingUp(out ItsNt p_ptcGeoNetworking) { // Create Facility component p_ptcGeoNetworking := ItsNt.create("GeoNetworking Tester"); // map ports map(p_ptcGeoNetworking:geoNetworkingPort, system:geoNetworkingPort); } // end f_ptcGeoNetworkingUp /** * @desc Wait for component to finish and unmap GeoNetworking ports * @remark Only used when ItsFa is a PTC * @param p_camPtc Facility component variable */ function f_ptcGeoNetworkingDown(in ItsNt p_ptcGeoNetworking) runs on ItsMtc { tc_guard.start; alt { [] p_ptcGeoNetworking.done { tc_guard.stop; } [] tc_guard.timeout { log("*** f_ptcGeoNetworkingDown: ERROR: Timeout while waiting for component ***"); setverdict(inconc); } } unmap(p_ptcGeoNetworking:geoNetworkingPort); } // end f_ptcGeoNetworkingDown group geoAltsteps { /** * @desc The base default. */ altstep a_default() runs on ItsNt { [] geoNetworkingPort.receive { setverdict (inconc, "Received an unexpected message"); //TODO shall stop be called here? stop; } [] tc_wait.timeout { setverdict (inconc, "Timeout while awaiting reaction of the IUT prior to Upper Tester action"); //TODO shall stop be called here? stop; } [] tc_ac.timeout { setverdict (inconc, "Timeout while awaiting the reception of a message"); //TODO shall stop be called here? stop; } } group geoGeoUnicastAltsteps { /** * @desc Receive GeoUnicast packet */ altstep a_receiveGeoUnicast( in template (present) LongPosVector p_senderLongPosVec, in template (present) ShortPosVector p_destinationLongPosVec, in template (present) StationTypeIdentifier p_stationType, in template (present) UInt16 p_seqNumber ) runs on ItsNt { [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoUnicastHeader( p_senderLongPosVec, p_destinationLongPosVec, p_stationType, p_seqNumber)))) {} } /** * @desc Receive GeoUnicast packet for specific destination */ altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationLongPosVec) runs on ItsNt { [] a_receiveGeoUnicast(?, p_destinationLongPosVec, ?, ?) {} } /** * @desc Receive any GeoUnicast packet */ altstep a_receiveAnyGeoUnicast() runs on ItsNt { [] a_receiveGeoUnicast(?, ?, ?, ?) {} } } // end geoGeoUnicastAltsteps group geoLocationServiceAltsteps { /** * @desc Receive Location Service Request */ altstep a_receiveLsRequest( in template (present) StationTypeIdentifier p_stationType, in template (present) UInt16 p_seqNumber, in template (present) GN_Address p_gnAddress ) runs on ItsNt { [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu( mw_lsRequestHeader( p_stationType, p_seqNumber, p_gnAddress)))) {} } /** * @desc Receive any Location Service Request */ altstep a_receiveAnyLsRequest() runs on ItsNt { [] a_receiveLsRequest(?, ?, ?) {} } /** * @desc Receive Location Service Request and send Location Service Reply */ altstep a_receiveLsRequestAndReply( in template (present) StationTypeIdentifier p_reqStationType, in template (present) UInt16 p_reqSeqNumber, in template (value) GN_Address p_gnAddress, in template (value) LongPosVector p_repSrcPosVector, in template (value) LongPosVector p_repSenderPosVector, in template (value) StationTypeIdentifier p_repStationType, in template (value) UInt16 p_repSeqNumber ) runs on ItsNt { [] a_receiveLsRequest(p_reqStationType, p_reqSeqNumber, p_gnAddress) { geoNetworkingPort.send(m_geoNwReq(m_geoNwPdu( m_lsRequestHeader( p_repSrcPosVector, p_repSenderPosVector, p_repStationType, p_repSeqNumber, p_gnAddress )))) } } } // end geoLocationServiceAltsteps } // end geoAltsteps group preambles { /** * @desc The default preamble. */ function f_prDefault() runs on ItsNt { activate(a_default()); } /** * @desc Brings the IUT into an initial state. * @return */ function f_prInitialState() runs on ItsNt { f_prDefault(); // TODO: any specific action ? setverdict(pass); } } // end preambles group postambles { /** * @desc The default postamble. */ function f_poDefault() runs on ItsNt { setverdict(pass); } } // end postambles group upperTester { function f_utGenerateIpv6Message() runs on ItsNt { } } // end upperTester group testAdapter { function f_taStartBeaconing(in template (value) Header p_beaconHeader) { } function f_taStopBeaconing() { } } // end testAdapter group testerFunctions { function f_getTesterLongPosVector() return LongPosVector { var LongPosVector v_longPosVector; return v_longPosVector; } function f_getTesterGnAddress() return GN_Address { var GN_Address v_gnAddress; return v_gnAddress; } } // end testerFunctions group posVectorFunctions { function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector { var ShortPosVector v_shortPosVector; return v_shortPosVector; } function f_getIutShortPosVector() return ShortPosVector { var ShortPosVector v_shortPosVector; return v_shortPosVector; } } // end posVectorFunctions } // end LibItsGeoNetworking_Functions