/**
 *  @author   ETSI / STF455
 *  @version  $URL$
 *            $Id$
 *  @desc     Testcases for Access Technology Support Protocols (ISO 21218) (TP version: 1.1.2 - v06)
 *
 */
 module ItsAtsp_TestCases {

    // Libcommon
    import from LibItsCalm_Interface all;
    import from LibCommon_Sync all;
    import from LibCommon_BasicTypesAndValues {
            type UInt8
            };

    // LibIts
    import from LibItsAtsp_Pics all;
    import from LibItsAtsp_Pixits all;
    import from LibItsAtsp_Templates all;
    import from LibItsAtsp_TypesAndValues all;
    import from LibItsAtsp_Functions all;
    import from LibItsAtsp_Pixits all;
    
    import from LibItsCalm_TestSystem {
        type ItsCalmSystem 
    };

    import from LibItsCalm_Interface {
        type ItsCalm
       };

    import from LibItsMgt_Functions {
        function f_getNextCommandRef
    };

    import from LibItsMgt_TypesAndValues {
        type IParamNoList, IParamList
    }; 
    
    // ASN.1 modules    
    import from CALMllsap language "ASN.1:1997" {
        type 
            Link_ID, MedType, CIstatus, VirtualCIs,
            IN_UNITDATA_request,
            I_Param, DataRate, Errors,
            UserPriority,
            INsapPrimitivesUp,
            RemoteCIID
    };
    import from CALMmsap language "ASN.1:1997" {
        type 
            MI_Command_request, MI_Command_confirm
    };
    
    
    // State event transitions
    group stateEventTransitions {
            
        group validBehavior {

                /**
                 * @desc    TP: IUT with CI supporting 48-bit MAC addresses registers correctly at the management entity
                 * @author  STF 455
                 * @config  
                 * 
                 * <pre>
                 * PICS selection: PICS_DYNREG AND PICS_MAC48
                 * Initial conditions: 
                 *  with {
                 *       the IUT being in the CI state "not-existent"
                 *       }
                 * 
                 * Expected behaviour:
                 *  ensure that {
                 *     when {
                 *          the IUT starts operation
                 *          }
                 *     then {
                 *          the IUT registers properly at the ITS-S management
                 *          }
                 *     }
                 *     
                 * Final conditions:
                 * ensure that {
                 *     when {
                 *          the IUT presented the state "registered" to the ITS-S management
                 *          }
                 *     then {
                 *          the IUT has a LocalCIID representing the 48 bit MAC address of the IUT
                 *          }
                 *     }
                 * </pre>
                 * 
                 * @version 2013-05-07.0
                 * @since   2013-05-07.0
                 * @status  empty test case
                 * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/01
                 * @remark  to be created
                 */
            testcase TC_ATSP_SE_BV_01() runs on ItsCalm system ItsCalmSystem {
                // Local variables
                
                // Test control
                if (not(PICS_DYNREG and PICS_MAC48)) {
                    log("*** TC_ATSP_SE_BV_01: ERROR: 'PICS_DYNREG' and 'PICS_MAC48' required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                // Clause 'Initial conditions'
                // Request operator to switch on the SUT or to activate the IUT
                action("Switch on SUT or activate IUT");
                
                // Test Body
                // Clause 'when'
                log("*** TC_ATSP_SE_BV_01: INFO: Waiting for power-on of IUT ***");
                
                // Clause 'then'
                
                // Wait for MI-Request.request "RegReq"
                f_cnAwaitAndConfirmMI_RequestCI(mw_miRegRequest(f_get_CI_LinkID(), ?, m_regRequest(PX_CI_MED_TYPE)), true);
                
                // Reply MI-Command.request "RegCmd"
                f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRegistrationCommandRequest(
                                                            f_get_CI_LinkID(), 
                                                            f_getNextCommandRef(), 
                                                            m_regCommand(PX_ITS_SCU_ID, PX_CI_MED_TYPE)), true);
                
                // Clause 'when'
                // the IUT registers properly at the ITS-S management
                // the IUT presented the state "registered" to the ITS-S management
                f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusRegistered)), true);
            
                //Clause 'then'
                // the IUT has a LocalCIID representing the 48 bit MAC address of the IUT
                // Try to address the VCI using the expected Link-ID. Return value is not used.
                f_cnGetCiStatusParameterValueCI(f_get_CI_LinkID());
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                log("*** TC_ATSP_SE_BV_01: INFO: test body done ***");
                
                // Postamble
                f_poDefault();
                f_cf01Down();
                log("*** TC_ATSP_SE_BV_01: INFO: Postamble: done ***");                
            } // End of testcase TC_ATSP_SE_BV_01
            
            /**
             * @desc    TP: IUT with CI not supporting 48-bit MAC addresses registers correctly at the management entity
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_DYNREG AND NOT PICS_MAC48
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "not-existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT starts operation
             *          }
             *     then {
             *          the IUT registers properly at the ITS-S management
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT presented the state "registered" to the ITS-S management
             *          }
             *     then {
             *          the IUT has a LocalCIID created from ITS-SCU-ID and MedID
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/02
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_DYNREG and not PICS_MAC48)) {
                        log("*** TC_ATSP_SE_BV_02: ERROR: 'PICS_DYNREG' and NOT 'PICS_MAC48' required for executing the TC ***");
                        stop;
                    }
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    
                    // Test Body
                    // Clause 'then'
                    
                    // Wait for MI-Request.request "RegReq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRegRequest(f_get_CI_LinkID(), ?, m_regRequest(PX_CI_MED_TYPE)), true);
                    
                    // Reply MI-Command.request "RegCmd"
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRegistrationCommandRequest(
                                                            f_get_CI_LinkID(), 
                                                            f_getNextCommandRef(), 
                                                            m_regCommand(PX_ITS_SCU_ID, PX_CI_MED_TYPE)), false);
                    
                    //Clause 'when'
                    //the IUT registers properly at the ITS-S management
                    //        the IUT presented the state "registered" to the ITS-S management
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusRegistered)), true);
                
                    //Clause 'then'
                    //        the IUT has a LocalCIID created from ITS-SCU-ID and MedID
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_02: INFO: test body done ***");
                        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_02: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_02
            
            /**
             * @desc    TP: IUT repeats registration as long as management entity does not confirm it
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_DYNREG
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "not-existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT starts operation
             *          }
             *     then {
             *          the IUT repeats continuously the registration procedure as long as the ITS-S management does not confirm with MI-COMMAND "RegCmd"
             *          }
             *     }
             *     
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/03
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var boolean v_discard;
                    var integer v_messageCounter;
                    
                    // Test control
                    if (not(PICS_DYNREG)) {
                        log("*** TC_ATSP_SE_BV_03: ERROR: 'PICS_DYNREG' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    log("*** TC_ATSP_SE_BV_03: INFO: Waiting for power-on of IUT ***");
                    
                    // Clause 'then'
                    for(v_messageCounter := 0; v_messageCounter < 5; v_messageCounter := v_messageCounter + 1) {
                        // Wait for MI-Request.request "RegReq"
                        f_cnAwaitAndConfirmMI_RequestCI(mw_miRegRequest(f_get_CI_LinkID(), ?, m_regRequest(PX_CI_MED_TYPE)), true);
                    }
                    
                    // Reply MI-Command.request "RegCmd"
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRegistrationCommandRequest(
                                                            f_get_CI_LinkID(), 
                                                            f_getNextCommandRef(), 
                                                            m_regCommand(PX_ITS_SCU_ID, PX_CI_MED_TYPE)), false);
                                
                    // Check for reception of Status notification (I-Parameter 12 "CIstatus" set to "registered". 
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusRegistered)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_03: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_03: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_03                

            /**
             * @desc    TP: IUT with CI class "CIC-l2" automatically creates a UC-VCI and reaches the CI state "active"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l2
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "not-existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT has finished the registration procedure
             *          }
             *     then {
             *          the IUT creates a UC-VCI
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT created a UC-VCI
             *          }
             *     then {
             *          the IUT is in the state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/04
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_04() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var integer v_messageCounter;
                    
                    // Test control
                    if (not(PICS_CIC_l2)) {
                        log("*** TC_ATSP_SE_BV_04: ERROR: 'PICS_CIC_l2' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    // the IUT has finished the registration procedure
                    f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    
                    // Clause 'then'
                    //the IUT creates a UC-VCI(applying MAC unicast communications)
                    
                    //TODO: Cecking for a UC-VCI
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_UC, f_get_CI_Local_CIID())), true);
                    
                    // Clause 'then'
                    // the IUT is in the state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_04: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_04: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_04

            /**
             * @desc    TP: IUT with CI class "CIC-l3" automatically creates a BC-VCI and reaches the CI state "active"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l3
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "not-existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT has finished the registration procedure
             *          }
             *     then {
             *          the IUT creates a BC-VCI
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT created a BC-VCI
             *          }
             *     then {
             *          the IUT is in the state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/05
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_05() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var integer v_messageCounter;
                    
                    // Test control
                    if (not(PICS_CIC_l3)) {
                        log("*** TC_ATSP_SE_BV_05: ERROR: 'PICS_CIC_l3' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    
                    // Clause 'then'
                    //the IUT creates a BC-VCI(applying MAC broadcast communications)
                    //TODO: checking for BC-VCI
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_BC, f_get_CI_Local_CIID())), true);
                    
                    // Clause 'then'
                    // the IUT is in the state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_05: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_05: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_SE_BV_05

            /**
             * @desc    TP: IUT with CI class "CIC-l4" automatically creates a RX-VCI and reaches the CI state "active"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l4
             * Initial conditions: 
             *  with {
             *       he IUT being in the CI state "registered"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT has finished the registration procedure
             *          }
             *     then {
             *          the IUT creates a RX-VCI
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT created a BC-VCI
             *          }
             *     then {
             *          the IUT is in the state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/06
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_06() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var integer v_messageCounter;
                    
                    // Test control
                    if (not(PICS_CIC_l4)) {
                        log("*** TC_ATSP_SE_BV_06: ERROR: 'PICS_CIC_l4' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    
                    // Clause 'then'
                    //the IUT creates a RX-VCI
                    // this is given by notification of the status "active"
                    
                    // Clause 'then'
                    // the IUT is in the state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_06: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_06: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_06

            /**
             * @desc    TP: IUT with CI class "CIC-l1"or "CIC-il1" automatically creates a UC-VCI and a BC-VCI and reaches the CI state "active"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l1 OR PICS_CIC_il1
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "registered", and MAC multicast groups are not known to the IUT
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT has finished the registration procedure
             *          }
             *     then {
             *          the IUT creates a UC-VCI and a BC-VCI
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT created a UC-VCI and a BC-VCI
             *          }
             *     then {
             *          the IUT is in the state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/07
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_07() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CfAtspEventInd v_result;
                    var template CfAtspEventInd v_cf_UC_VCI_Event;
                    var boolean v_UC_VCI_created;
                    var template CfAtspEventInd v_cf_BC_VCI_Event;
                    var boolean v_BC_VCI_created;
                    var boolean v_discard := true;
                    
                    // Test control
                    if (not(PICS_CIC_l1 or PICS_CIC_il1)) {
                        log("*** TC_ATSP_SE_BV_07: ERROR: 'PICS_CIC_l1' OR 'PICS_CIC_il1' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    
                    // Clause 'then'
                    //the IUT creates a BC-VCI(applying MAC broadcast communications)
                    v_UC_VCI_created := false;
                    v_BC_VCI_created := false;
                    
                    //TODO: UC-VCI and a BC-VCI correct template values, how to distinguish between UC and BC?
                    v_cf_UC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(f_get_CI_LinkID(), ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_UC, f_get_CI_Local_CIID()))));
                    v_cf_BC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(f_get_CI_LinkID(), ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_BC, f_get_CI_Local_CIID()))));
                    
                    log("*** TC_ATSP_SE_BV_07: INFO: Expected MI-Request-request: ", v_cf_UC_VCI_Event, " ***");
                    log("*** TC_ATSP_SE_BV_07: INFO: Expected MI-Request-request: ", v_cf_BC_VCI_Event, " ***");
                    tc_wait.start;
                    alt {
                        [not v_UC_VCI_created] cfPort.receive(v_cf_UC_VCI_Event) -> value v_result {
                            v_UC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_07: INFO: Expected UC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_BC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [not v_BC_VCI_created] cfPort.receive(v_cf_BC_VCI_Event) -> value v_result {
                            v_BC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_07: INFO: Expected BC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_UC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [] cfPort.receive(CfAtspEventInd : ?) -> value v_result { 
                            if (v_discard == false) { 
                                tc_wait.stop;
                                log("*** TC_ATSP_SE_BV_07: ERROR: An unexpected MI-REQUEST was received ***", v_result);
                                f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                            } else { 
                                log("*** TC_ATSP_SE_BV_07: INFO: An unexpected MI-REQUEST was received, repeating check ***");
                                f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                                repeat;
                            } 
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_SE_BV_07: ERROR: Timeout while waiting for event check result ***");
                            f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                        }
                    } // End of 'alt' statement
                    
                    // Clause 'then'
                    // the IUT is in the state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_07: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_07: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_07

            /**
             * @desc    TP: IUT with CI class "CIC-l3" automatically creates a BC-VCI and known MC-VCIs and reaches the CI state "active"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l3 AND PICS_MCVCI
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "registered", and at least one MAC multicast group is known to the IUT
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT has finished the registration procedure
             *          }
             *     then {
             *          the IUT creates a BC-VCI and a MC-VCI for each known MAC multicast group
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT created a BC-VCI and the MC-VCI(s)
             *          }
             *     then {
             *          the IUT is in the state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/08
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_08() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var integer v_messageCounter;
                    var CfAtspEventInd v_result;
                    var template CfAtspEventInd v_cf_BC_VCI_Event;
                    var boolean v_BC_VCI_created;
                    var template CfAtspEventInd v_cf_MC_VCI_Event;
                    var boolean v_MC_VCI_created;
                    var boolean v_discard := true;
                    
                    // Test control
                    if (not(PICS_CIC_l3 and PICS_MCVCI)) {
                        log("*** TC_ATSP_SE_BV_08: ERROR: 'PICS_CIC_l3' OR 'PICS_MCVCI' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    
                    // Clause 'then'
                    //the IUT creates a BC-VCI(applying MAC broadcast communications)
                    v_BC_VCI_created := false;
                    v_MC_VCI_created := false;
                    v_cf_BC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(mw_miLinkIndAny, ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_BC, f_get_CI_Local_CIID()))));
                    v_cf_MC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(mw_miLinkIndAny, ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_MC, f_get_CI_Local_CIID()))));
                    
                    log("*** TC_ATSP_SE_BV_08: INFO: Expected MI-Request-request: ", v_cf_BC_VCI_Event, " ***");
                    log("*** TC_ATSP_SE_BV_08: INFO: Expected MI-Request-request: ", v_cf_MC_VCI_Event, " ***");
                    tc_wait.start;
                    alt {
                        [not v_BC_VCI_created] cfPort.receive(v_cf_BC_VCI_Event) -> value v_result {
                            v_BC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_08: INFO: Expected BC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_MC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [not v_MC_VCI_created] cfPort.receive(v_cf_MC_VCI_Event) -> value v_result{
                            v_MC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_08: INFO: Expected MC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_BC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [] cfPort.receive(mw_miEventMI_RequestRequest_any) -> value v_result { 
                            if (v_discard == false) { 
                                tc_wait.stop;
                                log("*** TC_ATSP_SE_BV_08: ERROR: An unexpected MI-REQUEST was received ***", v_result);
                                f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                            } else { 
                                log("*** TC_ATSP_SE_BV_08: INFO: An unexpected MI-REQUEST was received, repeating check ***");
                                f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                                repeat;
                            } 
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_SE_BV_08: ERROR: Timeout while waiting for event check result ***");
                            f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                        }
                    } // End of 'alt' statement
                    
                    // Clause 'then'
                    // the IUT is in the state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_08: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_08: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_08

            /**
             * @desc    TP: IUT with CI class "CIC-l1" or "CIC-il1" automatically creates a UC-VCI and a BC-VCI and known MC-VCIs and reaches the CI state "active"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: (PICS_CIC_l1 OR PICS_CIC_il1) AND PICS_MCVCI
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "registered", and at least one MAC multicast group is known to the IUT
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT has finished the registration procedure
             *          }
             *     then {
             *          the IUT creates a UC-VCI and a BC-VCI and the MC-VCI(s)
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT created a UC-VCI and a BC-VCI and the MC-VCIs
             *          }
             *     then {
             *          the IUT is in the state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/09
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_09() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var boolean v_discard;
                    var CfAtspEventInd v_result;
                    var template CfAtspEventInd v_cf_UC_VCI_Event;
                    var boolean v_UC_VCI_created;
                    var template CfAtspEventInd v_cf_BC_VCI_Event;
                    var boolean v_BC_VCI_created;
                    var template CfAtspEventInd v_cf_MC_VCI_Event;
                    var boolean v_MC_VCI_created;
                    
                    // Test control
                    if (not((PICS_CIC_l1 or PICS_CIC_il1)and PICS_MCVCI)) {
                        log("*** TC_ATSP_SE_BV_09: ERROR: ('PICS_CIC_l1' OR 'PICS_CIC_il1') AND 'PICS_MCVCI' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Request operator to switch on the SUT or to activate the IUT
                    action("Switch on SUT or activate IUT");
                    
                    // Test Body
                    // Clause 'when'
                    f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    
                    // Clause 'when'
                    v_UC_VCI_created := false;
                    v_BC_VCI_created := false;
                    v_MC_VCI_created := false;
                    
                    //TODO: correct template values for UC-VCI, BC-VCI and MC-VCI
                    v_cf_UC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(mw_miLinkIndAny, ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_UC, f_get_CI_Local_CIID()))));
                    v_cf_BC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(mw_miLinkIndAny, ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_BC, f_get_CI_Local_CIID()))));
                    v_cf_MC_VCI_Event := mw_cfAtspRequestRequest(
                                        mw_miEventsRequest(mw_miLinkIndAny, ?, mw_miEvent21218_3(mw_miVCICreDelRes(PX_REMOTE_CIID_MC, f_get_CI_Local_CIID()))));
                    
                    log("*** TC_ATSP_SE_BV_09: INFO: Expected MI-Request-request: ", v_cf_UC_VCI_Event, " ***");
                    log("*** TC_ATSP_SE_BV_09: INFO: Expected MI-Request-request: ", v_cf_BC_VCI_Event, " ***");
                    log("*** TC_ATSP_SE_BV_09: INFO: Expected MI-Request-request: ", v_cf_MC_VCI_Event, " ***");
                    tc_wait.start;
                    alt {
                        [not v_UC_VCI_created] cfPort.receive(v_cf_UC_VCI_Event) -> value v_result {
                            v_UC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_09: INFO: Expected UC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_BC_VCI_created or not v_MC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [not v_BC_VCI_created] cfPort.receive(v_cf_BC_VCI_Event) -> value v_result{
                            v_BC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_09: INFO: Expected BC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_UC_VCI_created or not v_MC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [not v_MC_VCI_created] cfPort.receive(v_cf_MC_VCI_Event) -> value v_result{
                            v_MC_VCI_created := true;
                            log("*** TC_ATSP_SE_BV_09: INFO: Expected MC-VCI creation event received ***");
                            f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                            if(not v_UC_VCI_created or not v_BC_VCI_created)
                            {
                                tc_wait.start;
                                repeat;
                            }
                            tc_wait.stop;
                        }
                        [] cfPort.receive(mw_miEventMI_RequestRequest_any) -> value v_result { 
                            if (v_discard == false) { 
                                tc_wait.stop;
                                log("*** TC_ATSP_SE_BV_09: ERROR: An unexpected MI-REQUEST was received ***", v_result);
                                f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                            } else { 
                                log("*** TC_ATSP_SE_BV_09: INFO: An unexpected MI-REQUEST was received, repeating check ***");
                                f_cnConfirmMI_RequestCI(m_cfAtspRequestConfirm(v_result.miRequestRequest, c_ciErrStatusSuccess));
                                repeat;
                            } 
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_SE_BV_09: ERROR: Timeout while waiting for event check result ***");
                            f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                        }
                    } // End of 'alt' statement
                    
                    // Clause 'then'
                    // the IUT is in the state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_09: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_09: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_09

            /**
             * @desc    TP: IUT deregisters correctly from the management entity
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_DYNREG
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state different to "existent" or "not_existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "deregister"
             *          }
             *     then {
             *          the IUT performs deregistration
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT deregistered
             *          }
             *     then {
             *          the IUT no more is addressable by the ITS-S management entity
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/10
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_10() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_DYNREG)) {
                        log("*** TC_ATSP_SE_BV_10: ERROR: 'PICS_DYNREG' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    
                    // Get CI status
                    v_CIstatus := f_initialCIstatesOperational();
                    
                    // Test Body
                    // Clause 'when'
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miStateChangeCommandRequest(
                                                        f_get_CI_LinkID(), 
                                                        f_getNextCommandRef(), 
                                                        c_ciStateChngDeregister), true);
                    //Clause 'then'
                    //    the IUT deregistered !!??!! ToDo: This might not be possible. Check with ISO
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(
                                                                        mw_miCIStatusParam(c_ciStatusNot_existent)), true);
                    // and is no more addressable
                    f_cnTestGetCiStatusParameterValueNoReplyExpected(f_get_CI_LinkID());
                                        
                    log("*** TC_ATSP_SE_BV_10: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_10: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_10

            /**
             * @desc    TP: IUT performs inactivation
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_INACT
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected" or "suspended"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "inactivate"
             *          }
             *     then {
             *          the IUT performs inactivation
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT performed inactivation
             *          }
             *     then {
             *          the IUT no more has VCIs
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/11
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_11() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var IParamList v_IparamList;
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_INACT)) {
                        log("*** TC_ATSP_SE_BV_11: ERROR: 'PICS_INACT' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    
                    // Get CI status
                    v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID());
                    if( (v_CIstatus == c_ciStatusUnknown) or (v_CIstatus == c_ciStatusNot_existent) or (v_CIstatus == c_ciStatusExistent) or (v_CIstatus == c_ciStatusInactive) or (v_CIstatus == c_ciStatusRegistered))
                    // wrong status 
                    {
                        // Request operator to switch on the SUT or to activate the IUT
                        action("Switch on SUT or activate IUT");
						f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    	f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                        v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID());
                    }
                    // check again CI status after activation of IUT
                    if( (v_CIstatus == c_ciStatusUnknown) or (v_CIstatus == c_ciStatusNot_existent) or (v_CIstatus == c_ciStatusExistent) or (v_CIstatus == c_ciStatusInactive) or (v_CIstatus == c_ciStatusRegistered))                    // wrong status 
                    {
                        log("*** TC_ATSP_BV_11: ERROR: Invalid CI status returned ***", v_CIstatus);
                        f_selfOrClientSyncAndVerdict("error", e_timeout);  // Might be just a time-out error
                        stop;
                    }
                    else
                    {
                        log("*** TC_ATSP_BV_11: Allowed CI status returned ***", v_CIstatus);
                    }
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the COMMAND "CIstateChng" with the value "inactivate"
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngInactivate, c_ciStatusInactive, false);
                    
                    //Clause 'when'
                    //        the IUT performed inactivation
                    
                    
                    //Clause 'then'
                    v_IparamList := f_cnGetIParameterValueCI(f_get_CI_LinkID(), {c_ciIParamNoVirtualCI}, false );
                    if(lengthof(v_IparamList) == 1 and v_IparamList[0].paramNo == c_ciIParamNoVirtualCI and f_getVirualCIcount(v_IparamList[0]) == 0)
					{
						f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        log("*** TC_ATSP_SE_BV_11: INFO: test body done ***");
					}
					else if(lengthof(v_IparamList) == 0)
					{
						f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        log("*** TC_ATSP_SE_BV_11: INFO: test body done ***");
					}
					else
                    {
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        log("*** TC_ATSP_SE_BV_11: ERROR: Inactivated CI still has VCIs ***");
                    }
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_11: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_11

            /**
             * @desc    TP: IUT performs activation
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_ACT
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "inactive"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "activate"
             *          }
             *     then {
             *          the IUT performs activation, i.e. reaches the CI state "registered"
             *          }
             *     }
              * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/12
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_12() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
					var template MI_Command_request v_stateChangeRequest;
                    
                    // Test control
                    if (not(PICS_ACT)) {
                        log("*** TC_ATSP_SE_BV_12: ERROR: 'PICS_ACT' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    
                    // Get CI status
                    v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID());
                    if( (v_CIstatus == c_ciStatusUnknown) or (v_CIstatus == c_ciStatusNot_existent) or (v_CIstatus == c_ciStatusExistent) or (v_CIstatus == c_ciStatusInactive) or (v_CIstatus == c_ciStatusRegistered))
                    // wrong status 
                    {
                        // Request operator to switch on the SUT or to activate the IUT
                        action("Switch on SUT or activate IUT");
						f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
                    	f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                        v_CIstatus := f_cnGetCiStatusParameterValueCI( f_get_CI_LinkID());
                    }
                    // check again CI status after activation of IUT
                    if( (v_CIstatus == c_ciStatusUnknown) or (v_CIstatus == c_ciStatusNot_existent) or (v_CIstatus == c_ciStatusExistent) or (v_CIstatus == c_ciStatusInactive) or (v_CIstatus == c_ciStatusRegistered))                    // wrong status 
                    {
                        log("*** TC_ATSP_BV_12: ERROR: Invalid CI status returned ***", v_CIstatus);
                        f_selfOrClientSyncAndVerdict("error", e_timeout);  // Might be just a time-out error
                        stop;
                    }
                    else
                    {
                        log("*** TC_ATSP_BV_12: Allowed CI status returned ***", v_CIstatus);
                    }
                    // Inactivate CI (required initial state)
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngInactivate, c_ciStatusInactive, false);
					
					
                    // Test Body
                    // Clause 'when'
                    //the IUT receives the COMMAND "CIstateChng" with the value "activate"
                    //inactive->active state chenge is not possible inactive->registered->active is possible
					//f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miStateChangeCommandRequest(f_get_CI_LinkID(), f_getNextCommandRef(), c_ciStatusRegistered), true);
					v_stateChangeRequest := m_miStateChangeCommandRequest(f_get_CI_LinkID(), f_getNextCommandRef(), c_ciStatusRegistered);
                    f_cnSendMICOMMAND_RequestCI(v_stateChangeRequest);
					
                    //Clause 'then'
                    //        the IUT performs activation, i.e. reaches the CI state "registered"
					f_cnAwaitRegistrationCI(f_get_CI_LinkID(), PX_CI_MED_TYPE, true);
					
					f_cnAwaitCommandConfirmSuccess(v_stateChangeRequest, false);
					f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
					
					f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); // ToDo: Is this needed here?
                    log("*** TC_ATSP_SE_BV_12: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_12: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_SE_BV_12

            /**
             * @desc    TP: IUT performs suspension
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_SUSP
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "suspend"
             *          }
             *     then {
             *          the IUT performs suspension
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT performed suspension
             *          }
             *     then {
             *          the IUT still accepts new transmission requests at the IN-SAP, without performing the transmission
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/13
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_13() runs on ItsCalm system ItsCalmSystem {
                    //TODO:         Ensure IUT is in "connected" state
                    //    
                    
                    
                    // Local variables
                    var CIstatus v_CIstatus;
                    var template AtspInd v_atspEventInd;
                    
                    // Test control
                    if (not(PICS_SUSP)) {
                        log("*** TC_ATSP_SE_BV_13: ERROR: 'PICS_ACT' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    
                    // IUT in interim CI state "active"
                    v_CIstatus := f_initialCIstateActive();
                    // Connect CI by sending a frame
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    // Test Body
                    // Clause 'when'
                    //the IUT receives the COMMAND "CIstateChng" with the value "suspend"
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngSuspend, c_ciStatusSuspended, false);
                
                    //Clause 'then'
                    //        the IUT still accepts new transmission requests at the IN-SAP, without performing the transmission
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);                    

                    //Check whether the transmission request is performed unexpected
                    v_atspEventInd := ?;

                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_SE_BV_13: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_SE_BV_13: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    }
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_13: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_13

            /**
             * @desc    TP: IUT performs suspension
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_RES
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "suspended"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "resume"
             *          }
             *     then {
             *          the IUT performs resuming
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT performed resuming
             *          }
             *     then {
             *          the IUT starts transmisison of pending packets
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/14
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_14() runs on ItsCalm system ItsCalmSystem {                    
                    // Local variables
                    var AtspInd v_result;
                    var template AtspInd v_atspEventInd;
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_RES)) {
                        log("*** TC_ATSP_SE_BV_14: ERROR: 'PICS_ACT' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    
                    // Get IUT in CI state "active
                    v_CIstatus := f_initialCIstateActive();
                    // Get IUT in CI state "connected"
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    // Force the IUT to enter the state suspended
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngSuspend, c_ciStatusSuspended, true);
                    // Request IUT to send several BC frames
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityAverage);
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataAA,
                                    m_inUserPriorityHighest);
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataBB,
                                    m_inUserPriorityLowest);
                    
                    // Check that IUT does not send the frames
                    v_atspEventInd := ?;

                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_SE_BV_14: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_SE_BV_14: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement    
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the COMMAND "CIstateChng" with the value "resume"
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngResume, c_ciStatusConnected, true);
                    //        the IUT performed resuming
                    
                    //Clause 'then'
                    //        the IUT starts transmisison of pending packets
                    v_atspEventInd := ?;
                    
                    // Clause 'then' receive via atspPort
                    for( var integer x:=1; x <4; x := x+1) {
                        tc_wait.start;
                        alt {
                            [] atspPort.receive(v_atspEventInd) {
                                tc_wait.stop;
                                log("*** TC_ATSP_SE_BV_14: INFO: Expected IN-UNITDATA.indication received ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                                log("*** TC_ATSP_SE_BV_14: INFO: test body done ***");
                            }
                            [] tc_wait.timeout {
                                log("*** TC_ATSP_SE_BV_14: INFO: Unexpected time out ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                            }
                        } // End of 'alt' statement    
                    }
                    
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_14: INFO: test body done ***");
                    
                    log("*** TC_ATSP_SE_BV_14: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_14: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_SE_BV_14

            /**
             * @desc    TP: IUT of CIC-l2 and CIAC-2 performs connection manually
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l2 AND PICS_CIAC2
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active",
             *       valid access information in I-Parameters "SIMpin", "ProviderInfo" is present,
             *       the IUT is exposed to the signals of a related base station,
             *       I-Parameter Connect is set to "manual"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CONcmd"
             *          }
             *     then {
             *          the IUT performs connection
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/15
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_15() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;

                    // Test control
                    if (not(PICS_CIC_l2 and PICS_CIAC2)) {
                        log("*** TC_ATSP_SE_BV_15: ERROR: 'PICS_CIC_l2 AND PICS_CIAC2' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Get CI status
                    v_CIstatus := f_initialCIstateActive();
                    // Set I-Parameter Connect to "manual"
                    // set access credentials in I-Parameters "SIMpin", "ProviderInfo"
                    // ToDo
                    //
                    
                    // Test Body
                    // Clause 'when'
                    // the IUT receives the COMMAND "CONcmd"
                    // Clause 'then'
                    // the IUT performs connection
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miCONcmdCommandRequest( 
                                                            f_get_CI_LinkID(), 
                                                            f_getNextCommandRef(),
                                                            c_ciConConnect), true);
                    
                    // Check whether CI status is now "connected"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusConnected)), true);
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_15: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_15

            /**
             * @desc    TP: IUT CIC-l2 performs connection automatically
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CIC_l2
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active",
             *       valid access information in I-Parameters "SIMpin", "ProviderInfo" is present,
             *       the IUT is not exposed to the signals of a related base station,
             *       I-Parameter Connect is set to "automatic"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT is exposed to the signal of a related base station
             *          }
             *     then {
             *          the IUT performs connection
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/16
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_16() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;

                    // Test control
                    if (not(PICS_CIC_l2)) {
                        log("*** TC_ATSP_SE_BV_15: ERROR: 'PICS_CIC_l2' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Initial conditions
                    // CI status has to be "active"
                    v_CIstatus := f_initialCIstateActive();
                    // Set I-Parameter Connect to "automatic"
                    // set access credentials in I-Parameters "SIMpin", "ProviderInfo"
                    // ToDo
                    
                    // Test Body
                    // Clause 'when'
                    // the IUT is exposed to the signal of a related base station
                    action("Expose IUT to signal of base station");

                    // Clause 'then'
                    // the IUT performs connection
                    // Check whether CI status is now "connected"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusConnected)), true);
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_16: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_SE_BV_16

            /**
             * @desc    TP: IUT CIAC-2 or CIAC-3 performs disconnection 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_DISCONN
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "disconnect"
             *          }
             *     then {
             *          the IUT performs disconnection
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT performed disconnection
             *          }
             *     then {
             *          the IUT is in the CI state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BV/17
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BV_17() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
//                    var integer v_messageCounter;
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_DISCONN)) {
                        log("*** TC_ATSP_SE_BV_17: ERROR: 'PICS_DISCONN' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // CI status has to be "active"
                    v_CIstatus := f_initialCIstateActive();
                    // 
                    // Connect CI by sending a frame
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    
                    // Test Body
                    // Clause 'when'
                    //the IUT receives the COMMAND "CIstateChng" with the value "disconnect"
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miStateChangeCommandRequest(
                                                                f_get_CI_LinkID(), 
                                                                f_getNextCommandRef(), 
                                                                c_ciStateChngDisconnect), true);
                    
                    //Clause 'then'
                    //        the IUT is in the CI state "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_SE_BV_17: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_17: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_SE_BV_17

        } // End of group validBehavior
            
            
        group invalidBehavior {

            /**
             * @desc    TP: IUT rejects an invalid CI state transition request 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_DYNREG OR PICS_INACT OR PICS_ACT OR PICS_SUSP OR PICS_RES OR PICS_CONN OR PICS_DISCONN
             * Initial conditions: 
             *  with {
             *       the IUT being in any CI state except the CI state "existent" or "not-existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "CIstateChng" with an invalid value of CIstatus
             *          }
             *     then {
             *          the IUT acknowledges with error code "INVALID COMMAND/REQUEST VALUE"
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT acknowledged with error code "INVALID COMMAND/REQUEST VALUE"
             *          }
             *     then {
             *          the IUT is still in the initial CI state
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BI/01
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var integer v_messageCounter;
                    var template(value) MI_Command_request v_stateChangeCommand;
                    var CIstatus v_CIstatus;
                    var CIstatus v_CIstatus1;
                    
                    // Test control
                    if (not(PICS_DYNREG or PICS_INACT or PICS_ACT or PICS_SUSP or PICS_RES or PICS_CONN or PICS_DISCONN)) {
                        log("*** TC_ATSP_SE_BI_01: ERROR: 'PICS_DYNREG' or 'PICS_INACT' or 'PICS_ACT'",
                                " or 'PICS_SUSP' or 'PICS_RES' or 'PICS_CONN' or 'PICS_DISCONN' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // the IUT being in any CI state except the CI state "existent" or "not-existent" 
                    // Check initial CI state
                    v_CIstatus := f_initialCIstatesOperational();
                    
                    // Test Body
                    // Clause 'when'
                    //the IUT receives the MI-COMMAND "CIstateChng" with an invalid value of CIstatus
                    v_stateChangeCommand := m_miStateChangeCommandRequest(
                                                    f_get_CI_LinkID(), 
                                                    f_getNextCommandRef(), 
                                                    c_ciStateChngInvalidValue);
                    f_cnSendMICOMMAND_RequestCI(v_stateChangeCommand);
					
                    //Clause 'then'
                    //        the IUT acknowledged with error code "INVALID COMMAND/REQUEST VALUE"
                    f_cnAwaitCommandConfirm(v_stateChangeCommand, c_ciErrStatusCmdReqVal, true);
                    
                                        
                    //Clause 'then'
                    //        the IUT is still in the initial CI state
                    v_CIstatus1 := f_cnGetCiStatusParameterValueCI(f_get_CI_LinkID());
                    if(v_CIstatus1 == v_CIstatus) {
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_SE_BI_01: INFO: CI status changed unexpected", v_CIstatus1);
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                    }
                    
                    log("*** TC_ATSP_SE_BI_01: INFO: test body done ***");
        
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BI_01: INFO: Postamble: done ***");
                    
                    
                } // End of testcase TC_ATSP_SE_BI_01
            
            /**
             * @desc    TP: IUT ignores a connect request with missing access information
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: (PICS_CIAC2 OR PICS_CIAC3) AND PICS_CONN
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active",
             *       I-Parameter "Connect" is set to "manual",
             *       no access information in I-Parameters "SIMpin", "ProviderInfo" is present
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "CONcmd" with value "connect"
             *          }
             *     then {
             *          the IUT acknowledges with error code "INVALID COMMAND/REQUEST VALUE"
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT acknowledged with error code "INVALID COMMAND/REQUEST VALUE"
             *          }
             *     then {
             *          the IUT is still in the CI state "active"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 SE/BI/02
             * @remark  to be created
             */
                testcase TC_ATSP_SE_BI_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var template MI_Command_request v_stateChngCmdReq;

                    // Test control
                    if (not(PICS_CIC_l2 and PICS_CIAC2)) {
                        log("*** TC_ATSP_SE_BV_15: ERROR: 'PICS_CIC_l2 AND PICS_CIAC2' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    //  CI status has to be "active"
                    v_CIstatus := f_initialCIstateActive();
                    // Set I-Parameter Connect to "manual"
                    // ToDo
                    //
                    
                    // Test Body
                    // Clause 'when'
                    // the IUT receives the COMMAND "CONcmd"
                    v_stateChngCmdReq := m_miStateChangeCommandRequest(
                                                    f_get_CI_LinkID(),
                                                    f_getNextCommandRef(), 
                                                    c_ciStateChngConnect);
                    f_cnSendMICOMMAND_RequestCI(v_stateChngCmdReq);
                    // Clause 'then'
                    // the IUT rejects connection
                    f_cnAwaitCommandConfirm(v_stateChngCmdReq, c_ciErrStatusCmdReqVal, false);
                    
                    // Check whether CI status is still "active"
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_5(mw_miCIStatusParam(c_ciStatusActive)), true);
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_SE_BV_15: INFO: Postamble: done ***");
                    
                    
                } // End of testcase TC_ATSP_SE_BI_02
            
        } // End of group invalidBehavior
            
    } // End of group stateEventTransitions


    
    // MIB I-Parameters
    group mibIparameters {
        
            
        group validBehavior {

            /**
             * @desc    TP: IUT correctly reads I-Parameters with Read/Write access or Read-only access
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_IPRW OR PICS_IPRO
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-GET command for a supported I-Paramter with Read/Write access or Read-only access
             *          }
             *     then {
             *          the IUT reports the proper value of this I-Parameter
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 MB/BV/01
             * @remark  to be created
             */
                 testcase TC_ATSP_MB_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var IParamNoList v_requestedParameters;
                    var IParamList v_returnedValues;
                    var CIstatus v_CIstatus;
                    var I_Param v_Iparameter;
                        
                    // Test control
                    if (not(PICS_IPRW or PICS_IPRO)) {
                        log("*** TC_ATSP_MB_BV_01: ERROR: 'PICS_IPRW OR PICS_IPRO' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // IUT has to be in the CI state "active"
                    v_CIstatus := f_initialCIstateActive();

                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the MI-GET command for a supported I-Paramter with Read/Write access or Read-only access                    
                    v_requestedParameters := { c_ciIParamNoCiStatus };
                    v_returnedValues := f_cnGetIParameterValueCI(f_get_CI_LinkID(), v_requestedParameters, false);
                    
                    // Clause 'then'
                    if(not f_cnCheckOneIparamGetSuccess(c_ciIParamNoCiStatus, v_returnedValues, v_Iparameter)){
                        // error
                        log("*** TC_ATSP_MB_BV_01: INFO: MI-Get.request failed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else {
                        // proper reading
                        if(v_Iparameter.parameter.CIstatus != c_ciStatusActive){
                            // unexpected value
                            log("*** TC_ATSP_MB_BV_01: INFO: MI-Get.confirm unexpected CiStatus value ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        } else {
                            // expected value
                            log("*** TC_ATSP_MB_BV_01: INFO: Received expected I-Parameter value ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    }
                    
                    log("*** TC_ATSP_MB_BV_01: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_MB_BV_01: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_MB_BV_01
            
            /**
             * @desc    TP: IUT correctly writes I-Parameters with Read/Write access or Write-only access
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_IPRW OR PICS_IPWO
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-SET command for a supported I-Paramter with Read/Write access
             *          }
             *     then {
             *          the IUT accepts the new value of this I-Parameter
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 MB/BV/02
             * @remark  to be created
             */
                testcase TC_ATSP_MB_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var I_Param v_writeParameter;

                    // Test control
                    if (not(PICS_IPRW or PICS_IPWO)) {
                        log("*** TC_ATSP_MB_BV_01: ERROR: 'PICS_IPRW OR PICS_IPWO' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when the IUT receives the MI-SET command for a supported I-Paramter with Read/Write access'
                    v_writeParameter := PX_CI_SUPPORT_PARAM_WR;
                    //r.paramNo := c_ciIParamNoDataRate; PX_CI_SUPPORT_NO_WRITE_ACCESS_PARAM
                    //v_writeParameter.parameter.DataRate := 125;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(PX_CI_SUPPORT_PARAM_WR_NO, v_cfSetErrorList)) {
                        log("*** TC_ATSP_MB_BV_02: INFO: MI-Set.confirm was successfully executed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_MB_BV_02: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }
                    
                    // Postamble
                    // here we could read the value to cross-check proper writing.
                    
                } // End of testcase TC_ATSP_MB_BV_02
            
            /**
             * @desc    TP: IUT correctly monitors change of value of I-Parameters
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_MONITOR AND (PICS_IPRW OR PICS_IPRO OR PICS_IPNO)
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "Monitor" to activate monitoring of value changes for a supported I-Paramter
             *          }
             *     then {
             *          the IUT reports automatically all value changes of this I-Parameter with MI-REQUEST "Events(E21218-5)"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 MB/BV/03
             * @remark  to be created
             */
                testcase TC_ATSP_MB_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;

                    // Test control
                    if (not(PICS_MONITOR and (PICS_IPRW or PICS_IPRO or PICS_IPNO))) {
                        log("*** TC_ATSP_MB_BV_03: ERROR: 'PICS_MONITOR AND (PICS_IPRW OR PICS_IPRO OR PICS_IPNO)' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'
                    
                    // Clause 'then'
                    
                    // Postamble
                    
                } // End of testcase TC_ATSP_MB_BVB_03
            
        } // End of group validBehavior
            
            
        group invalidBehavior {

            /**
             * @desc    TP: IUT correctly acknowledges MI-GET requests to non-existent I-Paramters
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: TRUE
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-GET command for an I-Parameter which is not existent
             *          }
             *     then {
             *          the IUT acknowledges with error code "INVALID PARAMETER NUMBER"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 MB/BI/01
             * @remark  to be created
             */
                testcase TC_ATSP_MB_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var IParamNoList v_requestedParameters;
                    var IParamList v_returnedValues;
                    var I_Param v_Iparameter;

                    // Test control
                    // always true
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the MI-GET command for a supported I-Paramter with Read/Write access or Read-only access                    
                    v_requestedParameters := { PX_CI_UNKNOWN_PARAM_NO };
                    v_returnedValues := f_cnGetIParameterValueCI(f_get_CI_LinkID(), v_requestedParameters, false);

                    if(f_cnCheckOneIparamGetSuccess(PX_CI_UNKNOWN_PARAM_NO, v_returnedValues, v_Iparameter)){
                        // error
                        log("*** TC_ATSP_MB_BV_01: ERROR: MI-Get.request returned unknown I-Parameter  ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else {
                        // error detected as expected
                            log("*** TC_ATSP_MB_BV_01: INFO: MI-Get.confirm failed as expected ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        } 
                    
/*                    if(lengthof(v_returnedValues) != 1){
                        log("*** TC_ATSP_MB_BI_01: INFO: MI-Get.confirm contained incorrect number of parameters ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else if(v_returnedValues[0].paramNo != c_ciIParamNoErrors) {
                        log("*** TC_ATSP_MB_BI_01: INFO: MI-Get.confirm contained incorrect parameter ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else if(v_returnedValues[0].parameter.Errors[0] != {PX_CI_UNKNOWN_PARAM, c_ciErrStatusInvalParamNo}){
                        log("*** TC_ATSP_MB_BI_01: INFO: MI-Get.confirm unexpected Error Code ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else {
                        log("*** TC_ATSP_MB_BI_01: INFO: Received expected Error Code ***", v_returnedValues[0].parameter.Errors);
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }*/
                    
                    log("*** TC_ATSP_MB_BI_01: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_MB_BI_01: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_MB_BI_01
            
            /**
             * @desc    TP: IUT correctly acknowledges MI-SET requests to non-supported I-Paramters
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: TRUE
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-SET command for an I-Parameter which is not supported
             *          }
             *     then {
             *          the IUT acknowledges with error code "INVALID PARAMETER NUMBER"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 MB/BI/02
             * @remark  to be created
             */
                testcase TC_ATSP_MB_BI_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var I_Param v_writeParameter;

                    // Test control
                    // always true
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when the IUT receives the MI-SET command for a supported I-Paramter with Read/Write access'
                    v_writeParameter := PX_CI_NO_SUPPORT_PARAM;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (not f_cnCheckOneIparamSetSuccess(PX_CI_NO_SUPPORT_PARAM_NO, v_cfSetErrorList)) {
                        log("*** TC_ATSP_MB_BI_02: INFO: MI-Set.confirm was successfully executed reporting errors ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_MB_BI_02: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }

                    // Postamble
                    // here we could read the value to cross-check proper writing.
                    
                } // End of testcase TC_ATSP_MB_BI_02
            
            /**
             * @desc    TP: IUT correctly acknowledges MI-SET requests to I-Paramters with Read-only access or Notify-only access
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_IPRO OR PICS_IPNO
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-SET command for an I-Parameter with Read-only or Notify-only access
             *          }
             *     then {
             *          the IUT acknowledges with error code "ACCESS VIOLATION"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 MB/BI/03
             * @remark  to be created
             */
                testcase TC_ATSP_MB_BI_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var I_Param v_writeParameter;

                    // Test control
                    if (not(PICS_IPRO or PICS_IPNO)) {
                        log("*** TC_ATSP_MB_BI_03: ERROR: 'PICS_IPRO OR PICS_IPNO' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when the IUT receives the MI-SET command for a write-only or notify-only I-Paramter'
                    v_writeParameter := PX_CI_SUPPORT_NO_WRITE_ACCESS_PARAM;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause then the IUT rejects the write command
                    if (not f_cnCheckOneIparamSetSuccess(PX_CI_SUPPORT_NO_WRITE_ACCESS_PARAM_NO, v_cfSetErrorList)) {
                        log("*** TC_ATSP_MB_BI_03: INFO: MI-Set.confirm was successfully executed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_MB_BI_03: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }

                    // Postamble
                    // here we could read the value to cross-check proper writing.
                    
                } // End of testcase TC_ATSP_MB_BI_03
            
        } // End of group invalidBehavior
            
    } // End of group mibIparameters

    

    // Handling of CIs
    group handlingOfCIs {
        
            
        group validBehavior {

            /**
             * @desc    TP: IUT correctly handles COMMAND "WakeUp"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_WAKEUP
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "WakeUp"
             *          }
             *     then {
             *          the IUT periodically sends out wake-up messages
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 HC/BV/01
             * @remark  to be created
             */
                testcase TC_ATSP_HC_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_WAKEUP)) {
                        log("*** TC_ATSP_HC_BV_01: ERROR: 'PICS_WAKEUP' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // IUT has to be in the CI state "active"
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the MI-COMMAND "WakeUp"                
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miWakeUpCommandRequest(
                                                                f_get_CI_LinkID(), 
                                                                f_getNextCommandRef(), 
                                                                c_ciWakeUpEnable), true);
                    
                    // Clause 'then'
                    //        the IUT periodically sends out wake-up messages

                    //currently no technology is known that supports wake-up.
                    //TODO: Wake Up 
                    //

                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                    log("*** TC_ATSP_HC_BV_01: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_HC_BV_01
            
            /**
             * @desc    TP: IUT correctly handles COMMAND "RIcmd"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_RIM
             * Initial conditions: 
             *  with {
             *       the IUT being in any CI state except "not_existent" or "existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "RIcmd"
             *          }
             *     then {
             *          the IUT accepts the new regulatory information
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 HC/BV/02
             * @remark  to be created
             */
                testcase TC_ATSP_HC_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_RIM)) {
                        log("*** TC_ATSP_HC_BV_02: ERROR: 'PICS_WAKEUP' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Check allowed initial CI state
                    v_CIstatus := f_initialCIstatesOperational();
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the MI-COMMAND "RIcmd"    
                    
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRICmdCommandRequest(
                                                                f_get_CI_LinkID(), 
                                                                f_getNextCommandRef(), 
                                                                m_miRICmd(
                                                                    f_get_CI_LinkID(),
                                                                    ''O)), true);
                    
                    //the IUT accepts the new regulatory information
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_HC_BV_02: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                    log("*** TC_ATSP_HC_BV_02: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_HC_BV_02
            
            /**
             * @desc    TP: IUT correctly handles COMMAND "VCIcmd" to reset a VCI
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: TRUE
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "VCIcmd" requesting to reset a VCI
             *          }
             *     then {
             *          the IUT resets the selected VCI
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 HC/BV/03
             * @remark  to be created
             */
                testcase TC_ATSP_HC_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
					var IParamNoList v_requestedParameters;
                    var IParamList v_returnedValues;
                    var I_Param v_Iparameter;
                    var RemoteCIID v_existentVCI; 
                    
                    // Test control
                    // always true
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
					// check available VCIs in the CI addressed by f_get_CI_LinkID()
                    v_requestedParameters := { c_ciIParamNoVirtualCI };
                    v_returnedValues := f_cnGetIParameterValueCI(f_get_CI_LinkID(), v_requestedParameters, false);
                    
                    // Clause 'then'
                    if(not f_cnCheckOneIparamGetSuccess(c_ciIParamNoVirtualCI, v_returnedValues, v_Iparameter)){
                        // error
                        log("*** TC_ATSP_HC_BV_03: INFO: MI-Get.request failed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else {
                        // proper reading
                        log("*** TC_ATSP_HC_BV_03: INFO: Received expected I-Parameter value ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    
                    // The following VCI exists and can be deleted
                    v_existentVCI := v_Iparameter.parameter.VirtualCIs[0];
					
                    // Test Body
                    // Clause 'when the IUT receives the MI-COMMAND "VCIcmd" requesting to reset a VCI'
                    // Note that f_get_CI_LinkID() in the VCIcmd resets all VCIs of this CI
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miVCIcmdCommandRequest(
                                                        f_get_CI_LinkID(), 
                                                        f_getNextCommandRef(), 
                                                        {'0000000'B, f_get_VCI_LinkID(v_existentVCI), true}), true);
                    //Clause 'then'
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_7(
                                                                        mw_miVCICreDelRes(v_existentVCI,  f_get_CI_Local_CIID())), false);
                    
                    // Postamble
                    // there is no straight forward means to control whether reset was performed.
                    
                } // End of testcase TC_ATSP_HC_BV_03

            /**
             * @desc    TP: IUT correctly handles COMMAND "VCIcmd" to delete a VCI
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: TRUE
             * Initial conditions: 
             *  with {
             *       the IUT being in any CI state except "not_existent" or "existent" or "registered"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "VCIcmd" requesting deletion of a VCI
             *          }
             *     then {
             *          the IUT deletes the selected VCI
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 HC/BV/04
             * @remark  to be created
             */
                testcase TC_ATSP_HC_BV_04() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var IParamNoList v_requestedParameters;
                    var IParamList v_returnedValues;
                    var CIstatus v_CIstatus;
                    var I_Param v_Iparameter;
                    var RemoteCIID v_existentVCI; 
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;

                    // Test control
                    // always true
                                        
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    // check available VCIs in the CI addressed by f_get_CI_LinkID()
                    v_requestedParameters := { c_ciIParamNoVirtualCI };
                    v_returnedValues := f_cnGetIParameterValueCI(f_get_CI_LinkID(), v_requestedParameters, false);
                    
                    // Clause 'then'
                    if(not f_cnCheckOneIparamGetSuccess(c_ciIParamNoVirtualCI, v_returnedValues, v_Iparameter)){
                        // error
                        log("*** TC_ATSP_HC_BV_04: INFO: MI-Get.request failed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    } else {
                        // proper reading
                        log("*** TC_ATSP_HC_BV_04: INFO: Received expected I-Parameter value ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    
                    // The following VCI exists and can be deleted
                    v_existentVCI := v_Iparameter.parameter.VirtualCIs[0];
                    
                    // Test Body
                    // Clause 'when the IUT receives the MI-COMMAND "VCIcmd" requesting to delete a VCI'
                    // Note that f_get_CI_LinkID() in the VCIcmd resets all VCIs of this CI
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miVCIcmdCommandRequest(
                                                        f_get_CI_LinkID(), 
                                                        f_getNextCommandRef(), 
                                                        {'0000000'B, f_get_VCI_LinkID(v_existentVCI), false}), true);
                    //Clause 'then'
                    //    the IUT deregistered 
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_4(
                                                                        mw_miVCICreDelRes(v_existentVCI,  f_get_CI_Local_CIID())), false);
                    
                    // Postamble
                    // Check whether VCI still is available for transmission of a frame.
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_VCI_LinkID(v_existentVCI)),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_VCI_LinkID(v_existentVCI)),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //        no transmission of the corresponding frame happens
                    
                    log("*** TC_ATSP_HC_BV_04: INFO: Expected IN-UNITDATA.indication: ", v_atspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_HC_BV_04: ERROR: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            log("*** TC_ATSP_HC_BV_04: INFO: test body done ***");
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_HC_BV_04: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_HC_BV_04: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_HC_BV_04: INFO: test body done ***");
                        }
                    } // End of 'alt' statement    
                    
                    
                } // End of testcase TC_ATSP_HC_BV_04

            /**
             * @desc    TP: IUT correctly handles COMMAND "VCIcmd" to create a VCI
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: TRUE
             * Initial conditions: 
             *  with {
             *       the IUT being in any CI state except "not_existent" or "existent" or "registered"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the MI-COMMAND "VCIcmd" requesting creation of a new VCI
             *          }
             *     then {
             *          the IUT creates a new VCI
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 HC/BV/05
             * @remark  to be created
             */
                testcase TC_ATSP_HC_BV_05() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;

                    // Test control
                    // always true
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when the IUT receives the MI-COMMAND "VCIcmd" requesting creation of a new VCI'
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miVCIcmdCommandRequest(
                                                        f_get_CI_LinkID(), 
                                                        f_getNextCommandRef(), 
                                                        {'0000000'B, f_get_DestinationVCI_UC_LinkID(), true}), true);
                    //Clause 'then'
                    //    the IUT deregistered !!??!! ToDo: This might not be possible. Check with ISO
                    f_cnAwaitEventNotificationCI(f_get_CI_LinkID(), mw_miEvent21218_3(
                                                                        mw_miVCICreDelRes(PX_REMOTE_CIID_UC,  f_get_CI_Local_CIID())), false);
                    
                    // Postamble
                    // Check whether VCI  is available for transmission of a frame.
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_UC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_UC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //        no transmission of the corresponding frame happens
                    
                    log("*** TC_ATSP_HC_BV_05: INFO: Expected IN-UNITDATA.indication: ", v_atspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_HC_BV_05: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_HC_BV_05: INFO: test body done ***");
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_HC_BV_05: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_HC_BV_05: INFO: Unexpected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            log("*** TC_ATSP_HC_BV_05: INFO: test body done ***");
                        }
                    } // End of 'alt' statement    
                    
                    
                } // End of testcase TC_ATSP_HC_BV_05
            
        } // End of group validBehavior
            
            
        group invalidBehavior {

            /**
             * @desc    TP: IUT correctly handles invalid MI-COMMAND
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_DELET
             * Initial conditions: 
             *  with {
             *       the IUT being in any CI state except "not_existent" or "existent"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an invalid MI-COMMAND
             *          }
             *     then {
             *          the IUT acknowledges with error code "INVALID COMMAND/REQUEST NUMBER"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 HC/BI/01
             * @remark  to be created
             */
                testcase TC_ATSP_HC_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var template(value) MI_Command_request v_invalidCommandRequest;
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not(PICS_DELET)) {
                        log("*** TC_ATSP_HC_BI_01: ERROR: 'PICS_DELET' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    // Check allowed initial CI state
                    v_CIstatus := f_initialCIstatesOperational();
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives an invalid MI-COMMAND
                    v_invalidCommandRequest := m_miUnknwonCommandRequest(f_get_CI_LinkID(), 
                                                            f_getNextCommandRef());
                    f_cnSendMICOMMAND_RequestCI(v_invalidCommandRequest);
                    
                    // Clause 'then'
                    //        the IUT acknowledges with error code "INVALID COMMAND/REQUEST NUMBER"
                    f_cnAwaitCommandConfirm(v_invalidCommandRequest, c_ciErrStatusCmdReqNo, true);
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    log("*** TC_ATSP_HC_BI_01: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                    log("*** TC_ATSP_HC_BI_01: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_HC_BI_01
            
        } // End of group invalidBehavior
            
    } // End of group handlingOfCIs
    
    
    
    // Handling of data plane
    group handlingOfCDataPlane {
        
            
        group validBehavior {

            /**
             * @desc    TP: IUT correctly handles an IN-UNITDATA transmission request with MAC broadcast address
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: (PICS_MAC48 AND PICS_BCVCI) AND NOT PICS_CIC_l4 AND NOT PICS_CIC_l5
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request for transmission of a packet to a MAC broadcast address
             *          }
             *     then {
             *          the BC-VCI of the IUT correctly performs transmission of the corresponding frame
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/01
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var AtspInd v_result;
                    var template AtspInd v_atspEventInd;
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not((PICS_MAC48 and PICS_BCVCI) and (not PICS_CIC_l4) and (not PICS_CIC_l5))) {
                        log("*** TC_ATSP_DP_BV_01: ERROR: (PICS_MAC48 AND PICS_BCVCI) AND NOT PICS_CIC_l4 AND NOT PICS_CIC_l5' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    //Clause 'with'
                    //        the IUT being in the CI state "active"
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives an IN-UNITDATA.request for transmission of a packet to a MAC broadcast address
                    
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //        the BC-VCI of the IUT correctly performs transmission of the corresponding frame
                    
                    log("*** TC_ATSP_DP_BV_01: INFO: Expected IN-UNITDATA.indication: ", v_atspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_01: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BV_01: INFO: test body done ***");
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_01: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_01: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement    
                    
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_01: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_DP_BV_01
            
            /**
             * @desc    TP: IUT correctly handles an IN-UNITDATA transmission request with MAC multicast address
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: (PICS_MAC48 AND PICS_MCVCI) AND NOT PICS_CIC_l4 AND NOT PICS_CIC_l5
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request for transmission of a packet to a known MAC multicast address
             *          }
             *     then {
             *          the MC-VCI of the IUT correctly performs transmission of the corresponding frame
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/02
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var AtspInd v_result;
                    var template AtspInd v_atspEventInd;
                    var CIstatus v_CIstatus;
                    
                    // Test control
                    if (not((PICS_MAC48 and PICS_MCVCI) and (not PICS_CIC_l4) and (not PICS_CIC_l5))) {
                        log("*** TC_ATSP_DP_BV_02: ERROR: '(PICS_MAC48 AND PICS_MCVCI) AND NOT PICS_CIC_l4 AND NOT PICS_CIC_l5' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    //Clause 'with'
                    //        the IUT being in the CI state "active"
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives an IN-UNITDATA.request for transmission of a packet to a MAC broadcast address
                    
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_MC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_MC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //        the BC-VCI of the IUT correctly performs transmission of the corresponding frame
                    
                    log("*** TC_ATSP_DP_BV_02: INFO: Expected IN-UNITDATA.indication: ", v_atspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_02: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BV_02: INFO: test body done ***");
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_02: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_02: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement    
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_02: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_DP_BV_02
            
            /**
             * @desc    TP: IUT correctly handles an IN-UNITDATA transmission request with MAC unicast address
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_MAC48 AND PICS_UCVCI AND (NOT PICS_CIC_l4) AND (NOT PICS_CIC_l5)
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request for transmission of a packet to a known MAC unicast address
             *          }
             *     then {
             *          the UC-VCI of the IUT correctly performs transmission of the corresponding frame
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/03
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_03() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var AtspInd v_result;
                    var template AtspInd v_atspEventInd;
                    var CIstatus v_CIstatus;

                    // Test control
                    if (not(PICS_MAC48 and PICS_UCVCI and (not PICS_CIC_l4) and (not PICS_CIC_l5))) {
                        log("*** TC_ATSP_DP_BV_03: ERROR: '(PICS_MAC48 AND PICS_UCVCI) AND NOT PICS_CIC_l4 AND NOT PICS_CIC_l5' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'
                    
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_UC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_UC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    log("*** TC_ATSP_DP_BV_03: INFO: Expected IN-UNITDATA.indication: ", v_atspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_03: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BV_03: INFO: test body done ***");
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_03: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_03: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement    
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_03: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_DP_BV_03

            /**
             * @desc    TP: IUT correctly handles an IN-UNITDATA notification for reception of a broadcast frame
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_MAC48 AND NOT PICS_CIC_l5
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives a frame addressed to a MAC broadcast address
             *          }
             *     then {
             *          the IUT correctly notifies reception with IN-UNITDATA.indication
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the the IUT notified the received frame
             *          }
             *     then {
             *          creates a UC-VCI related to the transmitter of the received frame,
             *          the IUT is in the CI state "connected"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/04
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_04() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var UtAtspEventInd v_result;
                    var template UtAtspEventInd v_utAtspEventInd := ?;

                    // Test control
                    if (not(PICS_MAC48 and (not PICS_CIC_l5))) {
                        log("*** TC_ATSP_DP_BV_04: ERROR: 'PICS_MAC48 AND NOT PICS_CIC_l5' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'  send via atspPort  
                    
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    v_utAtspEventInd := { inSapPrimitivesUp := mwd_inUnitDataInd(
                                                    mw_inUnitDataInd(
                                                        //source
                                                        m_inLLServiceAddr( 
                                                            PX_IN_SAP_ADDRESS,
                                                            f_get_CI_LinkID()),     
                                                        //destination
                                                        m_inLLServiceAddr(
                                                            PX_IN_SAP_ADDRESS,
                                                            f_get_DestinationVCI_BC_LinkID()),
                                                        m_inDataEmpty,
                                                        m_inUserPriorityHighest,
                                                        m_inUnitdataDefaultAP)
                                                                                                )
                                                        
                                    };
                    
                    // Clause 'then' receive via utPort
                    log("*** TC_ATSP_DP_BV_04: INFO: Expected IN-UNITDATA.indication: ", v_utAtspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] utPort.receive(v_utAtspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_04: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BV_04: INFO: test body done ***");
                        }
                        [] utPort.receive(UtAtspEventInd : ?) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_04: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_04: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of alt block
                    
                    // Postamble
                    // notification of "connected", if "active" was initial state. However not topic of this TC
                    // could be done later
                    
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_04: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_DP_BV_04

            /**
             * @desc    TP: IUT correctly handles an IN-UNITDATA notification for reception of a multicast frame
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_MAC48 AND NOT PICS_CIC_l5
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives a frame addressed to a MAC multicast address
             *          }
             *     then {
             *          the IUT correctly notifies reception with IN-UNITDATA.indication
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the the IUT notified the received frame
             *          }
             *     then {
             *          creates a UC-VCI related to the transmitter of the received frame,
             *          the IUT is in the CI state "connected"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/05
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_05() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var UtAtspEventInd v_result;
                    var template UtAtspEventInd v_utAtspEventInd := ?;

                    // Test control
                    if (not(PICS_MAC48 and (not PICS_CIC_l5))) {
                        log("*** TC_ATSP_DP_BV_05: ERROR: 'PICS_MAC48 AND NOT PICS_CIC_l5' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_MC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    v_utAtspEventInd := { inSapPrimitivesUp := mwd_inUnitDataInd(
                                                    mw_inUnitDataInd(
                                                        //source
                                                        m_inLLServiceAddr( 
                                                            PX_IN_SAP_ADDRESS,
                                                            f_get_CI_LinkID()),     
                                                        //destination
                                                        m_inLLServiceAddr(
                                                            PX_IN_SAP_ADDRESS,
                                                            f_get_DestinationVCI_MC_LinkID()),
                                                        m_inDataEmpty,
                                                        m_inUserPriorityHighest,
                                                        m_inUnitdataDefaultAP)
                                                                                                )
                                                        
                                    };
                    
                    // Clause 'then'
                    log("*** TC_ATSP_DP_BV_05: INFO: Expected IN-UNITDATA.indication: ", v_utAtspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] utPort.receive(v_utAtspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_05: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BV_05: INFO: test body done ***");
                        }
                        [] utPort.receive(UtAtspEventInd : ?) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_05: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_05: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of alt block
                    
                    // Postamble
                    // notification of "connected", if "active" was initial state. However not topic of this TC
                    // could be done later
                    
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_05: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_DP_BV_05

            /**
             * @desc    TP: IUT correctly handles an IN-UNITDATA notification for reception of a unicast frame
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_MAC48 AND NOT PICS_CIC_l5
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives a frame addressed to the MAC unicast address of the CI of the IUT
             *          }
             *     then {
             *          the IUT correctly notifies reception with IN-UNITDATA.indication
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the the IUT notified the received frame
             *          }
             *     then {
             *          creates a UC-VCI related to the transmitter of the received frame,
             *          the IUT is in the CI state "connected"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/06
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_06() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var UtAtspEventInd v_result;
                    var template UtAtspEventInd v_utAtspEventInd := ?;

                    // Test control
                    if (not(PICS_MAC48 and (not PICS_CIC_l5))) {
                        log("*** TC_ATSP_DP_BV_06: ERROR: 'PICS_MAC48 AND NOT PICS_CIC_l5' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    
                    // Test Body
                    // Clause 'when'
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_UC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    v_utAtspEventInd := { inSapPrimitivesUp := mwd_inUnitDataInd(
                                                    mw_inUnitDataInd(
                                                        //source
                                                        m_inLLServiceAddr( 
                                                            PX_IN_SAP_ADDRESS,
                                                            f_get_CI_LinkID()),     
                                                        //destination
                                                        m_inLLServiceAddr(
                                                            PX_IN_SAP_ADDRESS,
                                                            f_get_DestinationVCI_UC_LinkID()),
                                                        m_inDataEmpty,
                                                        m_inUserPriorityHighest,
                                                        m_inUnitdataDefaultAP)
                                                                                                )
                                                        
                                    };
                    
                    // Clause 'then'
                    log("*** TC_ATSP_DP_BV_06: INFO: Expected IN-UNITDATA.indication: ", v_utAtspEventInd, " ***");
                    tc_wait.start;
                    alt {
                        [] utPort.receive(v_utAtspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_06: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BV_06: INFO: test body done ***");
                        }
                        [] utPort.receive(UtAtspEventInd : ?) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_06: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_06: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of alt block
                    
                    // Postamble
                    // notification of "connected", if "active" was initial state. However not topic of this TC
                    // could be done later
                    
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_06: INFO: Postamble: done ***");
                    
                } // End of testcase TC_ATSP_DP_BV_06

            /**
             * @desc    TP: IUT correctly handles prioritization
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_MAC48 AND NOT PICS_CIC_l4 AND PICS_SUSP AND PICS_RES
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "suspended",
             *       the IUT has three pending IN-UNITDATA transmission request with three different priority values, i.e. a broadcast request with priority 255, a multicast request with priority 100 and a unicast request with priority zero
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives the COMMAND "CIstateChng" with the value "resume"
             *          }
             *     then {
             *          the IUT correctly performs transmission of frames related to the three pending transmission requests in the sequence with highest priority first
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/07
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_07() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var template AtspInd v_atspEventInd;
                    var AtspInd v_result;
                    
                    // Test control
                    if (not(PICS_MAC48 and (not PICS_CIC_l4) and PICS_SUSP and PICS_RES)) {
                        log("*** TC_ATSP_DP_BV_07: ERROR: 'PICS_MAC48 AND NOT PICS_CIC_l4 AND PICS_SUSP AND PICS_RES' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'

                    // Get IUT in CI state "active
                    v_CIstatus := f_initialCIstateActive();

                    // Get IUT in CI state "connected"
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);
                    
                    // Force the IUT to enter the state suspended
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngSuspend, c_ciStatusSuspended, true);
                    
                    // Request IUT to send several BC frames
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityAverage);
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataAA,
                                    m_inUserPriorityHighest);
                    f_atspSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterCI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_TesterDestinationVCI_BC_LinkID()),
                                    m_inDataBB,
                                    m_inUserPriorityLowest);

                    // Check that IUT does not send the frames
                    v_atspEventInd := ?;

                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_07: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_07: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement    
                    
                    // Test Body
                    // Clause 'when'
                    //        the IUT receives the COMMAND "CIstateChng" with the value "resume"
                    f_cnTriggerStateChangeAndWaitCI(f_get_CI_LinkID(), c_ciStateChngResume, c_ciStatusConnected, true);
                    //        the IUT performed resuming
                    
                    //Clause 'then'
                    //        the IUT starts transmisison of pending packets
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_MC_LinkID()),
                                    m_inDataAA,
                                    ?,
                                    m_inUnitdataDefaultAP ) ) );
                    
                    // Clause 'then' receive via atspPort
                    tc_wait.start;
                    alt {
                        []  atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_07: INFO: Expected IN-UNITDATA.indication received ***");
                        }
                        []  atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_07: INFO: An unexpected IN-UNITDATA.indication received ***", v_result);
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_07: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement    
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_MC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP ) ) );
                    
                    // Clause 'then' receive via atspPort
                    tc_wait.start;
                    alt {
                        []  atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_07: INFO: Expected IN-UNITDATA.indication received ***");
                        }
                        []  atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_07: INFO: An unexpected IN-UNITDATA.indication received ***", v_result);
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        []  tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_07: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement    
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_MC_LinkID()),
                                    m_inDataBB,
                                    ?,
                                    m_inUnitdataDefaultAP ) ) );
                    
                    // Clause 'then' receive via atspPort
                    tc_wait.start;
                    alt {
                        []  atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_07: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                        []  atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_07: INFO: An unexpected IN-UNITDATA.indication received ***", v_result);
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_07: INFO: Time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement    
                    
                    log("*** TC_ATSP_DP_BV_07: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BV_07: INFO: Postamble: done ***");                    
                } // End of testcase TC_ATSP_DP_BV_07


            /**
             * @desc    TP: IUT correctly registers for the cross-CI prioritization victim procedure 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_V
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected"
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT needs to register for cross-CI prioritization as a potential victim of interference
             *          }
             *     then {
             *          the IUT presents MI-REQUEST "PrioReg"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/08
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_08() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    const UInt8 c_prioTimeout := 127;

                    // Test control
                    if (not(PICS_CRCIP_V)) {
                        log("*** TC_ATSP_DP_BV_08: ERROR: 'PICS_CRCIP_V' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    
                    // Test Body
                    // Clause 'when'
                    action("Enforce IUT to register for cross-CI prioritization as a potential victim of interference");
                    
                    // Clause 'then'
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miPrioRegRequest(f_get_CI_LinkID(), f_getNextCommandRef(), {{PX_CI_INTERFERER_MED_TYPE}, c_prioTimeout}) , true);
                    log("*** TC_ATSP_DP_BV_08: INFO: test body done ***");
                    
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_08: INFO: Postamble: done ***");                    
                    
                } // End of testcase TC_ATSP_DP_BV_08

            /**
             * @desc    TP: IUT correctly requests prioritization and gets prioritization 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_V
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       the IUT being registered for cross-CI prioritization
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
             *          }
             *     then {
             *          the IUT presents the prioritization request MI-REQUEST "RTSreq"
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT received an MI-COMMAND "RTSackCmd" granting prioritization
             *          }
             *     then {
             *          the IUT sends the pending packet,
             *          the IUT releases the prioritization request with MI-REQUEST "RTSreq"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/09
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_09() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    const UInt8 c_prioTimeout := 255;
                    var I_Param v_writeParameter;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;
                    timer t_dummyAckReq := PX_TIMER_DUMMYAckReq; 
                    

                    // Test control
                    if (not(PICS_CRCIP_V)) {
                        log("*** TC_ATSP_DP_BV_09: ERROR: 'PICS_CRCIP_V' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    action("Enforce IUT to register for cross-CI prioritization as a potential victim of interference");
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miPrioRegRequest(f_get_CI_LinkID(), f_getNextCommandRef(), {{PX_CI_INTERFERER_MED_TYPE}, c_prioTimeout}) , true);
                    // Set MinPrioCrossCI to a value
                    v_writeParameter.paramNo := c_ciIParamNoMinPrioCrossCI;
                    v_writeParameter.parameter.UserPriority := c_IParamValueMinPrioCrossCI;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(c_ciIParamNoMinPrioCrossCI, v_cfSetErrorList)) {
                        log("*** TC_ATSP_DP_BV_09: INFO: MI-Set.confirm was successfully executed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_DP_BV_09: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }
                
                    // Test Body
                    // Clause 'when'
                    // IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // now we should be sure that nothing is received within timeout period of 255 ms
                    t_dummyAckReq.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            t_dummyAckReq.stop;
                            log("*** TC_ATSP_DP_BV_09: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            stop;
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_09: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] t_dummyAckReq.timeout {
                            log("*** TC_ATSP_DP_BV_09: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement

                    // Clause 'then'
                    // the IUT presents the prioritization request MI-REQUEST "RTSreq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSreqRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {m_inUserPriorityHighest, 1, c_PrioStatus_request} ), true);

                    // Final condition
                    // when
                    // the IUT received an MI-COMMAND "RTSackCmd" granting prioritization
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRTSackCmdCommandRequest(
                                                    f_get_CI_LinkID(), 
                                                    f_getNextCommandRef(), 
                                                    {m_inUserPriorityHighest, 1, c_PrioStatus_granted} ), true);

                    // then
                    //  the IUT sends the pending packet
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_09: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_09: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_09: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                    } // End of 'alt' statement
                    
                    // the IUT releases the prioritization request with MI-REQUEST "RTSreq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSreqRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {m_inUserPriorityHighest, 1, c_PrioStatus_release} ), true);
                    
                    log("*** TC_ATSP_DP_BV_09: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_09: INFO: Postamble: done ***");                    
                } // End of testcase TC_ATSP_DP_BV_09

            /**
             * @desc    TP: IUT correctly requests prioritization but does not get prioritization 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_V
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       the IUT being registered for cross-CI prioritization
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
             *          }
             *     then {
             *          the IUT presents the prioritization request MI-REQUEST "RTSreq"
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the IUT received an MI-COMMAND "RTSackCmd" ignoring prioritization
             *          }
             *     then {
             *          the IUT releases the prioritization request with MI-REQUEST "RTSreq"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/10
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_10() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    const UInt8 c_prioTimeout := 255;
                    var I_Param v_writeParameter;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;
                    timer t_dummyAckReq := PX_TIMER_DUMMYAckReq; 
                    

                    // Test control
                    if (not(PICS_CRCIP_V)) {
                        log("*** TC_ATSP_DP_BV_10: ERROR: 'PICS_CRCIP_V' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    action("Enforce IUT to register for cross-CI prioritization as a potential victim of interference");
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miPrioRegRequest(f_get_CI_LinkID(), f_getNextCommandRef(), {{PX_CI_INTERFERER_MED_TYPE}, c_prioTimeout}) , true);
                    // Set MinPrioCrossCI to a value
                    v_writeParameter.paramNo := c_ciIParamNoMinPrioCrossCI;
                    v_writeParameter.parameter.UserPriority := c_IParamValueMinPrioCrossCI;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(c_ciIParamNoMinPrioCrossCI, v_cfSetErrorList)) {
                        log("*** TC_ATSP_DP_BV_10: INFO: MI-Set.confirm was successfully executed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_DP_BV_10: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }
                
                    // Test Body
                    // Clause 'when'
                    // IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // now we should be sure that nothing is received within timeout period of 255 ms
                    t_dummyAckReq.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            t_dummyAckReq.stop;
                            log("*** TC_ATSP_DP_BV_10: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            stop;
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_10: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] t_dummyAckReq.timeout {
                            log("*** TC_ATSP_DP_BV_10: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement

                    // Clause 'then'
                    // the IUT presents the prioritization request MI-REQUEST "RTSreq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSreqRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {m_inUserPriorityHighest, 1, c_PrioStatus_request} ), true);

                    // Final condition
                    // when
                    // the IUT received an MI-COMMAND "RTSackCmd" rejecting (ignore) prioritization
                    f_cnSendMICOMMAND_RequestCheckSuccessCI(m_miRTSackCmdCommandRequest(
                                                    f_get_CI_LinkID(), 
                                                    f_getNextCommandRef(), 
                                                    {m_inUserPriorityHighest, 1, c_PrioStatus_ignored} ), true);

                    // then
                    //  the IUT sends the pending packet or not. Nothing to be checked.
                    
                    // the IUT releases the prioritization request with MI-REQUEST "RTSreq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSreqRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {m_inUserPriorityHighest, 1, c_PrioStatus_release} ), true);
                    
                    log("*** TC_ATSP_DP_BV_10: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_10: INFO: Postamble: done ***");                    
                } // End of testcase TC_ATSP_DP_BV_10

            /**
             * @desc    TP: IUT correctly requests prioritization but does not get prioritization within timeout
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_V
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       the IUT being registered for cross-CI prioritization
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
             *          }
             *     then {
             *          the IUT presents the prioritization request MI-REQUEST "RTSreq"
             *          }
             *     }
             *     
             * Final conditions:
             * ensure that {
             *     when {
             *          the T_DummyAckReq timer expired
             *          }
             *     then {
             *          the IUT releases the prioritization request with MI-REQUEST "RTSreq"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/11
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_11() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    const UInt8 c_prioTimeout := 255;
                    var I_Param v_writeParameter;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;
                    timer t_dummyAckReq := PX_TIMER_DUMMYAckReq; 
                    

                    // Test control
                    if (not(PICS_CRCIP_V)) {
                        log("*** TC_ATSP_DP_BV_11: ERROR: 'PICS_CRCIP_V' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    action("Enforce IUT to register for cross-CI prioritization as a potential victim of interference");
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miPrioRegRequest(f_get_CI_LinkID(), f_getNextCommandRef(), {{PX_CI_INTERFERER_MED_TYPE}, c_prioTimeout}) , true);
                    // Set MinPrioCrossCI to a value
                    v_writeParameter.paramNo := c_ciIParamNoMinPrioCrossCI;
                    v_writeParameter.parameter.UserPriority := c_IParamValueMinPrioCrossCI;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(c_ciIParamNoMinPrioCrossCI, v_cfSetErrorList)) {
                        log("*** TC_ATSP_DP_BV_11: INFO: MI-Set.confirm was successfully executed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_DP_BV_11: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }
                
                    // Test Body
                    // Clause 'when'
                    // IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityHighest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    
                    // Clause 'then'
                    // the IUT presents the prioritization request MI-REQUEST "RTSreq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSreqRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {m_inUserPriorityHighest, 1, c_PrioStatus_request} ), true);


                    // await expiration of t_dummyAckReq
                    t_dummyAckReq.start;
                    while (t_dummyAckReq.running){}

                    // Final condition
                    // when
                    // the T_DummyAckReq timer expired
                    
                    // the IUT releases the prioritization request with MI-REQUEST "RTSreq"
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSreqRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {m_inUserPriorityHighest, 1, c_PrioStatus_release} ), true);
                    
                    log("*** TC_ATSP_DP_BV_11: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_11: INFO: Postamble: done ***");                    
                } // End of testcase TC_ATSP_DP_BV_11

            /**
             * @desc    TP: IUT correctly transmits a packet without requesting prioritization 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_V
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       the IUT being registered for cross-CI prioritization
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request with priority value less than the value of the I-Parameter "MinPrioCrossCI"
             *          }
             *     then {
             *          the IUT sends the packet without presenting MI-REQUEST "RTSreq"
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/12
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_12() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    const UInt8 c_prioTimeout := 255;
                    var I_Param v_writeParameter;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;
                    timer t_dummyAckReq := PX_TIMER_DUMMYAckReq; 
                    

                    // Test control
                    if (not(PICS_CRCIP_V)) {
                        log("*** TC_ATSP_DP_BV_12: ERROR: 'PICS_CRCIP_V' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    action("Enforce IUT to register for cross-CI prioritization as a potential victim of interference");
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miPrioRegRequest(f_get_CI_LinkID(), f_getNextCommandRef(), {{PX_CI_INTERFERER_MED_TYPE}, c_prioTimeout}) , true);
                    // Set MinPrioCrossCI to a value
                    v_writeParameter.paramNo := c_ciIParamNoMinPrioCrossCI;
                    v_writeParameter.parameter.UserPriority := c_IParamValueMinPrioCrossCI;
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(c_ciIParamNoMinPrioCrossCI, v_cfSetErrorList)) {
                        log("*** TC_ATSP_DP_BV_12: INFO: MI-Set.confirm was successfully executed ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                        log("*** TC_ATSP_DP_BV_12: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }
                
                    // Test Body
                    // Clause 'when'
                    // IUT receives an IN-UNITDATA.request with priority value of at least equal to the value of the I-Parameter "MinPrioCrossCI"
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityLowest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //  the IUT sends the pending packet
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_12: INFO: Expected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_12: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_12: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                    } // End of 'alt' statement
                    
                    // Final condition
                    log("*** TC_ATSP_DP_BV_12: INFO: test body done ***");
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_12: INFO: Postamble: done ***");                    
                } // End of testcase TC_ATSP_DP_BV_12

            /**
             * @desc    TP: IUT correctly grants prioritization 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_I
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       there are no pending packets in the CI
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an MI-COMMAND "RTScmd" requesting to grant prioritization to another CI 
             *          }
             *     then {
             *          the IUT presents MI-REQUEST "RTSackReq" granting prioritization
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/13
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_13() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;

                    // Test control
                    if (not(PICS_CRCIP_I)) {
                        log("*** TC_ATSP_DP_BV_13: ERROR: 'PICS_CRCIP_I' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    
                    // Test Body
                    // Clause 'when IUT receives an MI-COMMAND "RTScmd" requesting to grant prioritization to another CI (The ITS test system)'
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTScmdRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {{f_get_TesterCI_LinkID()}, m_inUserPriorityHighest, 1, c_PrioStatus_request} ), true);
                    
                    // Clause 'then the IUT presents MI-REQUEST "RTSackReq" granting prioritization'
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSackReqRequest(
                                    f_get_CI_LinkID(), 
                                    f_getNextCommandRef(), 
                                    {{f_get_TesterCI_LinkID()}, 1, c_PrioStatus_granted}) , true);
                                        
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_13: INFO: Postamble: done ***");                    
                    
                } // End of testcase TC_ATSP_DP_BV_13

            /**
             * @desc    TP: IUT correctly postpones transmission of pending packets after granting prioritization 
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_CRCIP_I
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       the IUT having granted prioritization to another CI
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request 
             *          }
             *     then {
             *          the IUT sends the packet only upon reception of MI-COMMAND "RTScmd" releasing prioritization, or upon timeout of T_dummyAckGrant
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BV/14
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BV_14() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var template AtspInd v_atspEventInd;
                    var template AtspInd v_result;
                    timer t_dummyAckReq := PX_TIMER_DUMMYAckReq; 

                    // Test control
                    if (not(PICS_CRCIP_I)) {
                        log("*** TC_ATSP_DP_BV_14: ERROR: 'PICS_CRCIP_I' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActiveConnected();
                    // Request to grant prioritization
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTScmdRequest (f_get_CI_LinkID(), f_getNextCommandRef(), 
                                        {{f_get_TesterCI_LinkID()}, m_inUserPriorityHighest, 1, c_PrioStatus_request} ), true);
                    // grant prioritization
                    f_cnAwaitAndConfirmMI_RequestCI(mw_miRTSackReqRequest(
                                    f_get_CI_LinkID(), 
                                    f_getNextCommandRef(), 
                                    {{f_get_TesterCI_LinkID()}, 1, c_PrioStatus_granted}) , true);

                    // Test Body
                    // Clause 'when IUT receives an IN-UNITDATA.request'
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityLowest);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'IUT sends the packet only upon reception of MI-COMMAND "RTScmd" releasing prioritization, 
                    // or upon timeout of T_dummyAckGrant' -- to do: this requires another TC
                    t_dummyAckReq.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BV_14: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BV_14: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BV_14: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TTC_ATSP_DP_BV_14: INFO: Postamble: done ***");                    
                } // End of testcase TC_ATSP_DP_BV_14

        } // End of group validBehavior
            
            
        group invalidBehavior {

            /**
             * @desc    TP: IUT correctly handles the minimum priority "MinimumUserPriority" and notifies this in an IN-UNITDATA-STATUS.indication service primitive
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: PICS_INUDS AND NOT PICS_CIC_l4
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       I-Parameter "MinimumUserPriority" is set to a value larger than zero and smaller than 255
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request with priority value less than the value of the I-Parameter "MinimumUserPriority" 
             *          }
             *     then {
             *          the IUT presents MI-REQUEST "Events" with value "E21218-0",
             *          the IUT presents IN-UNITDATA-STAUS.indication with transmission_status "PRIORITY"
             *          the IUT deletes the packet without sending it
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BI/01
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BI_01() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var I_Param v_writeParameter;
                    var template AtspInd v_atspEventInd;
                    var AtspInd v_result;
                    var UtAtspEventInd v_resultUT;
                    var template INsapPrimitivesUp v_INsapPrimUp;
                    var template UtAtspEventInd v_utAtspEventInd;

                    // Test control
                    if (not(PICS_INUDS and (not PICS_CIC_l4))) {
                        log("*** TC_ATSP_DP_BI_01: ERROR: 'PICS_INUDS AND NOT PICS_CIC_l4' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    //        the IUT being in the CI state "active"
                    
                    // Test Body
                    // Set MinimumUserPriority
                    v_writeParameter.paramNo := c_ciIParamNoMinUserPriority;
                    v_writeParameter.parameter.UserPriority := 128; // m_inUserPriorityAverage plus 1
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(c_ciIParamNoMinUserPriority, v_cfSetErrorList)) {
                        log("*** TC_ATSP_DP_BI_01: INFO: MI-Set.confirm was successfully executed ***");
                    } else {
                        log("*** TC_ATSP_DP_BI_01: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }
                    
                    // Clause 'when'
                    //        the IUT receives an IN-UNITDATA.request for transmission of a packet to a MAC broadcast address
                    
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityAverage);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //        the BC-VCI of the IUT correctly blocks transmission of the corresponding frame
                    
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BI_01: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BI_01: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BI_01: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    
                    // Check IN-UNITDATA-STATUS.indication
                    v_utAtspEventInd := { inSapPrimitivesUp := mwd_inUnitDataStatusInd(mw_inUnitDataStatusInd(
                                        m_inLLServiceAddr( 
                                            PX_IN_SAP_ADDRESS,
                                            f_get_CI_LinkID()),
                                        m_inLLServiceAddr(
                                            PX_IN_SAP_ADDRESS,
                                            f_get_DestinationVCI_BC_LinkID()),
                                        m_inDataEmpty,
                                        m_inUserPriorityAverage,
                                        m_inUnitdataDefaultAP,
                                        c_ciINtxStatus_Priority))    
                                };
                    
                    tc_wait.start;
                    alt {
                        [] utPort.receive(v_utAtspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BI_01: INFO: Expected IN-UNITDATA-STATUS.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            log("*** TC_ATSP_DP_BI_01: INFO: test body done ***");
                        }
                        [] utPort.receive(UtAtspEventInd : ?) -> value v_resultUT { 
                            log("*** TC_ATSP_DP_BI_01: INFO: An unexpected IN-UNITDATA-STATUS.indication received, repeating check ***", v_resultUT);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BI_01: INFO: Unexpected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of alt block
                    
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BI_01: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_DP_BI_01
            
            /**
             * @desc    TP: IUT correctly handles the minimum priority "MinimumUserPriority"
             * @author  STF 455
             * @config  
             * 
             * <pre>
             * PICS selection: NOT PICS_CIC_l4
             * Initial conditions: 
             *  with {
             *       the IUT being in the CI state "active" or "connected",
             *       I-Parameter "MinimumUserPriority" is set to a value larger than zero and smaller than 255
             *       }
             * 
             * Expected behaviour:
             *  ensure that {
             *     when {
             *          the IUT receives an IN-UNITDATA.request with priority value less than the value of the I-Parameter "MinimumUserPriority" 
             *          }
             *     then {
             *          the IUT presents MI-REQUEST "Events" with value "E21218-0",
             *          the IUT deletes the packet without sending it
             *          }
             *     }
             * </pre>
             * 
             * @version 2013-05-07.0
             * @since   2013-05-07.0
             * @status  empty test case
             * @reference     ETSI TS 102 760-2 v1.1.2_STF455_v06 DP/BI/02
             * @remark  to be created
             */
                testcase TC_ATSP_DP_BI_02() runs on ItsCalm system ItsCalmSystem {
                    // Local variables
                    var CIstatus v_CIstatus;
                    var IParamList v_writeValues;
                    var Errors v_cfSetErrorList;
                    var I_Param v_writeParameter;
                    var template AtspInd v_atspEventInd;
                    var AtspInd v_result;
                    var UtAtspEventInd v_resultUT;
                    var template INsapPrimitivesUp v_INsapPrimUp;
                    var template UtAtspEventInd v_utAtspEventInd;

                    // Test control
                    if (not((not PICS_INUDS) and (not PICS_CIC_l4))) {
                        log("*** TC_ATSP_DP_BI_02: ERROR: 'NOT PICS_INUDS AND NOT PICS_CIC_l4' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    // Clause 'Initial conditions'
                    v_CIstatus := f_initialCIstateActive();
                    //        the IUT being in the CI state "active"
                    
                    // Test Body
                    // Set MinimumUserPriority
                    v_writeParameter.paramNo := c_ciIParamNoMinUserPriority;
                    v_writeParameter.parameter.UserPriority := 128; // m_inUserPriorityAverage plus 1
                    v_writeValues := {v_writeParameter};
                    v_cfSetErrorList := f_cnSetIParameterValueCI(f_get_CI_LinkID(),v_writeValues, false );
                    
                    // Clause 'then the IUT accepts the new value of this I-Parameter'
                    if (f_cnCheckOneIparamSetSuccess(c_ciIParamNoMinUserPriority, v_cfSetErrorList)) {
                        log("*** TC_ATSP_DP_BI_02: INFO: MI-Set.confirm was successfully executed ***");
                    } else {
                        log("*** TC_ATSP_DP_BI_02: ERROR: MI-Set was not properly acknowledged ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        stop;
                    }

                    // Clause 'when'
                    //        the IUT receives an IN-UNITDATA.request for transmission of a packet to a MAC broadcast address
                    
                    f_utSendIN_UNITDATA_Request(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    m_inUserPriorityAverage);        
                    
                    v_atspEventInd := mw_atspInd( mwd_inUnitDataInd(mw_inUnitDataInd(
                                    //source
                                    m_inLLServiceAddr( 
                                        PX_IN_SAP_ADDRESS,
                                        f_get_CI_LinkID()),     
                                    //destination
                                    m_inLLServiceAddr(
                                        PX_IN_SAP_ADDRESS,
                                        f_get_DestinationVCI_BC_LinkID()),
                                    m_inDataEmpty,
                                    ?,
                                    m_inUnitdataDefaultAP)    ) );
                    
                    // Clause 'then'
                    //        the BC-VCI of the IUT correctly blocks transmission of the corresponding frame
                    
                    tc_wait.start;
                    alt {
                        [] atspPort.receive(v_atspEventInd) {
                            tc_wait.stop;
                            log("*** TC_ATSP_DP_BI_01: INFO: Unexpected IN-UNITDATA.indication received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] atspPort.receive(AtspInd : { msgIn := ?, receptionTime := ? } ) -> value v_result { 
                            log("*** TC_ATSP_DP_BI_01: INFO: An unexpected IN-UNITDATA.indication received, repeating check ***", v_result);
                            repeat;
                        }
                        [] tc_wait.timeout {
                            log("*** TC_ATSP_DP_BI_01: INFO: Expected time out ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    } // End of 'alt' statement
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    log("*** TC_ATSP_DP_BI_02: INFO: Postamble: done ***");
                } // End of testcase TC_ATSP_DP_BI_02
            
        } // End of group invalidBehavior
            
    } // End of group handlingOfCDataPlane
    
    
} // End of module ItsAtsp_TestCases
