Commit db592faf authored by garciay's avatar garciay
Browse files

Align FSAP code on base standard

parent 3a73bac3
Loading
Loading
Loading
Loading
+3 −116
Original line number Diff line number Diff line
@@ -19,16 +19,9 @@ module LibItsFntp_Functions {
    };
    
    // LibIts
//    import from CITSapplMgmtApplReg language "ASN.1:1997" { // TODO To be removed
//        type ITSaid
//    };
    import from CALMmanagement language "ASN.1:1997" { 
        type StationID, ITS_scuId; 
    }; 
    import from CALMiitsscu language "ASN.1:1997" { 
        type 
            IIC_Request, IIC_Response 
    }; 
    import from CALMllsap language "ASN.1:1997" { 
        type 
            EUI64, IN_SAPaddress, LLserviceAddr, Link_ID, AccessParameters 
@@ -38,14 +31,6 @@ module LibItsFntp_Functions {
        altstep 
            a_mgtMNSapPortDefault, a_mgtSapAwaitFWTupdate 
    };
    import from CALMfsap language "ASN.1:1997" {
        type 
            CTX, SAM 
    };
    import from LibItsFsap_Templates {
        template 
            m_sam, m_ctx
    };
    import from LibItsFntp_TypesAndValues {
        const c_portDyn, c_portNon;
        type AcFntpPrimitive
@@ -152,7 +137,7 @@ module LibItsFntp_Functions {
            // Disconnect
            f_disconnect4SelfOrClientSync();
            
        } // end f_cf01Down
        } // End of f_cf01Down
        
        function f_cf02Down() runs on ItsNt {
            
@@ -166,7 +151,7 @@ module LibItsFntp_Functions {
            // Disconnect
            f_disconnect4SelfOrClientSync();
            
        } // end f_cf02Down
        } // End of f_cf02Down
        
        /**
         * @desc    Behavior function for initializing component's variables and tables
@@ -183,7 +168,7 @@ module LibItsFntp_Functions {
            activate(a_fntpDefault()); // Default for Fntp module
            activate(a_mgtMNSapPortDefault()); // Default for MGT module / MF-SAP port
            
        } // end f_initialiseComponent
        } // End of f_initialiseComponent
        
    } // End of group fntpConfigurationFunctions
    
@@ -613,60 +598,6 @@ module LibItsFntp_Functions {
            ); 
        } // End of function f_acGenerateFntpForwardingNPDU_CIP
        
        /**
         * @desc    Triggers test adapter to generate Service advertisement message (SAM) PDU via IN_SAP interface
         * @param   p_sourcePort IN-SAP source port
         * @param   p_destinationPort IN-SAP destination port
         * @param   p_stationID ITS station identifier
         * @verdict Unchanged
         */
        function f_acGenerateSAM( 
            in template (value) LLserviceAddr p_insap_source_address, 
            in template (value) LLserviceAddr p_insap_dest_address, 
            in template (value) StationID p_stationID 
        ) runs on ItsNt { 
            f_acTriggerEvent( 
                m_generateSamMessagePDU( 
                    p_insap_source_address, 
                    p_insap_dest_address, 
                    bit2oct( 
                        encvalue( 
                            m_sam(
                                p_stationID
                            ) 
                        ) 
                    ) 
                ) 
            ); 
        } // End of function f_acGenerateSAM
        
        /**
         * @desc    Triggers test adapter to generate Service context message (CTX) PDU via IN_SAP interface
         * @param   p_sourcePort IN-SAP source port
         * @param   p_destinationPort IN-SAP destination port
         * @param   p_stationID ITS station identifier (See ISO/CD 24102-5 Clause 7.2.3 Service context message)
         * @verdict Unchanged
         */
        function f_acGenerateCTX( 
            in template (value) LLserviceAddr p_insap_source_address, 
            in template (value) LLserviceAddr p_insap_dest_address, 
            in template (value) StationID p_stationID 
        ) runs on ItsNt { 
            f_acTriggerEvent( 
                m_generateCtxMessagePDU( 
                    p_insap_source_address, 
                    p_insap_dest_address, 
                    bit2oct( 
                        encvalue( 
                            m_ctx( 
                                p_stationID 
                            ) 
                        ) 
                    ) 
                ) 
            ); 
        }
        
    } // End of group adapterControl
    
    group internalFunctions { // TODO Use parametrized function (ETSI ES 202 784) insetad of the three oct2xxx functions
@@ -694,50 +625,6 @@ module LibItsFntp_Functions {
            log("*** oct2npdu: INFO: Decoded message done ***");
        } // End of function oct2npdu
        
        /**
         * @desc  This function convert the specified octetstring into a CTX template
         * @param p_data        An octetstring to decode
         * @param p_syncPoint   Current synchronisation point, required to set verdict according to the LibCommon rules
         * @param p_decoded     The decoded message
         * @verdict Unchanged on success, set to fail otherwise
         * @see ISO/CD 29281 - Clause 7.9.2 & 7.9.4
         */
        function oct2ctx(in octetstring p_data, in charstring p_syncPoint, out CTX p_decoded) runs on ItsAdapterComponent {
            var integer v_result;
            
            v_result := decvalue(oct2bit(p_data), p_decoded);
            if (v_result == 1) {
                f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); 
                log("*** oct2ctx: FAIL: 'decvalue' operation failed ***");
            } else if (v_result == 2) {
                f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); 
                log("*** oct2ctx: FAIL: 'decvalue' operation failed, not enougth bits ***");
            }
            log("*** oct2ctx: INFO: Decoded message done ***");
        } // End of function oct2ctx
        
        /**
         * @desc  This function convert the specified octetstring into a CTX template
         * @param p_data        An octetstring to decode
         * @param p_syncPoint   Current synchronisation point, required to set verdict according to the LibCommon rules
         * @param p_decoded     The decoded message
         * @verdict Unchanged on success, set to fail otherwise
         * @see ISO/CD 29281 - Clause 7.9.3
         */
        function oct2sam(in octetstring p_data, in charstring p_syncPoint, out SAM p_decoded) runs on ItsAdapterComponent {
            var integer v_result;
            
            v_result := decvalue(oct2bit(p_data), p_decoded);
            if (v_result == 1) {
                f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); 
                log("*** oct2sam: FAIL: 'decvalue' operation failed ***");
            } else if (v_result == 2) {
                f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); 
                log("*** oct2sam: FAIL: 'decvalue' operation failed, not enougth bits ***");
            }
            log("*** oct2sam: INFO: Decoded message done ***");
        } // End of function oct2npdu
        
    } // End of group internalFunctions
    
    group iutFunctions {
+1 −0
Original line number Diff line number Diff line
@@ -314,4 +314,5 @@ module LibItsFntp_Pixits {
     * Wait until the IUT is in a stable situation (beaconing...)
     */
    modulepar float PX_WAIT_FOR_IUT_READY := 1.0;
    
} // End of module LibItsFntp_Pixits
 No newline at end of file
+65 −96
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ module LibItsFsap_Functions {
    // LibIts
    import from CALMmanagement language "ASN.1:1997" {
        type
            ITS_scuId//, ApplicationID, 
            ITS_scuId, ApplicationID 
    };
    import from CALMiitsscu language "ASN.1:1997" {
        type 
@@ -51,23 +51,16 @@ module LibItsFsap_Functions {
        
        /**
         * @desc This configuration features:
         * <li>Host and Router are separated (see ISO/WD 24102-3 - Figure 1 - Implementation architecture II & III)</li>
         * <li>Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)</li>
         * <li>MGT1 IISC Port (IISC/LAN) is used if specified</li>
         * @param p_iicpMGM Set to true if IISC port shall be used
         */
        function f_cf01Up(in boolean p_iicpMGM) runs on ItsMgt {
            
            // Sanity check
            // FIXME Check control to be done here
//            if (not(PICS_ITS_S_INW)) {
//                log("*** f_cf01Up: ERROR: PICS_ITS_S_INW required for executing the TC ***");
//                stop;
//            }
            
            // Map
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            map(self:mgtMNSapPort, system:mgtMNSapPort);
            map(self:mgtMFSapPort, system:mgtMFSapPort);
            if (p_iicpMGM == true) {
                map(self:iiscPort, system:iiscPort);
            }
@@ -79,13 +72,17 @@ module LibItsFsap_Functions {
            activate(a_cf01Down(p_iicpMGM));
            
            // Initialize the component
            f_initialiseComponent("cf01Up");
            f_initialiseComponent("cf01Up", p_iicpMGM);

            // Initialze the IUT
            f_initialState();
            
        } // End of function f_cf01Up
        
        /**
         * @desc    Deletes configuration cf01
         * @param   p_iicpMGM Set to true if IISC port shall be used
         */
        function f_cf01Down(in boolean p_iicpMGM) runs on ItsMgt {
            
            deactivate;
@@ -93,7 +90,7 @@ module LibItsFsap_Functions {
            // Unmap
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            unmap(self:mgtMNSapPort, system:mgtMNSapPort);
            unmap(self:mgtMFSapPort, system:mgtMFSapPort);
            if (p_iicpMGM == true) {
                unmap(self:iiscPort, system:iiscPort); // FIXME To be removed
            }
@@ -101,23 +98,21 @@ module LibItsFsap_Functions {
            // Disconnect
            f_disconnect4SelfOrClientSync();
            
        } // end f_cf01Down
        } // End of f_cf01Down
        
        /**
         * @desc    Behavior function for initializing component's variables and tables
         * @param   p_componentName Name of the component
         * @param   p_iicpMGM Set to true if IISC port shall be used
         */
        function f_initialiseComponent(in charstring p_componentName) runs on ItsMgt {
        function f_initialiseComponent(in charstring p_componentName, in boolean p_iicpMGM) runs on ItsMgt {
            
            // Initialize variables
//            vc_componentName := p_componentName;
//            vc_portNumber := { portLong := c_portNon };
//            vc_scuId := 255;
            
            // Set defaults
            //activate(a_fsapDefault()); // FIXME Default for Fsap module
            activate(a_mgtMFSapPortDefault()); // Default for MGT module / MF-SAP port
            if (PICS_ITS_S_INW == true) { // FIXME Use a function
            activate(a_fsapDefault()); 
            if (p_iicpMGM == true) { 
                activate(a_iiscDefault()); // Default for Iisc module
            }
            
@@ -132,7 +127,7 @@ module LibItsFsap_Functions {
         */
        function f_initialState() {
            f_utInitializeIut(m_fsapInitialize);
            f_sleepIgnoreDef(2.0); // Wait until the IUT is in a stable situation (beaconing...)
            f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...)
        } // End of function f_initialState
        
    } // End of group preambles
@@ -143,8 +138,8 @@ module LibItsFsap_Functions {
         * @desc The default postamble.
         */
        function f_poDefault() runs on ItsMgt {
            //empty
        }
            // Nothing to do
        } // End of function f_poDefault
        
    } // End of group postambles
    
@@ -154,9 +149,9 @@ module LibItsFsap_Functions {
         * @desc    Triggers event in the test system adaptation via NF-SAP interface.
         * @param   p_event The event to trigger
         */
        function f_acTriggerEvent(template (value) AcFsapPrimitive p_event) runs on ItsAdapterComponent {
            acPort.send(p_event);
        }
//        function f_acTriggerEvent(template (value) AcFsapPrimitive p_event) runs on ItsAdapterComponent {
//            acPort.send(p_event);
//        }
        
    } // End of group adapterControl
    
@@ -164,27 +159,6 @@ module LibItsFsap_Functions {
        
    } // End of group testerFunctions
    
//    group mfSapFunctions {
//        
//        /**
//         * @desc    Generate a correctly formatted GCctxTxCmd message via IN-SAP interface
//         * @param   p_commandRef  Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
//          * @verdict Unchanged
//         */
//        function f_mfSapGenerateGCregServer(in CommandRef p_commandRef) runs on ItsMgt {
//            f_mgtGenerateGCregServer(
//                p_commandRef, 
//                m_gCregServer(
//                    f_getIutApplicationID(), 
//                    f_getIutGCschedule(),
//                    PX_USER_PRIORITY,
//                    f_getIutServiceDataReg()
//                )
//            );
//        }
//        
//    } // End of group mfSapFunctions
//    
    group iutFunctions {
        
        /**
@@ -209,56 +183,51 @@ module LibItsFsap_Functions {
            return PX_LOCAL_ITS_TYPE;
        }
        
//        /**
//         * @desc Gets the SAM retransmit timer.
//         * @return  SAM retransmit timer 
//         */
//        function f_getSAMRetransmitTimer() return float {
//            var float v_samRetransmitTimer;
//            
//            v_samRetransmitTimer := int2float(
//                (PICS_SAM_RETRANSMIT_TIMER/1000));
//            
//            return v_samRetransmitTimer;
//        }
//        
//        /**
//         * @desc    Gets the maximum SAM jitter.
//         * @return  Maximum SAM jitter
//         */
//        function f_getSAMMaxJitter() return float {
//            var float v_samRetransmitTimerMaxJitter := int2float(PICS_SAM_RETRANSMIT_TIMER)/1000.0;
//            
//            return v_samRetransmitTimerMaxJitter;
//        }
//        
//        /**
//         * @desc    TODO
//         * @return  TODO
//         * @verdict TODO
//         */
//        function f_getIutApplicationID() return ApplicationID {
//            return PX_APPLICATION_ID_1;
//        }
//        
//        /**
//         * @desc    TODO
//         * @return  TODO
//         * @verdict TODO
//         */
//        function f_getIutGCschedule() return GCschedule {
//            return { PX_GSCHED_1_0, PX_GSCHED_1_1 };
//        }
//        
//        /**
//         * @desc    TODO
//         * @return  TODO
//         * @verdict TODO
//         */
//        function f_getIutServiceDataReg() return ServiceDataReg {
//            return PX_SERVICE_DATA_REG_1;
//        }
//        
        /**
         * @desc Gets the SAM retransmit timer.
         * @return  SAM retransmit timer 
         */
        function f_getIutSAMRetransmitTimer() return float {
            return int2float(
                (PICS_SAM_RETRANSMIT_TIMER / 1000.0)); // FIXME Check if PIXIT would not be better than PICS
        }
        
        /**
         * @desc    Gets the maximum SAM jitter.
         * @return  Maximum SAM jitter
         */
        function f_getIutSAMMaxJitter() return float {
            return int2float(
                PICS_SAM_RETRANSMIT_TIMER) / 1000.0; // FIXME Check if PIXIT would not be better than PICS
        }
        
        /**
         * @desc    TODO
         * @return  TODO
         * @verdict TODO
         */
        function f_getIutApplicationID() return ApplicationID {
            return PX_APPLICATION_ID;
        }
        
        /**
         * @desc    TODO
         * @return  TODO
         * @verdict TODO
         */
        function f_getIutGCscheduleWithAccessTechAndNonIP() return GCschedule {
            return { PX_GSCHED_ACCESS_TECH_NONIP };
        }
        
        /**
         * @desc    TODO
         * @return  TODO
         * @verdict TODO
         */
        function f_getIutServiceDataReg() return ServiceDataReg {
            return PX_SERVICE_DATA_REG;
        }
        
    } // End of group iutFunctions
    
    group fsapAltsteps {
+30 −21
Original line number Diff line number Diff line
@@ -55,21 +55,22 @@ module LibItsFsap_Pixits {
    
    group CRegServer {
        
        modulepar ApplicationID PX_APPLICATION_ID_1 := {
        modulepar ApplicationID PX_APPLICATION_ID := {
            hostITS_scuId := 1,
            seqNumber := 1
        }
        
//        modulepar GCsched PX_GSCHED_1_0 := {
//            medium := 255, // FIXME TTwb does not generate MedType.ethernet label
//            directivity := {
//                mode := 0, // FIXME TTwb does not generate DirMode.fixed label
//                dirPredef := 0,
//                dirVar := omit
//            },
//            gcInterval := 1
//        }
//        
        modulepar GCsched PX_GSCHED_ACCESS_TECH_NONIP := {
            medium := 128, // FIXME TTwb does not generate MedType.iso15628
            directivity := {
                mode := 0, // FIXME TTwb does not generate DirMode.fixed label
                dirPredef := 0,
                fill := '0000000'B, 
                dirVar := { }
            },
            gcInterval := 1
        }
        
//        modulepar GCsched PX_GSCHED_1_1 := {
//            medium := 255, // FIXME TTwb does not generate MedType.ethernet label
//            directivity := {
@@ -80,17 +81,25 @@ module LibItsFsap_Pixits {
//            gcInterval := 1
//        }
//        
//        modulepar ServiceDataReg PX_SERVICE_DATA_REG_1 := {
//            nonipData := {
//                serviceID := {
//                    content := 1
//                },
//                timeout_ := 100,
//                serviceData := omit,
//                providerPort := omit
//            }
//        }
        modulepar ServiceDataReg PX_SERVICE_DATA_REG := {
            fill := '0000000'B, 
            datareg := {
                nonipData := {
                    serviceID := {
                        content := 1
                    },
                    timeout_ := 100,
                    serviceData := ''O,
                    providerPort := 1234
                }
            }
        }
        
    } // End of group CRegServer
    
    /**
     * Wait until the IUT is in a stable situation (beaconing...)
     */
    modulepar float PX_WAIT_FOR_IUT_READY := 1.0;
    
} // End of module LibItsFsap_Pixits
 No newline at end of file
+139 −73
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@ module LibItsFsap_Templates {
        type 
            ITSaid
    };
    import from CALMmsap language "ASN.1:1997" {
        type 
            MF_Command, 
            MF_Request_request, MF_Request 
    };
    import from CALMllsap language "ASN.1:1997" {
        type
            IN_SAPaddress, Link_ID, 
@@ -24,9 +29,12 @@ module LibItsFsap_Templates {
        type 
            ApplicationID, 
            CTX, CTXrxNot, GCctxTxCmd,  GCregServer, GCregClient, GCderegClient, GCschedule, 
            ServiceDataReg, 
            ServiceDataReg, SAMserviceData, 
            SAM, SAMrxNot 
    };
    import from LibItsFsap_Pixits {
        modulepar PX_USER_PRIORITY
    };
    import from LibItsCommon_TypesAndValues all;
    
    group fsapPrimitives {
@@ -41,12 +49,17 @@ module LibItsFsap_Templates {
                }
            } // End of template m_fsapInitialize
            
//            /**
//             * @desc Initializes the FSAP IUT
//             */
//            template UtFsapCommandRequest mw_fsapNfCommandRequest := {
//                
//            } // End of template m_fsapInitialize
            /**
             * @desc    TODO
             * @param   p_mfRequestReq TODO
             */
            template (value) UtCommandRequest m_generateMFRequestReq( 
                in template (value) MF_Request_request p_mfRequestReq 
            ) := { 
                utFsapCommandRequest := {
                    mfRequestReq := p_mfRequestReq
                } // End of field 'utFsapCommandRequest'
            } // End of template m_generateMFRequestReq
            
        } // End of group utPrimitives
        
@@ -85,17 +98,27 @@ module LibItsFsap_Templates {
        
        group cregServerMessagePDU {
            
            template (value) GCregServer m_gCregServer(
            group send_ {
                
                template (value) MF_Request m_mfRequest_GCregServer(
                    in template (value) ApplicationID p_applicationID,
                    in template (value) GCschedule p_gCschedule,
                in template (value) UserPriority p_priority,
                    in template (value) ServiceDataReg p_serviceDataReg
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        gCregServer := {
                            applicationID := p_applicationID,
                            gCschedule := p_gCschedule,
                priority := p_priority,
                            priority := PX_USER_PRIORITY,
                            serviceDataReg := p_serviceDataReg
            } // End of template m_gCregServer
                        } //  // End of field 'gCregServer'
                    } // End of field 'mfReq'
                } // End of template m_mfRequest_GCregServer
                
            } // End of group send_
            
            group recv_ {
                
                template GCregServer mw_gCregServer_any := {
                    applicationID := {
@@ -112,10 +135,14 @@ module LibItsFsap_Templates {
                    } // End of field 'serviceDataReg'
                } // End of template mw_gCregServer
                
            } // End of group recv_
            
        } // End of group cregServerMessagePDU
        
        group cregClientMessagePDU {
            
            group send_ {
                
                /**
                 * @desc ITS-S application shall register its supported service at the groupcasting manager using the services of the groupcasting registration handler
                 * @param p_hostITS_scuId  The ITS-SCU-ID of the ITS-S host where the service provider ITS-S application resides together with an ITS-S application reference number being unique at this ITS-SCU
@@ -123,6 +150,25 @@ module LibItsFsap_Templates {
                 * 
                 * See ISO/CD 24102-5 Clause 8.5
                 */
                template (value) MF_Request m_mfRequest_GCregClient(
                    in template (value) ApplicationID p_applicationID,
                    in template (value) ITSaid p_serviceID
                ) := {
                    fill := '0000'B,
                    mfReq := {
                        gCregClient := {
                            applicationID := p_applicationID,
                            priority := PX_USER_PRIORITY,
                            serviceID := p_serviceID,
                            contextData := ''O
                        } // End of field 'gCregClient'
                    } // End of field 'mfReq'
                } // End of template m_mfRequest_GCregServer
                
            } // End of group send_
            
            group recv_ {
                
                template (value) GCregClient m_gCregClient(
                    in template (value) ITS_scuId p_hostITS_scuId,
                    in template (value) ITSaid p_serviceID
@@ -159,6 +205,8 @@ module LibItsFsap_Templates {
                
            } // End of group cregMessagePDU
            
        } // end of group recv_
        
        group cderegClientMessagePDU {
            
            /**
@@ -215,6 +263,24 @@ module LibItsFsap_Templates {
                }
            } // End of template m_sAMrxNot
            
            /**
             * @desc 
             */
            template MF_Command mw_mfCommad_gCSAM(
                in template (present) ApplicationID p_applicationID,
                in template (present) StationID p_serverID,
                in template (present) SAMserviceData p_serviceData
            ) := {
                fill := ?,
                mfCmd := {
                    gCsam := {
                        applicationID := p_applicationID,
                        serverID := p_serverID,
                        serviceData := p_serviceData
                    } // End of header 'gCsam'
                } // End of header 'mfCmd'
            } // End of template mw_mfCommad_gCSAM
            
            template SAMrxNot mw_sAMrxNot(
                in template (present) IN_SAPaddress p_csap,
                in template (present) Link_ID p_linkID,
Loading