Printer FriendlyEmail Article Link

TTworkbench: Can I pass component and port as parameter a function for mapping in TTCN-3?

Answer
// pre-definition  
type component MtcType {
        port myPort mtcPort;
}
type component SystemType {
        port myPort systemPort;
}
You can define the following structure, which is however unsecure.
function f_config(SystemType.systemPort p_sysPort) runs on MtcType {
        map (mtc:mtcport, system:p_sysPort);    
}

Since ES 201 873-1 v4.6.1, you can specify also MTC and TSI type for mapping behaviour function, like
// recommended
function myFunction() runs on MtcType mtc MtcType system SystemType {
map (mtc:mtcPort,  system: systemPort);
}

Product : TTCN-3 Language