/**
* @author ETSI / STF422_EETS
* @version $URL:$
* $Id:$
* @desc Fast service advertisement protocol (ISO 24102-5) functions
*/
module LibItsFsap_Functions {
// Libcommon
import from LibCommon_Sync all;
import from LibCommon_Time {
function f_sleepIgnoreDef
};
// LibIts
import from CALMmanagement language "ASN.1:1997" {
type
ITS_scuId, ApplicationID
};
import from CALMiitsscu language "ASN.1:1997" {
type
ITS_SCUtype
};
import from CALMfsap language "ASN.1:1997" {
type
GCschedule, ServiceDataReg
};
import from CALMmsap language "ASN.1:1997" {
type CommandRef
};
import from LibItsFntp_TypesAndValues {
const c_portNon
};
import from LibItsMgt_Templates all;
import from LibItsMgt_Functions all;
import from LibItsFsap_TypesAndValues all;
import from LibItsFsap_Templates all;
import from LibItsFsap_Pixits all;
import from LibItsFsap_Pics all;
import from LibItsCommon_Functions {
function
f_utInitializeIut, f_utCommandRequestConfirm
};
import from LibItsFntp_Templates all;
import from LibIts_Interface {
type
ItsMgt, ItsAdapterComponent
};
group fsapConfigurationFunctions {
/**
* @desc This configuration features:
*
Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)
* MGT1 IISC Port (IISC/LAN) is used if specified
* @param p_iicpMGM Set to true if IISC port shall be used
*/
function f_cf01Up(in boolean p_iicpMGM) runs on ItsMgt {
// Map
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
map(self:mgtMFSapPort, system:mgtMFSapPort);
if (p_iicpMGM == true) {
map(self:iiscPort, system:iiscPort);
}
// Connect
f_connect4SelfOrClientSync();
// Set processing on shutdown
activate(a_cf01Down(p_iicpMGM));
// Initialize the component
f_initialiseComponent("cf01Up", p_iicpMGM);
// Initialze the IUT
f_initialState();
} // End of function f_cf01Up
/**
* @desc Deletes configuration cf01
* @param p_iicpMGM Set to true if IISC port shall be used
*/
function f_cf01Down(in boolean p_iicpMGM) runs on ItsMgt {
deactivate;
// Unmap
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
unmap(self:mgtMFSapPort, system:mgtMFSapPort);
if (p_iicpMGM == true) {
unmap(self:iiscPort, system:iiscPort); // FIXME To be removed
}
// Disconnect
f_disconnect4SelfOrClientSync();
} // End of f_cf01Down
/**
* @desc Behavior function for initializing component's variables and tables
* @param p_componentName Name of the component
* @param p_iicpMGM Set to true if IISC port shall be used
*/
function f_initialiseComponent(in charstring p_componentName, in boolean p_iicpMGM) runs on ItsMgt {
// Initialize variables
// Set defaults
activate(a_mgtMFSapPortDefault()); // Default for MGT module / MF-SAP port
activate(a_fsapDefault());
if (p_iicpMGM == true) {
activate(a_iiscDefault()); // Default for Iisc module
}
} // end f_initialiseComponent
} // End of group fsapConfigurationFunctions
group preambles {
/**
* @desc Brings the IUT into an initial state.
*/
function f_initialState() {
f_utInitializeIut(m_fsapInitialize);
f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...)
} // End of function f_initialState
} // End of group preambles
group postambles {
/**
* @desc The default postamble.
*/
function f_poDefault() runs on ItsMgt {
// Nothing to do
} // End of function f_poDefault
} // End of group postambles
group adapterControl {
/**
* @desc Triggers event in the test system adaptation via NF-SAP interface.
* @param p_event The event to trigger
*/
// function f_acTriggerEvent(template (value) AcFsapPrimitive p_event) runs on ItsAdapterComponent {
// acPort.send(p_event);
// }
} // End of group adapterControl
group testerFunctions {
} // End of group testerFunctions
group iutFunctions {
/**
* @desc Gets the Local/source ITS scuID
* @return The Local/source ITS scuID
* @see PX_LOCAL_ITS_SCU_ID
* @verdict Unchanged
* @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment
*/
function f_getIutLocalITSscuId() return ITS_scuId {
return PX_LOCAL_ITS_SCU_ID;
}
/**
* @desc Gets the type ITS scuID
* @return The type ITS scuID
* @see PX_LOCAL_ITS_TYPE
* @verdict Unchanged
* @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment
*/
function f_getIutLocalITSType() return ITS_SCUtype {
return PX_LOCAL_ITS_TYPE;
}
/**
* @desc Gets the SAM retransmit timer.
* @return SAM retransmit timer
*/
function f_getIutSAMRetransmitTimer() return float {
return int2float(
PICS_SAM_RETRANSMIT_TIMER) / 1000.0;
}
/**
* @desc Gets the maximum SAM jitter.
* @return Maximum SAM jitter
*/
function f_getIutSAMMaxJitter() return float {
return int2float(
PICS_SAM_RETRANSMIT_TIMER) / 1000.0;
}
/**
* @desc TODO
* @return TODO
* @verdict TODO
*/
function f_getIutApplicationID() return ApplicationID {
return PX_APPLICATION_ID;
}
/**
* @desc TODO
* @return TODO
* @verdict TODO
*/
function f_getIutGCscheduleWithAccessTechAndNonIP() return GCschedule {
return { PX_GSCHED_ACCESS_TECH_NONIP };
}
/**
* @desc TODO
* @return TODO
* @verdict TODO
*/
function f_getIutServiceDataReg() return ServiceDataReg {
return PX_SERVICE_DATA_REG;
}
} // End of group iutFunctions
group fsapAltsteps {
/**
* @desc The base default.
*/
altstep a_fsapDefault() runs on ItsMgt {
[] tc_wait.timeout {
log("*** a_fsapDefault: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[] tc_ac.timeout {
log("*** a_fsapDefault: ERROR: Timeout while awaiting the reception of a message ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[] any timer.timeout {
log("*** a_fsapDefault: INCONC: An unknown timer has expired in default ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[] a_shutdown() {
f_poDefault();
log("*** a_fsapDefault: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
if(self == mtc) {
f_cf01Down(PICS_IICP_MGM);
}
stop;
}
} // End of altstep a_fsapDefault()
/**
* @desc Default handling cf01 de-initialisation.
* @param TODO
*/
altstep a_cf01Down(in boolean p_iicpMGM) runs on ItsMgt {
[] a_shutdown() {
f_poDefault();
f_cf01Down(p_iicpMGM);
log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
} // End of altstep a_cf01Down()
} // End of group fsapAltsteps
} // End of module LibItsFsap_Functions