Commit ca12229b authored by berge's avatar berge
Browse files

Cleanup in GeoNetworking code

parent bcd3da15
Loading
Loading
Loading
Loading
+100 −5
Original line number Diff line number Diff line
@@ -7,11 +7,14 @@
 */
module LibItsGeoNetworking_Functions {
    
    // Libcommon
    import from LibCommon_BasicTypesAndValues all;
    
    // LibIts
    import from LibIts_TestSystem all;
    import from LibIts_Interface all; 
    import from LibItsGeoNetworking_TypesAndValues all;
    
    import from LibItsGeoNetworking_Templates all;
	    
    /**
     * @desc 	Create Facility component and connects GeoNetworking port
@@ -49,7 +52,7 @@ module LibItsGeoNetworking_Functions {
        
    } // end f_ptcGeoNetworkingDown
    
    group altsteps {
    group geoAltsteps {
        
       	/**
         * @desc The base default.
@@ -71,8 +74,100 @@ module LibItsGeoNetworking_Functions {
                stop;
            }
        }        
        
        group geoGeoUnicastAltsteps {
            
            /**
             * @desc Receive GeoUnicast packet
             */
        	altstep a_receiveGeoUnicast(
        	   	in template (present) LongPosVector p_senderLongPosVec,
    	    	in template (present) ShortPosVector p_destinationLongPosVec,
    			in template (present) StationTypeIdentifier p_stationType,
    	    	in template (present) UInt16 p_seqNumber
        	) runs on ItsNt {
        	    
        	    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoUnicastHeader(
        	    	p_senderLongPosVec,
    	    		p_destinationLongPosVec,
    				p_stationType,
    	    		p_seqNumber)))) {}
        	}     
        	
        	/**
             * @desc Receive GeoUnicast packet for specific destination
             */
        	altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationLongPosVec) runs on ItsNt {
        	    
        	    [] a_receiveGeoUnicast(?, p_destinationLongPosVec, ?, ?) {}
        	}     
            
            /**
             * @desc Receive any GeoUnicast packet
             */
        	altstep a_receiveAnyGeoUnicast() runs on ItsNt {
        	    
        	    [] a_receiveGeoUnicast(?, ?, ?, ?) {}
        	}  
            
        } // end geoGeoUnicastAltsteps
        
        group geoLocationServiceAltsteps {

            /**
             * @desc Receive Location Service Request
             */
            altstep a_receiveLsRequest(
             	in template (present) StationTypeIdentifier p_stationType,
    			in template (present) UInt16 p_seqNumber,
            	in template (present) GN_Address p_gnAddress
            ) runs on ItsNt {
                 
                [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(
                   	mw_lsRequestHeader(
     					p_stationType,
    					p_seqNumber,
            			p_gnAddress)))) {}
            }
            
            /**
             * @desc Receive any Location Service Request
             */
            altstep a_receiveAnyLsRequest() runs on ItsNt {
                 
                [] a_receiveLsRequest(?, ?, ?) {}
            }
            
            /**
             * @desc Receive Location Service Request and send Location Service Reply  
             */
            altstep a_receiveLsRequestAndReply(
            	in template (present) StationTypeIdentifier p_reqStationType,
    			in template (present) UInt16 p_reqSeqNumber,
            	in template (value) GN_Address p_gnAddress,
            	in template (value)	LongPosVector p_repSrcPosVector,
            	in template (value)	LongPosVector p_repSenderPosVector,
            	in template (value) StationTypeIdentifier p_repStationType,
            	in template (value)	UInt16 p_repSeqNumber
            ) runs on ItsNt {
                
                [] a_receiveLsRequest(p_reqStationType, p_reqSeqNumber, p_gnAddress) {
                    geoNetworkingPort.send(m_geoNwReq(m_geoNwPdu(
                    	m_lsRequestHeader(
                    	p_repSrcPosVector,
                    	p_repSenderPosVector,
            			p_repStationType,
            			p_repSeqNumber,
                    	p_gnAddress      
                    )))) 
                }
            }
          
        } // end geoLocationServiceAltsteps
        
        
    } // end geoAltsteps
    
    group preambles {
        
        /**