Commit 4fff7ad7 authored by berge's avatar berge
Browse files

Change made during Plutests#1:

- Circular area
- IUT Mac Address PICS and refinedGeoNetworkingReq templates
- Removed 10sec timer in preamble (GetLPV)
parent fc7d004c
Loading
Loading
Loading
Loading
+47 −12
Original line number Diff line number Diff line
@@ -68,9 +68,9 @@ module LibItsGeoNetworking_Functions {
        
            // Area table
            f_addArea(v_areaTable, c_area1, 
                f_computeSquareArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            f_addArea(v_areaTable, c_area2, 
                f_computeSquareArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
        
            f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB);

@@ -149,9 +149,9 @@ module LibItsGeoNetworking_Functions {

            // Area table
            f_addArea(v_areaTable, c_area1, 
                f_computeSquareArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            f_addArea(v_areaTable, c_area2, 
                f_computeSquareArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            
            p_nodeB.start(f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB));
            p_nodeD.start(f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeD));
@@ -246,9 +246,9 @@ module LibItsGeoNetworking_Functions {
            
            // Area table
            f_addArea(v_areaTable, c_area1, 
                f_computeSquareArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            f_addArea(v_areaTable, c_area2, 
                f_computeSquareArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            
            p_nodeB.start(f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB));
            p_nodeC.start(f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeC));
@@ -353,9 +353,9 @@ module LibItsGeoNetworking_Functions {

            // Area table
            f_addArea(v_areaTable, c_area1, 
                f_computeSquareArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeD, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
            f_addArea(v_areaTable, c_area2, 
                f_computeSquareArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                f_computeCircularArea(v_longPosVectorNodeB, float2int(1.1 * f_distance(v_longPosVectorNodeB, v_longPosVectorNodeD))));
                            
            p_nodeB.start(f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeB));
            p_nodeC.start(f_initialiseComponent(v_positionTable, v_areaTable, c_compNodeC));
@@ -498,7 +498,7 @@ module LibItsGeoNetworking_Functions {
            
            v_return.latitude := v_return.latitude + p_latitudeFactor * PX_DISTANCE_UNIT;
            v_return.longitude := v_return.longitude + p_longitudeFactor * PX_DISTANCE_UNIT;
            v_return.timestamp := 0;
            v_return.timestamp := f_computeGnTimestamp();

            return v_return;
        }
@@ -642,6 +642,33 @@ module LibItsGeoNetworking_Functions {
            return v_geoArea;   
        }
        
        /**
         * @desc    Compute a circular geoArea
         * @param   p_centerLongPosVector   Center point of the square area
         * @param   p_distanceA             Radius of the square area in meters
         * @return  GeoArea - Computed geoArea
         */
        function f_computeCircularArea(
            in LongPosVector p_centerLongPosVector, 
            in UInt16 p_distanceA
        ) return GeoArea {
                
            var GeoArea v_geoArea;
            
            v_geoArea := {
                shape := e_geoCircle,
                area := {
                    geoAreaPosLatitude := p_centerLongPosVector.latitude,
                    geoAreaPosLongitude := p_centerLongPosVector.longitude,
                    distanceA := p_distanceA,
                    distanceB := 0,
                    angle := 0 
                }
            }
            
            return v_geoArea;   
        }        
        
        /**
         * @desc    Compute distance between two points
         * @param   p_pointA    First point
@@ -994,7 +1021,7 @@ module LibItsGeoNetworking_Functions {
                var LongPosVector v_repDstPosVector;
                
                [] a_receiveLsRequest(p_reqSeqNumber, p_mid, v_repDstPosVector) {
                    f_sendGeoNetMessage(m_geoNwReq(m_geoNwPduNoPayload(
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(m_geoNwPduNoPayload(
                        m_lsReplyHeader(
                        p_repSrcPosVector,
                        f_longPosVector2ShortPosVector(v_repDstPosVector),
@@ -1039,7 +1066,6 @@ module LibItsGeoNetworking_Functions {
        function f_initialState() {
           
            f_utInitializeIut(m_gnInitialize);
			f_sleepIgnoreDef(10.0);
        }
        
        
@@ -1084,7 +1110,7 @@ module LibItsGeoNetworking_Functions {
            var GeoNetworkingInd v_msg;
            
            f_sendGeoNetMessage(
                m_geoNwReq(
                m_geoNwReq_linkLayerBroadcast(
                    m_geoNwPduNoPayload(
                        m_lsRequestHeader(
                            p_reqSrcPosVector,
@@ -1308,6 +1334,15 @@ module LibItsGeoNetworking_Functions {
            return PICS_GN_LOCAL_ADDR_CONF_METHOD;
        }
        
        /**
         * @desc    Gets the IUT MAc address
         * @return  MacAddress - IUT's MAc Address
         * @see     PICS_IUT_MAC_ADDRESS
         */
        function f_getIutMacAddress() return MacAddress {
        	return PICS_IUT_MAC_ADDRESS;
        }
        
        /**
         * @desc    Gets the GeoUnicast forwarding algorithm
         * @return  IUT's GeoUnicast forwarding algorithm
+7 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@
 */
module LibItsGeoNetworking_Pics {
    
    import from LibItsGeoNetworking_TypesAndValues {type MacAddress;}

    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
@@ -177,6 +179,11 @@ module LibItsGeoNetworking_Pics {
         */        
        modulepar integer PICS_GN_GEOUNICAST_CBF_MAX_TIME := 100;
        
        /** 
         * @desc IUT's Mac address 
         */
        modulepar MacAddress PICS_IUT_MAC_ADDRESS := 'FFFFFFFFFFFF'O;
        
    } // end geoNwPics
    
} // end LibItsGeoNetworking_Pics
 No newline at end of file
+5 −4
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ module LibItsGeoNetworking_Templates {
         * @desc    Send template for GeoNetworking packet (GeonetworkingPort Primitive)
         * @param   p_geoNwMsg GeoNetworking packet to be sent
         */    
        template (value) GeoNetworkingReq m_geoNwReq(
        template (value) GeoNetworkingReq m_geoNwReq_linkLayerBroadcast(
            template (value) GeoNetworkingPacket p_geoNwMsg
        ) := {
            msgOut := p_geoNwMsg,
@@ -41,7 +41,7 @@ module LibItsGeoNetworking_Templates {
        template (value) GeoNetworkingReq m_geoNwReq_withLinkLayerDestination(
            template (value) GeoNetworkingPacket p_geoNwMsg,
            template (value) MacAddress p_llDestinationAdress
        ) modifies m_geoNwReq := {
        ) modifies m_geoNwReq_linkLayerBroadcast := {
            macDestinationAddress := p_llDestinationAdress
        }

@@ -523,12 +523,13 @@ module LibItsGeoNetworking_Templates {
                    }
                },
                reserved := c_uInt8Zero,
                flags := c_8ZeroBits,
                plLength := 0,
                flags := ?,
                plLength := PX_BEACON_PL, //0, TODO only for demonstrating the mismatch behaviour
                trafficClass := p_trafficClass,
                hopLimit := p_hopLimit,
                senderPosVector := p_senderLongPosVec
            }
            modulepar integer PX_BEACON_PL := 0; //TODO only for demonstrating the mismatch behaviour
          
            /**
             * @desc    Receive template for Common header with specific Hop limit
+10 −5
Original line number Diff line number Diff line
@@ -12,11 +12,16 @@ module LibItsGeoNetworking_TypesAndValues {
    import from LibCommon_DataStrings all;

    //LibIts
    import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet; type MacAddress}
    import from LibItsBtp_TypesAndValues {type BtpPacket}
    import from LibItsBtp_TypesAndValues {type BtpPacket;}
    import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;}
        
    group linkLayerConstants {

        /**
         * @desc Ethernet MAC address
         */
        type Oct6 MacAddress;
            	
    	const MacAddress c_llBroadcast := 'FFFFFFFFFFFF'O;
    	
    } // end linkLayerConstants
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ module LibItsIpv6OverGeoNetworking_Functions {
            var LongPosVector v_nodeLongPosVector := f_getPosition(p_compName);
            
            f_sendGeoNetMessage(
                m_geoNwReq(
                m_geoNwReq_linkLayerBroadcast(
                    m_geoNwPduWithPayload(
                        m_geoBroadcastHeader(
                            v_nodeLongPosVector,
Loading