Commit f68487c4 authored by YannGarcia's avatar YannGarcia
Browse files

Finalyze support of titan-test-system-framework

parent 9ce69903
Loading
Loading
Loading
Loading
+0 −140
Original line number Original line Diff line number Diff line
@@ -13,97 +13,14 @@
module LibItsCommon_Functions {
module LibItsCommon_Functions {


    // LibCommon
    // LibCommon
//    import from LibCommon_Sync all;
//    import from LibCommon_VerdictControl all;
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_BasicTypesAndValues all;
    
    
    // LibIts
    // LibIts
    import from LibItsCommon_Pixits all;
    import from LibItsCommon_Pixits all;
    import from ITS_Container language "ASN.1:1997" all;
    import from ITS_Container language "ASN.1:1997" all;
//    import from DSRC language "ASN.1:1997" all;
    
    
    group generalFunctions {
    group generalFunctions {
        
        
        /** 
         * @desc    function to generate integer random values
         *            
         * @see        ttcn-3 - rnd()
         * @param     p_lowerbound lowest number in range
         * @param     p_upperbound highest number in range
         * @return     random integer
         *
        */
        function f_random(    in integer p_lowerbound,
                            in integer p_upperbound )
        return integer {
            //Variables
            var integer v_random := 0;
            v_random := float2int(int2float(p_upperbound - p_lowerbound +1)*rnd()) + p_lowerbound;
    
            log("*** f_random: INFO: OK - random value = " & int2str(v_random) & " ***");
            return v_random;
    
        } // end function f_random

        /**
         * @desc    Computes the absolute value of an integer 
         * @param   p_number    the number
         * @return  Absolute value of the number
         */
        function f_abs(in integer p_number) 
        return integer {
            
            if(p_number < 0) {
                return 0 - p_number;
            }
            return p_number;    
        }

        /**
         * @desc    Computes the absolute value of an integer 
         * @param   p_number    the number
         * @return  Absolute value of the number
         */
        function ff_abs(in float p_number) 
        return float {
            
            if(p_number < 0.0) {
                return 0.0 - p_number;
            }
            return p_number;    
        }

        /**
         * @desc    Compares two values and returns the lowest onde  
         * @param   p_a     First value
         * @param   p_b     Second value
         * @return  Lowest value
         */
        function f_min(in integer p_a, in integer p_b) 
        return integer {
            
            if(p_a < p_b) {
                return p_a;
            }
            return p_b;    
        }

        /** 
         * @desc    Removes unsignificant right-most 0 bits of a bitstring
         *            
         * @param     p_bitstring Bitstring to be reduced
         * @return    Reduced bitstring
         *
        */    
        function f_removeUnsignificantBits(in bitstring p_bitstring)
        return bitstring {
            var integer i, len;
            
            len := lengthof(p_bitstring);
            for(i:=len-1; i >=0 and p_bitstring[i] == '0'B; i:=i-1) {}
            return substr(p_bitstring, 0, i + 1);
        } 
    
        /**
        /**
         * @desc    Gets the current time since 01/01/2004
         * @desc    Gets the current time since 01/01/2004
         * @return  TimestampIts - current time since 01/01/2004 in milliseconds
         * @return  TimestampIts - current time since 01/01/2004 in milliseconds
@@ -117,19 +34,6 @@ module LibItsCommon_Functions {
            return v_timeStamp;
            return v_timeStamp;
        }
        }
           
           
        /**
         * @desc    Gets the current time since 01/01/1970 in UTC format
         * @return  The current time since 01/01/1970 in UTC format in milliseconds
         */
        function f_getCurrentTimeUtc() return UInt64 {
            var UInt64 v_time := 0;
            
//            log("*** f_getCurrentTimeUtc: INFO: calling fx_getCurrentTimeUtc() ***");
            v_time := fx_getCurrentTimeUtc();
            
            return v_time;
        }
           
        /**
        /**
         * @desc    Gets the current time since 01/01/2004
         * @desc    Gets the current time since 01/01/2004
         * @return  TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time
         * @return  TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time
@@ -143,32 +47,6 @@ module LibItsCommon_Functions {
            return v_timeMark;
            return v_timeMark;
        }
        }
           
           
        /**
         * @desc    Gets the Minute of current UTC year
         * @return  MinuteOfTheYear - tenths of a second in the current or next hour in units of 1/10th second from UTC time
         */
        function f_getMinuteOfTheYear() return UInt16 {
            var UInt16 v_minuteOfTheYear := 0;
            
//            log("*** f_getMinuteOfTheYear: INFO: calling fx_getMinuteOfTheYear() ***");
            v_minuteOfTheYear := fx_getMinuteOfTheYear();
            
            return v_minuteOfTheYear;
        }
           
        /**
         * @desc    Gets the milliseconds point in the current UTC minute
         * @return  DSecond - The milliseconds point in the current UTC minute (0..60000)
         */
        function f_getDSecond() return UInt16 {
            var UInt16 v_dSecond := 0;
            
//            log("*** f_getDSecond: INFO: calling fx_getDSecond() ***");
            v_dSecond := fx_getDSecond();
            
            return v_dSecond;
        }
           
    } // end generalFunctions  
    } // end generalFunctions  
       
       
    group itsFunctions { 
    group itsFunctions { 
@@ -246,30 +124,12 @@ module LibItsCommon_Functions {
         */
         */
        external function fx_getCurrentTime() return UInt64;
        external function fx_getCurrentTime() return UInt64;
        
        
        /**
         * @desc    Gets the current time since 01/01/1970 in UTC format
         * @return  The current time since 01/01/1970 in UTC format
         */
        external function fx_getCurrentTimeUtc() return UInt64;
        
        /**
        /**
         * @desc    Gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time
         * @desc    Gets the tenths of a second in the current or next hour in units of 1/10th second from UTC time
         * @return  TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time
         * @return  TimeMark - tenths of a second in the current or next hour in units of 1/10th second from UTC time
         */
         */
        external function fx_getCurrentTimeMark() return UInt32;
        external function fx_getCurrentTimeMark() return UInt32;
        
        
        /**
         * @desc    Gets the minutes of current UTC year
         * @return  MinuteOfTheYear - minutes of current UTC year
         */
        external function fx_getMinuteOfTheYear() return UInt16;
        
        /**
         * @desc    Gets the milliseconds point in the current UTC minute
         * @return  DSecond - the milliseconds point in the current UTC minute
         */
        external function fx_getDSecond() return UInt16;
        
        /**
        /**
         * @desc    External function to compute distance between two points
         * @desc    External function to compute distance between two points
         * @param   p_latitudeA   Latitude of first point
         * @param   p_latitudeA   Latitude of first point
+0 −35
Original line number Original line Diff line number Diff line
/**
 *    @author   ETSI / STF545
 *    @version  $URL$
 *              $ID:$
 *    @desc     This module provides the custom binary types for ITS HTTP based protocols.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 */
module LibItsHttp_BinaryMessageBodyTypes {
    
  /**
   * This file volontary contains a trivial declaration of the type BinaryBodu. 
   * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the BinaryBody typing.
   */
  // TODO Add here your custom binary import
  // LibIts
  import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all;
  import from Ieee1609Dot2 language "ASN.1:1997" all;
  import from EtsiTs102941BaseTypes language "ASN.1:1997" all;
  import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all;
  import from EtsiTs102941MessagesCa language "ASN.1:1997" all;
  import from EtsiTs103097Module language "ASN.1:1997" all;
  
  type union BinaryBody {
    // TODO Add here your custom variants
    Ieee1609Dot2Data   ieee1609dot2_data,
    Certificate        ieee1609dot2_certificate,
    octetstring        raw
  } with {
    variant ""
  }
      
} // End of LibItsHttp_BinaryMessageBodyTypes
+0 −62
Original line number Original line Diff line number Diff line
/**
 *    @author   ETSI / STF545
 *    @version  $URL$
 *              $ID:$
 *    @desc     This module provides the custom templates for ITS HTTP based protocols.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 */
module LibItsHttp_BinaryTemplates {
  
  // LibItsHttp
  import from LibItsHttp_BinaryMessageBodyTypes all;
    
  // TODO Add here your custom binary import 
  // LibIts
  import from Ieee1609Dot2BaseTypes language "ASN.1:1997" all;
  import from Ieee1609Dot2 language "ASN.1:1997" all;
  import from EtsiTs102941BaseTypes language "ASN.1:1997" all;
  import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all;
  import from EtsiTs102941MessagesCa language "ASN.1:1997" all;
  import from EtsiTs103097Module language "ASN.1:1997" all;
  
  template (value) BinaryBody m_binary_body_raw(
                                                in template (value) octetstring p_raw
  ) := {
    raw := p_raw
  } // End of template m_binary_body_raw

  template (present) BinaryBody mw_binary_body_raw(
                                                   template (present) octetstring p_raw := ?
  ) := {
    raw := p_raw
  } // End of template mw_binary_body_raw
  
  // TODO Add here your custom binary template
  template (value) BinaryBody m_binary_body_ieee1609dot2_data(
                                                              in template (value) Ieee1609Dot2Data p_ieee1609dot2_data
  ) := {
    ieee1609dot2_data := p_ieee1609dot2_data
  } // End of template m_binary_body_ieee1609dot2_data

  template (present) BinaryBody mw_binary_body_ieee1609dot2_data(
                                                                 template (present) Ieee1609Dot2Data p_ieee1609dot2_data := ?
  ) := {
    ieee1609dot2_data := p_ieee1609dot2_data
  } // End of template mw_binary_body_ieee1609dot2_data
  
  template (value) BinaryBody m_binary_body_ieee1609dot2_certificate(
                                                                     in template (value) CertificateBase p_ieee1609dot2_certificate
  ) := {
    ieee1609dot2_certificate := p_ieee1609dot2_certificate
  } // End of template m_binary_body_ieee1609dot2_certificate

  template (present) BinaryBody mw_binary_body_ieee1609dot2_certificate(
                                                                        template (present) CertificateBase p_ieee1609dot2_certificate := ?
  ) := {
    ieee1609dot2_certificate := p_ieee1609dot2_certificate
  } // End of template mw_binary_body_ieee1609dot2_certificate
  
} // End of module LibItsHttp_BinaryTemplates
+0 −9
Original line number Original line Diff line number Diff line
module LibItsHttp_BinaryTypes { // FIXME To be removed
    
    /**
     * This file is volontary empry. You have to declare all XSD files required by your project
     * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too.
     */
    // TODO Add here your custom binary import
    
} // End of module LibItsHttp_BinaryTypes 
+0 −11
Original line number Original line Diff line number Diff line
module LibItsHttp_EncdecDeclarations {
  // LibHttp
  import from LibItsHttp_TypesAndValues all;
  
  external function fx_enc_http_message (HttpMessage p) return bitstring
      with {extension "prototype(convert) encode(HttpCodec)"}
      
  external function fx_dec_http_message (inout bitstring b, out HttpMessage p) return integer
      with {extension "prototype(sliding) decode(HttpCodec)"}
      
} // End of module LibItsHttp_EncdecDeclarations 
Loading