LibItsGeoNetworking_Templates.ttcn 102 KB
Newer Older
berge's avatar
berge committed
            ) := {
                lsRequestHeader := {
tepelmann's avatar
tepelmann committed
                    seqNumber       := p_seqNumber,
                    reserved        := c_uInt8Zero,
                    srcPosVector    := p_sourceLongPosVec,
                    gnAddress       := p_gnAddress
            /**
             * @desc    Receive template for LS Request header
             * @param   p_seqNumber     Sequence number of LS Request packet
berge's avatar
berge committed
             * @param   p_mid           Searched GN_Address MID
berge's avatar
berge committed
             */
YannGarcia's avatar
YannGarcia committed
            template (present) ExtendedHeader mw_lsRequestHeader(
garciay's avatar
garciay committed
                template (present) UInt16 p_seqNumber := ?,
                template (present) GN_Address.mid p_mid := ?
berge's avatar
berge committed
            ) := {
                lsRequestHeader := {
                    seqNumber := p_seqNumber,
berge's avatar
berge committed
                    reserved := ?,
                    srcPosVector := ?,
            /**
             * @desc    Send template for LS Request header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) HeaderTST m_lsRequestHeaderType := {
                lsHdr := {
berge's avatar
berge committed
                    headerType := e_locationService,
                    headerSubType := e_lsRequest
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
            /**
             * @desc    Receive template for LS Request header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template HeaderTST mw_lsRequestHeaderType := {
                lsHdr := {
berge's avatar
berge committed
                    headerType := e_locationService,
                    headerSubType := e_lsRequest
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        } // end lsRequestHeaderTemplates
            /**
             * @desc    Send template for LS Reply header
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_destinationLongPosVec Long position vector of destination
             * @param   p_seqNumber             Sequence number of LS Reply packet
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_lsReplyHeader(
              in template (value) LongPosVector p_sourceLongPosVec,
              in template (value) ShortPosVector p_destinationLongPosVec,
              in template (value) UInt16 p_seqNumber
            ) := {
                lsReplyHeader := {
                  seqNumber := p_seqNumber,
                  reserved := c_uInt8Zero,
                  srcPosVector := p_sourceLongPosVec,
                  dstPosVector := p_destinationLongPosVec
                }
            }
            
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for any LS Reply header
berge's avatar
berge committed
             */
YannGarcia's avatar
YannGarcia committed
            template (present) ExtendedHeader mw_lsReplyHeaderAny := {
                reserved := ?,
                srcPosVector := ?,
                dstPosVector := ?
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for LS Reply header
             * @param   p_sourceLongPosVec      Long position vector of source
             * @param   p_destinationLongPosVec Short position vector of destination
tepelmann's avatar
tepelmann committed
             * @see     mw_lsReplyHeaderAny
berge's avatar
berge committed
             */
YannGarcia's avatar
YannGarcia committed
            template (present) ExtendedHeader mw_lsReplyHeader(
                                                               template (present) LongPosVector p_sourceLongPosVec := ?,
                                                               template (present) ShortPosVector p_destinationLongPosVec := ?
            ) modifies mw_lsReplyHeaderAny := {
                lsReplyHeader := {
                    srcPosVector := p_sourceLongPosVec,
                    dstPosVector := p_destinationLongPosVec
                }
berge's avatar
berge committed
            }
            /**
             * @desc    Send template for LS Reply header type
berge's avatar
berge committed
             */
            template (value) HeaderTST m_lsReplyHeaderType := {
                lsHdr := {
                  headerType := e_locationService,
                  headerSubType := e_lsReply
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        } // end lsRequestHeaderTemplates
berge's avatar
berge committed
        group beaconHeaderTemplates {
            
            /**
             * @desc    Send template for Beacon header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_beaconHeader(
                in template (value) LongPosVector p_sourceLongPosVec
berge's avatar
berge committed
            ) := {
                beaconHeader := {
tepelmann's avatar
tepelmann committed
                    srcPosVector := p_sourceLongPosVec
            /**
             * @desc    Receive template for Beacon header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of source
berge's avatar
berge committed
             */
YannGarcia's avatar
YannGarcia committed
            template (present) ExtendedHeader mw_beaconHeader(
                                                              template (present) LongPosVector p_sourceLongPosVec := ?
berge's avatar
berge committed
            ) := {
                beaconHeader := {
tepelmann's avatar
tepelmann committed
                    srcPosVector := p_sourceLongPosVec
            /**
             * @desc    Send template for Beacon header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template (value) HeaderTST m_beaconHeaderType := {
                beaconHdr := {
berge's avatar
berge committed
                    headerType := e_beacon,
fischer's avatar
fischer committed
                    headerSubType := c_uInt4Zero
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
            /**
             * @desc    Receive template for Beacon header type
berge's avatar
berge committed
             */
berge's avatar
berge committed
            template HeaderTST mw_beaconHeaderType := {
                beaconHdr := {
berge's avatar
berge committed
                    headerType := e_beacon,
fischer's avatar
fischer committed
                    headerSubType := ?
berge's avatar
berge committed
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        } // end beaconHeaderTemplates
        
berge's avatar
berge committed
             * @desc    Send template for SHB header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of sender
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) ExtendedHeader m_shbHeader(
                in template (value) LongPosVector p_sourceLongPosVec
tepelmann's avatar
tepelmann committed
                    srcPosVector := p_sourceLongPosVec,
                    reserved := 0
            /**
             * @desc    Receive template for SHB header
tepelmann's avatar
tepelmann committed
             * @param   p_sourceLongPosVec  Long position vector of sender
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (present) ExtendedHeader mw_shbHeader(
garciay's avatar
garciay committed
                template (present) LongPosVector p_sourceLongPosVec
tepelmann's avatar
tepelmann committed
            ) := {
tepelmann's avatar
tepelmann committed
                    srcPosVector:= p_sourceLongPosVec,
                    reserved := ?
            /**
             * @desc    Send template for SHB header type
berge's avatar
berge committed
             */
            template (value) HeaderTST m_shbHeaderType := {
                tsbHdr := {
                  headerType := e_topologicallyScopedBroadcast,
                  headerSubType := e_singleHop
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
        group tsbHeaderTemplates {
            
            /**
             * @desc    Send template for TSB header
             * @param   p_seqNumber         Sequence number of TSB packet
             * @param   p_srcPosVector      Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template ExtendedHeader m_tsbHeader(
tepelmann's avatar
tepelmann committed
                in template (value) UInt16 p_seqNumber,
                in template (value) LongPosVector p_srcPosVector
            ) := {
                tsbHeader := {
                    seqNumber := p_seqNumber,
                    reserved := c_uInt8Zero,
                    srcPosVector := p_srcPosVector
                }
            }
            
            /**
             * @desc    Receive template for TSB header
             * @param   p_seqNumber         Sequence number of TSB packet
             * @param   p_sourceLongPosVec  Long position vector of source
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (present) ExtendedHeader mw_tsbHeader(
garciay's avatar
garciay committed
                template (present) UInt16 p_seqNumber,
                template (present) LongPosVector p_sourceLongPosVec
tepelmann's avatar
tepelmann committed
            ) := {
                tsbHeader := {
                    seqNumber := p_seqNumber,
                    reserved := ?,
fischer's avatar
fischer committed
                    srcPosVector := p_sourceLongPosVec
                }
            }
            
tepelmann's avatar
tepelmann committed
             * @desc    Send template for TSB header type
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (value) HeaderTST m_tsbHeaderType := {
                tsbHdr := {
                  headerType := e_topologicallyScopedBroadcast,
                  headerSubType := e_multiHop
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for TSB header type
berge's avatar
berge committed
             */
tepelmann's avatar
tepelmann committed
            template (present) HeaderTST mw_tsbHeaderType := {
tepelmann's avatar
tepelmann committed
                tsbHdr := {
                  headerType := e_topologicallyScopedBroadcast,
                  headerSubType := e_multiHop
                }
tepelmann's avatar
tepelmann committed
            }
tepelmann's avatar
tepelmann committed
            
        } // end tsbHeaderTemplates
        
    } // end geoNwHeadersTemplates
berge's avatar
berge committed
    
berge's avatar
berge committed
    group geoMiscTemplates {
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for GN_Address. Only M_ID field is discriminent
         * @param   p_mid Expected GN Address MID
YannGarcia's avatar
YannGarcia committed
        template (present) GN_Address mw_gnAddressMid(
                                                      template (present) GN_Address.mid p_mid := ?
        ) := {
            typeOfAddress := ?,
            stationType := ?,
            reserved := ?,
            mid := p_mid
        }
berge's avatar
berge committed
        group geoDummyTemplates {
            
tepelmann's avatar
tepelmann committed
             * @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,
                reserved := 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,
                latitude := c_uInt32Zero,
berge's avatar
berge committed
                longitude := c_uInt32Zero,
wattelet's avatar
wattelet committed
                pai := int2bit(1,1),
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
    
garciay's avatar
garciay committed
} // end ItsGeoNetworking_Templates