LibItsGeoNetworking_Templates.ttcn 90.3 KB
Newer Older
        /**
         * @desc    Receive template for GN_Address. Only M_ID field is discriminent 
         * @param   p_mid Expected GN Address MID
        template GN_Address mw_gnAddressMid(in template (present) GN_Address.mid p_mid) := {
            typeOfAddress := ?,
            stationType := ?,
            stationCountryCode := ?,
            mid := p_mid
        }
berge's avatar
berge committed
        group geoDummyTemplates {
            
            /**
             * @desc    Dummy template for GN_Address 
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) GN_Address m_dummyGnAddr := {
                typeOfAddress := e_manual,
tepelmann's avatar
tepelmann committed
                stationType := e_passengerCar,
                stationCountryCode := c_uInt10Zero,
            /**
             * @desc    Dummy template for long position vector
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) LongPosVector m_dummyLongPosVector := {
berge's avatar
berge committed
                gnAddr := m_dummyGnAddr,
                timestamp := c_uInt32Zero,
                latitude := c_uInt32Zero,
berge's avatar
berge committed
                longitude := c_uInt32Zero,
tepelmann's avatar
tepelmann committed
                pai := c_uInt1Zero,
berge's avatar
berge committed
                speed := c_uInt16Zero,
tepelmann's avatar
tepelmann committed
                heading := c_uInt16Zero
            /**
             * @desc    Dummy template for Area
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) Area m_dummyArea := {
                geoAreaPosLatitude := c_uInt32Zero,
                geoAreaPosLongitude := c_uInt32Zero,
                distanceA := c_uInt16Zero,
                distanceB := c_uInt16Zero,
tepelmann's avatar
tepelmann committed
                angle := c_uInt16Zero
berge's avatar
berge committed
            }
            /**
             * @desc    Dummy template for GeoBroadcastArea
berge's avatar
berge committed
             */
            template (value) GeoBroadcastArea m_dummyGeoBroadcastArea := {
berge's avatar
berge committed
                geoBroadcastSubType := e_geoBroadcastRect,
                geoBroadcastArea := m_dummyArea
            }
            
berge's avatar
berge committed
        } // end geoDummyTemplates
        
    } // end geoMiscTemplates
    
berge's avatar
berge committed
    group geoTemplateFunctions {
berge's avatar
berge committed
        function f_adaptPayload_m(in octetstring p_finalPayload) return template (value) Payload {
tepelmann's avatar
tepelmann committed
            var template (value) Payload v_payload;
            
            if(PX_GN_UPPER_LAYER == e_any) {
               v_payload := { decodedPayload := omit, rawPayload := p_finalPayload};
tepelmann's avatar
tepelmann committed
            }
            
            if(PX_GN_UPPER_LAYER == e_ipv6) {
               v_payload := { decodedPayload := { ipv6Packet := m_ipv6Packet(c_unspecified, c_allNodesMca, c_noNextHdr, m_octetstringPayload(p_finalPayload))}, rawPayload := ''O};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            if(PX_GN_UPPER_LAYER == e_btpA) {
               v_payload := { decodedPayload := { btpPacket := m_btpA({ decodedPayload := omit, rawPayload := p_finalPayload })}, rawPayload := ''O};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            if(PX_GN_UPPER_LAYER == e_btpB) {
               v_payload := { decodedPayload := { btpPacket := m_btpB({ decodedPayload := omit, rawPayload := p_finalPayload })}, rawPayload := ''O};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            return v_payload;
berge's avatar
berge committed
        function f_adaptPayload_mw(in template (present) octetstring p_finalPayload) return template (present) Payload {
            var template (present) Payload v_payload;
            
            if(PX_GN_UPPER_LAYER == e_any) {
               v_payload := { decodedPayload := *, rawPayload := p_finalPayload};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            if(PX_GN_UPPER_LAYER == e_ipv6) {
               v_payload := { decodedPayload := { ipv6Packet := mw_ipv6Packet(?, ?, ?, mw_octetstringPayload(p_finalPayload))}, rawPayload := ''O};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            if(PX_GN_UPPER_LAYER == e_btpA) {
               v_payload := { decodedPayload := { btpPacket := mw_btpA(?, ?, { decodedPayload := *, rawPayload := p_finalPayload } )}, rawPayload := ''O};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            if(PX_GN_UPPER_LAYER == e_btpB) {
               v_payload := { decodedPayload := { btpPacket := mw_btpB(?, ?, { decodedPayload := *, rawPayload := p_finalPayload })}, rawPayload := ''O};
tepelmann's avatar
tepelmann committed
               return v_payload;
berge's avatar
berge committed
            }
            
            return v_payload;
berge's avatar
berge committed
    } // end geoTemplateFunctions
    
berge's avatar
berge committed
} // end ItsGeoNetworking_Templates