Commit 485ede04 authored by tepelmann's avatar tepelmann
Browse files

Implemented

TC_GEONW_PON_GUC_BV_10, TC_GEONW_PON_GBC_BV_20, TC_GEONW_PON_GAC_BV_12,
TC_GEONW_PON_BCA_BV_01.

Reduced warnings.
Minor changes.
parent d5288d7a
Loading
Loading
Loading
Loading
+45 −25
Original line number Original line Diff line number Diff line
@@ -81,10 +81,10 @@ module LibItsGeoNetworking_Templates {
             * @desc    Request IUT to send a GeoUnicast message to a specific destination
             * @desc    Request IUT to send a GeoUnicast message to a specific destination
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
             * @param   p_destinationGnAddr Destination of the GeoUnicast message
             */
             */
            template UtGnTrigger m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := {
            template (value) UtGnTrigger m_generateGeoUnicastMessage(GN_Address p_destinationGnAddr) := {
                geoUnicast := {
                geoUnicast := {
                    gnAddress := p_destinationGnAddr,
                    gnAddress := p_destinationGnAddr,
                    lifetime := 1000 * c_defaultLifetime,
                    lifetime := c_lifetime,
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                }
                }
            }
            }
@@ -95,9 +95,9 @@ module LibItsGeoNetworking_Templates {
             * @param   p_lifetime          Lifetime of the GeoUnicast message
             * @param   p_lifetime          Lifetime of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
             * @see     m_generateGeoUnicastMessage
             */
             */
            template UtGnTrigger m_generateGeoUnicastMessageWithLifetime(
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetime(
                GN_Address p_destinationGnAddr,
                GN_Address p_destinationGnAddr,
                integer p_lifetime
                UInt16 p_lifetime
            ) modifies m_generateGeoUnicastMessage := {
            ) modifies m_generateGeoUnicastMessage := {
                geoUnicast := {
                geoUnicast := {
                    lifetime := p_lifetime
                    lifetime := p_lifetime
@@ -110,7 +110,7 @@ module LibItsGeoNetworking_Templates {
             * @param   p_payload           Payload of the GeoUnicast message
             * @param   p_payload           Payload of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
             * @see     m_generateGeoUnicastMessage
             */
             */
            template UtGnTrigger m_generateGeoUnicastMessageWithPayload(
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithPayload(
                GN_Address p_destinationGnAddr,
                GN_Address p_destinationGnAddr,
                octetstring p_payload
                octetstring p_payload
            ) modifies m_generateGeoUnicastMessage := {
            ) modifies m_generateGeoUnicastMessage := {
@@ -126,9 +126,9 @@ module LibItsGeoNetworking_Templates {
             * @param   p_payload           Payload of the GeoUnicast message
             * @param   p_payload           Payload of the GeoUnicast message
             * @see     m_generateGeoUnicastMessage
             * @see     m_generateGeoUnicastMessage
             */
             */
            template UtGnTrigger m_generateGeoUnicastMessageWithLifetimeWithPayload(
            template (value) UtGnTrigger m_generateGeoUnicastMessageWithLifetimeWithPayload(
                GN_Address p_destinationGnAddr,
                GN_Address p_destinationGnAddr,
                integer p_lifetime,
                UInt16 p_lifetime,
                octetstring p_payload
                octetstring p_payload
            ) modifies m_generateGeoUnicastMessageWithLifetime := {
            ) modifies m_generateGeoUnicastMessageWithLifetime := {
                geoUnicast := {
                geoUnicast := {
@@ -140,12 +140,12 @@ module LibItsGeoNetworking_Templates {
             * @desc    Request IUT to send a GeoBroadcast message to a specific area
             * @desc    Request IUT to send a GeoBroadcast message to a specific area
             * @param   p_geoArea  Destination area of the message
             * @param   p_geoArea  Destination area of the message
             */
             */
            template UtGnTrigger m_generateGeoBroadcastMessage(
            template (value) UtGnTrigger m_generateGeoBroadcastMessage(
                GeoArea p_geoArea
                GeoArea p_geoArea
            ) := {
            ) := {
                geoBroadcast := {
                geoBroadcast := {
                	shape := p_geoArea.shape,
                	shape := p_geoArea.shape,
                    lifetime := 1000 * c_defaultLifetime,
                    lifetime := c_lifetime,
                    area := p_geoArea.area,
                    area := p_geoArea.area,
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                }
                }
@@ -156,9 +156,9 @@ module LibItsGeoNetworking_Templates {
             * @param   p_geoArea   Destination area of the message
             * @param   p_geoArea   Destination area of the message
             * @param   p_lifetime  Packet's lifetime
             * @param   p_lifetime  Packet's lifetime
             */
             */
            template UtGnTrigger m_generateGeoBroadcastMessageWithLifetime(
            template (value) UtGnTrigger m_generateGeoBroadcastMessageWithLifetime(
                GeoArea p_geoArea,
                GeoArea p_geoArea,
                integer p_lifetime
                UInt16 p_lifetime
            ) modifies m_generateGeoBroadcastMessage := {
            ) modifies m_generateGeoBroadcastMessage := {
                geoBroadcast := {
                geoBroadcast := {
                    lifetime := p_lifetime
                    lifetime := p_lifetime
@@ -171,7 +171,7 @@ module LibItsGeoNetworking_Templates {
             * @param   p_payload   Payload of the GeoBroadcast message
             * @param   p_payload   Payload of the GeoBroadcast message
             * @see     m_generateGeoBroadcastMessage
             * @see     m_generateGeoBroadcastMessage
             */
             */
            template UtGnTrigger m_generateGeoBroadcastMessageWithPayload(
            template (value) UtGnTrigger m_generateGeoBroadcastMessageWithPayload(
                GeoArea p_geoArea,
                GeoArea p_geoArea,
                octetstring p_payload
                octetstring p_payload
            ) modifies m_generateGeoBroadcastMessage := {
            ) modifies m_generateGeoBroadcastMessage := {
@@ -184,12 +184,12 @@ module LibItsGeoNetworking_Templates {
             * @desc    Request IUT to send a GeoAnycast message to a specific area
             * @desc    Request IUT to send a GeoAnycast message to a specific area
             * @param   p_geoArea  Destination area of the message
             * @param   p_geoArea  Destination area of the message
             */
             */
            template UtGnTrigger m_generateGeoAnycastMessage(
            template (value) UtGnTrigger m_generateGeoAnycastMessage(
                GeoArea p_geoArea
                GeoArea p_geoArea
            ) := {
            ) := {
                geoAnycast := {
                geoAnycast := {
                	shape := p_geoArea.shape,
                	shape := p_geoArea.shape,
                    lifetime := 1000 * c_defaultLifetime,
                    lifetime := c_lifetime,
                    area := p_geoArea.area,
                    area := p_geoArea.area,
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                }
                }
@@ -201,7 +201,7 @@ module LibItsGeoNetworking_Templates {
             * @param   p_payload   Payload of the GeoAnycast message
             * @param   p_payload   Payload of the GeoAnycast message
             * @see     m_generateGeoAnycastMessage
             * @see     m_generateGeoAnycastMessage
             */
             */
            template UtGnTrigger m_generateGeoAnycastMessageWithPayload(
            template (value) UtGnTrigger m_generateGeoAnycastMessageWithPayload(
                GeoArea p_geoArea,
                GeoArea p_geoArea,
                octetstring p_payload
                octetstring p_payload
            ) modifies m_generateGeoAnycastMessage := {
            ) modifies m_generateGeoAnycastMessage := {
@@ -213,7 +213,7 @@ module LibItsGeoNetworking_Templates {
            /**
            /**
             * @desc    Request IUT to send a SHB message
             * @desc    Request IUT to send a SHB message
             */
             */
            template UtGnTrigger m_generateShbMessage := {
            template (value) UtGnTrigger m_generateShbMessage := {
                shb := {
                shb := {
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                }
                }
@@ -224,7 +224,7 @@ module LibItsGeoNetworking_Templates {
             * @param   p_payload   Payload of the SHB message
             * @param   p_payload   Payload of the SHB message
             * @see     m_generateShbMessage
             * @see     m_generateShbMessage
             */
             */
            template UtGnTrigger m_generateShbMessageWithPayload(
            template (value) UtGnTrigger m_generateShbMessageWithPayload(
                octetstring p_payload
                octetstring p_payload
            ) modifies m_generateShbMessage := {
            ) modifies m_generateShbMessage := {
                shb := {
                shb := {
@@ -235,7 +235,7 @@ module LibItsGeoNetworking_Templates {
            /**
            /**
             * @desc    Request IUT to send a TSB message
             * @desc    Request IUT to send a TSB message
             */
             */
            template UtGnTrigger m_generateTsbMessage := {
            template (value) UtGnTrigger m_generateTsbMessage := {
                tsb := {
                tsb := {
                	nbHops := 10,
                	nbHops := 10,
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
                    payload := { decodedPayload := omit, rawPayload := ''O} // do not use f_adaptPayload_m here
@@ -1187,7 +1187,7 @@ module LibItsGeoNetworking_Templates {
                in template (value) Lifetime p_lifeTime := m_defaultLifetime,
                in template (value) Lifetime p_lifeTime := m_defaultLifetime,
                in template (value) UInt8 p_hopLimit := c_defaultHopLimit
                in template (value) UInt8 p_hopLimit := c_defaultHopLimit
            ) := {
            ) := {
                version := c_geoNwProtocolVersion2,
                version := c_geoNwProtocolVersion,
                nextHeader := e_commonHeader,
                nextHeader := e_commonHeader,
                reserved := 0,
                reserved := 0,
                lifeTime := p_lifeTime,
                lifeTime := p_lifeTime,
@@ -1204,7 +1204,7 @@ module LibItsGeoNetworking_Templates {
                in template (present) Lifetime p_lifeTime := ?,
                in template (present) Lifetime p_lifeTime := ?,
                in template (present) UInt8 p_hopLimit := ?
                in template (present) UInt8 p_hopLimit := ?
            ) := {
            ) := {
                version := c_geoNwProtocolVersion2,
                version := c_geoNwProtocolVersion,
                nextHeader := ?,
                nextHeader := ?,
                reserved := ?,
                reserved := ?,
                lifeTime := p_lifeTime,
                lifeTime := p_lifeTime,
@@ -1418,9 +1418,9 @@ module LibItsGeoNetworking_Templates {
            template LongPosVector mw_longPosVectorPosition_withDelta(
            template LongPosVector mw_longPosVectorPosition_withDelta(
                in template (value) LongPosVector p_longPosVector
                in template (value) LongPosVector p_longPosVector
            ) modifies mw_longPosVectorPosition := {
            ) modifies mw_longPosVectorPosition := {
                    latitude := (valueof(p_longPosVector.latitude)-PX_POS_DELTA .. valueof(p_longPosVector.latitude)+PX_POS_DELTA),
                    latitude := f_getDelta32(p_longPosVector.latitude, PX_POS_DELTA),
                    longitude := (valueof(p_longPosVector.longitude)-PX_POS_DELTA .. valueof(p_longPosVector.longitude)+PX_POS_DELTA),
                    longitude := f_getDelta32(p_longPosVector.longitude, PX_POS_DELTA),
                    speed := (valueof(p_longPosVector.speed)-PX_POS_DELTA .. valueof(p_longPosVector.speed)+PX_POS_DELTA)
                    speed := f_getDelta15(p_longPosVector.speed, PX_POS_DELTA)
            }
            }
            
            
            /**
            /**
@@ -1443,8 +1443,8 @@ module LibItsGeoNetworking_Templates {
            template ShortPosVector mw_shortPosVectorPosition_withDelta(
            template ShortPosVector mw_shortPosVectorPosition_withDelta(
                in template (value) ShortPosVector p_shortPosVector
                in template (value) ShortPosVector p_shortPosVector
            ) modifies mw_shortPosVectorPosition := {
            ) modifies mw_shortPosVectorPosition := {
                    latitude := (valueof(p_shortPosVector.latitude)-PX_POS_DELTA..valueof(p_shortPosVector.latitude)+PX_POS_DELTA),
                    latitude := f_getDelta32(p_shortPosVector.latitude, PX_POS_DELTA),
                    longitude := (valueof(p_shortPosVector.longitude)-PX_POS_DELTA..valueof(p_shortPosVector.longitude)+PX_POS_DELTA)
                    longitude := f_getDelta32(p_shortPosVector.longitude, PX_POS_DELTA)
            }
            }
            
            
            /**
            /**
@@ -1458,6 +1458,26 @@ module LibItsGeoNetworking_Templates {
                    longitude := ?
                    longitude := ?
            }
            }
            
            
            function f_getDelta32(Int32 p_value, integer p_delta) return template (present) Int32 {
                if (p_value == c_int32Min) {
                    return (p_value .. p_value+p_delta);
                }
                if (p_value == c_int32Max) {
                    return (p_value-p_delta .. p_value);
                }
                return (p_value-p_delta .. p_value+p_delta);
            }
            
            function f_getDelta15(Int32 p_value, integer p_delta) return template (present) Int15 {
                if (p_value == c_int15Min) {
                    return (p_value .. p_value+p_delta);
                }
                if (p_value == c_int15Max) {
                    return (p_value-p_delta .. p_value);
                }
                return (p_value-p_delta .. p_value+p_delta);
            }
            
        } // end geoNwCommonHeaderTemplates
        } // end geoNwCommonHeaderTemplates
        
        
        group geoUnicastHeaderTemplates {
        group geoUnicastHeaderTemplates {
+1 −1
Original line number Original line Diff line number Diff line
@@ -48,6 +48,7 @@ module LibItsGeoNetworking_TypesAndValues {
    group geoTestingConstants {
    group geoTestingConstants {
        
        
        const UInt6 c_defaultLifetime := 10; // in seconds
        const UInt6 c_defaultLifetime := 10; // in seconds
        const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds
        
        
    } // end geoTestingConstants
    } // end geoTestingConstants
    
    
@@ -152,7 +153,6 @@ module LibItsGeoNetworking_TypesAndValues {
        group geoNwHeaderConstants {
        group geoNwHeaderConstants {
            
            
            const UInt4 c_geoNwProtocolVersion := 0;
            const UInt4 c_geoNwProtocolVersion := 0;
            const UInt4 c_geoNwProtocolVersion2 := 0; // TODO Check this. Where does '2' comes from ?
            
            
            const UInt8 c_hopLimit1 := 1;
            const UInt8 c_hopLimit1 := 1;
            const UInt8 c_defaultHopLimit := 10;
            const UInt8 c_defaultHopLimit := 10;