Newer
Older
* @desc Module containing functions for DENM
*
*/
// LibCommon
import from LibCommon_Sync all;
import from LibCommon_VerdictControl all;
// LibIts
import from LibIts_TestSystem all;
import from LibIts_Interface all;
import from LibItsCommon_Functions all;
import from LibCommon_Time {
modulepar PX_TNOAC;
function f_sleep
};
import from LibItsDenm_TypesAndValues all;
import from LibItsDenm_Templates all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
/**
* @desc Setups default configuration
*/
function f_cfUp() runs on ItsFa {
map(self:utPort, system:utPort);
map(self:denmPort, system:denmPort);
f_connect4SelfOrClientSync();
} // end f_cfUp
/**
* @desc Deletes default configuration
*/
function f_cfDown() runs on ItsFa {
unmap(self:utPort, system:utPort);
f_disconnect4SelfOrClientSync();
} // end f_cfDown
group altsteps {
/**
* @desc The base default.
*/
altstep a_default() runs on ItsFa {
[] denmPort.receive {
log("*** a_default: ERROR: Received an unexpected message ***");
log("*** a_default: INCONC: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
log("*** a_default: INCONC: Timeout while awaiting the reception of a message ***");
[] a_shutdown() {
f_poDefault();
f_cfDown();
log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
}
/**
* @desc Default handling the cancellation of an event.
* @param p_trigger Indicates if the cancellation have to be raised by the test system(e_ets)
* or at the application layer of the IUT(e_iut).
* @param p_event The event to cancel.
*/
altstep a_cancelEvent(in template (value) Trigger p_trigger, in template (value) Situation p_event) runs on ItsFa {
[] a_shutdown() {
f_poCancelEvent(p_trigger, p_event);
f_cfDown();
log("*** a_cancelEvent: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
}
} // end group altsteps
group preambles {
/**
* @desc The default preamble.
*/
function f_prDefault() runs on ItsFa {
vc_default := activate(a_default());
}
/**
* @desc Brings the IUT into an initial state.
*/
function f_prInitialState() runs on ItsFa return FncRetCode {
var FncRetCode v_ret := e_success;
return v_ret;
}
} // end group preambles
group postambles {
/**
* @desc The default postamble.
*/
function f_poDefault() runs on ItsFa {
var FncRetCode v_ret := e_success;
//empty
}
/**
* @desc Postamble including cancellation of an event.
berge
committed
* @param p_trigger Indicates if the cancellation have to be raised by the test system(e_ets)
* or at the application layer of the IUT(e_iut).
*/
function f_poCancelEvent(template (value) Trigger p_trigger, template (value) Situation p_event) runs on ItsFa {
var FncRetCode v_ret := e_success;
m_denmWithCause(c_dataVersionCancellation, p_event, m_eventPosition(f_getTsCurrentPosition()), f_getTsStationId())
f_utTriggerEvent(m_utEventCancellation(p_event, c_dataVersionCancellation));
}
f_poDefault();
}
} // end group postambles
group sendFunctions {
/**
* @desc Sends a DEN message
* @param p_sendMsg The DEN message to send.
*/
function f_sendDenMessage(template (value) DenmReq p_sendMsg) runs on ItsFa {
p_sendMsg.msgOut.denm.management.actionID.sequenceNo := vc_sequenceNo;
denmPort.send(p_sendMsg);
}
} // end sendFunctions
group receiveFunctions {
/**
* @desc Awaits a DEN message
* @param p_rcvMsg The expected message to be received.
function f_awaitDenMessage(template (present) DenmInd p_rcvMsg) runs on ItsFa {
f_awaitDenMessageOut(p_rcvMsg, v_denmInd);
* @param p_rcvMsg The expected message to be received.
* @param p_rcvdMsg The received message - OUT.
*/
function f_awaitDenMessageOut(in template (present) DenmInd p_rcvMsg, out DenmInd p_rcvdMsg) runs on ItsFa {
log("*** f_awaitDenMessageOut: INFO: Timeout while awaiting the reception of a message ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
}
} // end receiveFunctions
group getFunctions {
* @return Default expiry time of DENM events
*/
function f_getIutDefaultEventDuration() return TimeStamp {