LibItsDenm_Templates.ttcn 36.9 KB
Newer Older
ASN.1 Documenter's avatar
ASN.1 Documenter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
/**
 *    @author     ETSI / STF449 / STF484 / STF517
 *    @version    $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/DENM/LibItsDenm_Templates.ttcn $
 *                $Id: LibItsDenm_Templates.ttcn 1318 2017-01-26 10:20:53Z filatov $
 *    @desc       Module containing base template definitions for DENM
 *    @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 LibItsDenm_Templates {
    
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
     
    // LibIts
    import from ITS_Container language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    
    // LibItsCommon
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_Functions all;
    import from LibItsCommon_Pixits all;
    import from LibItsCommon_ASN1_NamedNumbers all;
    
    // LibItsDenm
    import from LibItsDenm_TypesAndValues all;
    
    group asn1Constants {
        
        const integer HeadingValue_wgs84North   := 0;
        const integer HeadingValue_wgs84East    := 900;
        const integer HeadingValue_wgs84South   := 1800;
        const integer HeadingValue_wgs84West    := 2700;
        const integer HeadingValue_unavailable  := 3600;
        
        const integer HeadingConfidence_withinZeroPointOneDegree    := 1;
        const integer HeadingConfidence_withinOneDegree             := 10;
        const integer HeadingConfidence_outOfRange                  := 126;
        const integer HeadingConfidence_unavailable                 := 127;
        
    } // End of group asn1Constants 
    
    group primitivesTemplates {
        
        /**
         * @desc    Send template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg    The DEN Message to be sent
         */
        template (value) DenmReq m_denmReq(
            template (value) DENM p_denMsg
        ) := {
            msgOut := p_denMsg
        }
        
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg    The expected DEN Message
         */
        template (present) DenmInd mw_denmInd(
            template (present) DENM p_denMsg
        ) := {
            msgIn               := p_denMsg,
            recvTime            := ?,
            gnNextHeader        := *,
            gnHeaderType        := *,
            gnHeaderSubtype     := *,
            gnLifetime          := *,
            gnTrafficClass      := *,
            btpDestinationPort  := *,
            btpInfo             := *,
            ssp                 := *,
            its_aid             := *
        }

        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg            The expected DEN Message
         * @param   p_gnNextHeader      GN next header value
         * @param   p_gnHeaderType      GN header type value
         * @param   p_gnHeaderSubtype   GN header subtype value
         * @param   p_gnLifetime        GN packet lifetime value (ms)
         * @param   p_gnTrafficClass    GN traffic class value
         */
        template(present) DenmInd mw_denmIndWithGnParameters (
            template (present) DENM p_denMsg,
            in template UInt8 p_gnNextHeader := *,
            in template UInt8 p_gnHeaderType := *,
            in template UInt8 p_gnHeaderSubtype := *,
            in template UInt32 p_gnLifetime := *,
            in template UInt8 p_gnTrafficClass := *
        ) modifies mw_denmInd := { 
            gnNextHeader := p_gnNextHeader,
            gnHeaderType := p_gnHeaderType,
            gnHeaderSubtype := p_gnHeaderSubtype,
            gnLifetime := p_gnLifetime,
            gnTrafficClass := p_gnTrafficClass    
        };
        
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg    The expected DEN Message
         * @param   p_ssp       SSP security parameter
         * @param   p_its_aid   ITS-AID value
         */
        template (present) DenmInd mw_denmIndWithSecurityParameters(
                                                          template (present) DENM p_denMsg,
                                                          template Bit256 p_ssp := *,
                                                          template UInt32 p_its_aid := c_its_aid_DENM
        ) modifies mw_denmInd := { 
            ssp             := p_ssp,
            its_aid         := p_its_aid
        };
        
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg                The expected DEN Message
         * @param   p_btpDestinationPort    BTP destination port value
         * @param   p_btpInfo               BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A)
         */
        template(present) DenmInd mw_denmIndWithBtpParameters (
            template (present) DENM p_denMsg,
            in template UInt16 p_btpDestinationPort := *,
            in template UInt16 p_btpInfo := *
        ) modifies mw_denmInd := { 
            btpDestinationPort := p_btpDestinationPort,
            btpInfo := p_btpInfo     
        };
        
        group utPrimitives {
            
            /**
             * @desc    Send template for Upper Tester event initialization
             */
            template (value) UtDenmInitialize m_denmInitialize := {
                hashedId8 := '0000000000000000'O
            }
            
            /**
             * @desc    Send template for Upper Tester event changePseudonym
             */
            template (value) UtDenmChangePseudonym m_utDenmChangePseudonym := {
            }
            
            /**
             * @desc    Send template for Upper Tester Trigger event
             * @param   p_situation                     The Situation Container
             * @param   p_location                      The Location Container
             * @param   p_validityDuration              The validity duration (Default: omit)
             * @param   p_repetitionDuration            The repetition duration (Default: omit)
             * @param   p_repetitionInterval            The repetition interval (Default: omit)
             * @param   p_transmissionInterval          The transmission interval (Default: omit)
             * @param   p_alacarte                      The Alacarte container (Default: omit)
             */
            template (value) UtDenmTrigger m_utTriggerEvent(
                template (value) SituationContainer p_situation,
                template (omit) ValidityDuration p_validityDuration := c_duration_2sec,
                template (omit) ValidityDuration p_repetitionDuration := omit,
                template (omit) TransmissionInterval p_repetitionInterval := omit,
                template (omit) TransmissionInterval p_transmissionInterval := omit,
                template (omit) AlacarteContainer p_alacarte := omit
            ) := {
                detectionTime := f_getCurrentTime(),
                validityDuration := p_validityDuration,
                repetitionDuration := p_repetitionDuration,
                situation := p_situation,
                relevanceDistance := lessThan50m,
                relevanceTrafficDirection := allTrafficDirections,
                transmissionInterval := p_transmissionInterval,
                repetitionInterval := p_repetitionInterval,
                alacarte := p_alacarte
            }
            
            /**
             * @desc Send template for Upper Tester event update
             * @param p_actionId                    The action id
             * @param p_situation                   The Situation Container (Default: omit)
             * @param p_location                    The Location Container (Default: omit)
             * @param p_validityDuration            The validity duration (Default: omit)
             * @param p_relevanceDistance           The relevance distance (Default: omit)
             * @param p_relevanceTrafficDirection   The relevance traffic direction (Default: omit)
             * @param p_trafficClass                The traffic class (Default: omit)
             * @param p_repetitionInterval            The repetition interval (Default: omit)
             * @param p_transmissionInterval        The transmission interval (Default: omit)
             * @param p_alacarte                    The Alacarte Container (Default: omit)
             */
            template (value) UtDenmUpdate m_utUpdateEvent(
                template (value) ActionID p_actionId,
                template (omit) SituationContainer p_situation := omit,
                template (omit) LocationContainer p_location := omit,
                template (omit) ValidityDuration p_validityDuration := omit,
                template (omit) RelevanceDistance p_relevanceDistance := omit,
                template (omit) RelevanceTrafficDirection p_relevanceTrafficDirection := omit,
                template (omit) ValidityDuration p_repetitionDuration := omit,
                template (omit) TransmissionInterval p_repetitionInterval := omit,
                template (omit) TransmissionInterval p_transmissionInterval := omit,
                template (omit) AlacarteContainer p_alacarte := omit
            ) := {
                actionId := p_actionId,
                detectionTime := f_getCurrentTime(),
                validityDuration := p_validityDuration,
                situation := p_situation,
                location := p_location,
                relevanceDistance := p_relevanceDistance,
                relevanceTrafficDirection := p_relevanceTrafficDirection,
                transmissionInterval := p_transmissionInterval,
                repetitionInterval := p_repetitionInterval,
                alacarte := p_alacarte
            }
            
            /**
             * @desc    Send template for Upper Tester event cancellation
             * @param   p_actionId  The action id
             */
            template (value) UtDenmTermination m_utEventCancellation(
                template (value) ActionID p_actionId
            ) := {
                actionId := p_actionId
            }
            
            /**
             * @desc Send template for Upper Tester event change position
             * @param p_latitude    The new latitude
             * @param p_longitude   The new longitude
             * @param p_elevation   The new elevation (Default: 0)
             */
            template (value) UtDenmChangePosition m_utDenmChangePosition(
                template (value) integer p_latitude,
                template (value) integer p_longitude,
                template (value) integer p_elevation := 0
            ) := {
                latitude := p_latitude,
                longitude := p_longitude,
                elevation := p_elevation
            }
            
        } // end utPrimitives
      
    } // end primitives
    
    group denmPduTemplates {
        
        /**
         * @desc    Send template for DENM PDU
         * @param   p_denm  The DEN Message
         */
        template (value) DENM m_denmPdu(
            template (value) DecentralizedEnvironmentalNotificationMessage p_denm
        ) := {
            header := m_itsPduHeader,
            denm := p_denm
        }
        
        /**
         * @desc    Default receive template for DENM PDU
         * @param   p_itsPduHeader  The expected ITS PDU header (Default: any)
         * @param   p_denm          The expected DEN Message (Default: any)
         */
        template DENM mw_anyDenmPdu(
            template (present) ItsPduHeader p_itsPduHeader := ?,
            template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ?
        ) := {
            header := p_itsPduHeader,
            denm := p_denm
        }
        
        /**
         * @desc    Receive template for DENM PDU
         * @param   p_denm              The expected DEN Message 
         * @param   p_stationID         The expected station id (Default: any)
         * @param   p_protocolVersion   The expected protocol version (Default: current DEN protocol version)
         * @param   p_messageID         The expected message id (Default: DEN message id)
         */
        template (present) DENM mw_denmPdu(
            template (present) DecentralizedEnvironmentalNotificationMessage p_denm,
            template (present) StationID p_stationID := ?,
            template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
            template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_
        ) := {
            header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID),
            denm := p_denm
        }
        
    } // end denmPduTemplates
    
    group headerTemplates {
        
        /**
         * @desc    Default send template for ITS PDU header
         * @param   p_stationID         The source station ID (Default: test system station id)
         * @param   p_protocolVersion   The protocol version (Default: current DEN protocol version)
         * @param   p_messageID         The message Id (Default: DEN message id)
         */
        template (value) ItsPduHeader m_itsPduHeader(
            template (value) StationID p_stationID := f_getTsStationId(),
            template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
            template (value) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_
        ) := {
            protocolVersion := p_protocolVersion,
            messageID := p_messageID,
            stationID := p_stationID
        }
        
        /**
         * @desc    Default receive template for ITS PDU header
         * @param   p_stationID         The expected station id (Default: any)
         * @param   p_protocolVersion   The expected protocol version (Default: current DEN protocol version)
         * @param   p_messageID         The expected message id (Default: DEN message id)
         */
        template (present) ItsPduHeader mw_itsPduHeader(
            template (present) StationID p_stationID := ?,
            template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
            template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_
        ) := {
            protocolVersion := p_protocolVersion,
            messageID := p_messageID,
            stationID := p_stationID
        }
        
        /**
         * @desc    Default receive template for the station id
         */
        template (present) StationID mw_anyStationId := ?;
        
    } // end headerTemplates
    
    group timeTemplates {
        
        /**
         * @desc    Receive template for TimestampIts check with delta
         * @param   p_time The expected timestamp
         */
        template TimestampIts mw_timestampIts_withDelta(
            in template (value) TimestampIts p_time
        )  := (valueof(p_time)-PX_TIME_DELTA .. valueof(p_time)+PX_TIME_DELTA);
        
    } // end timeTemplates
    
    group positionTemplates {
        
        /**
         * @desc    Send template for the test system position
         * @param   p_longitude The longitude (Default: Test system's longitude)
         * @param   p_latitude  The latitude (Default: Test system's latitude)
         * @see     m_posConfidenceEllipse
         * @see     m_elevation
         */
        template (value) ReferencePosition m_tsPosition(
            template (value) Longitude p_longitude := f_getTsLongitude(),
            template (value) Latitude p_latitude := f_getTsLatitude()
        ) := {
            latitude := p_latitude,
            longitude := p_longitude,
            positionConfidenceEllipse := m_posConfidenceEllipse,
            altitude := m_altitude
        }
        
        /**
         * @desc    Send template for the position confidence
         * @param   p_semiMajorConfidence   The major confidence (Default: 1cm)
         * @param   p_semiMinorConfidence   The minor confidence (Default: 1cm)
         * @param   p_semiMajorOrientation  The major orientation (Default: HeadingValue_wgs84North)
         */
        template (value) PosConfidenceEllipse m_posConfidenceEllipse(
            template (value) SemiAxisLength p_semiMajorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_,
            template (value) SemiAxisLength p_semiMinorConfidence := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_,
            template (value) HeadingValue p_semiMajorOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_
        ) := {
            semiMajorConfidence := p_semiMajorConfidence,
            semiMinorConfidence := p_semiMinorConfidence,
            semiMajorOrientation := p_semiMajorOrientation
        }
        
        /**
         * @desc    Send template for altitude
         * @param   p_altitudeValue        The altitude (Default: Sea level)
         * @param   p_altitudeConfidence   The confidence of the elevation (Default: within one meter)
         */
        template (value) Altitude m_altitude(
            template (value) AltitudeValue p_altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_,
            template (value) AltitudeConfidence p_altitudeConfidence := alt_000_01
        ) := {
            altitudeValue := p_altitudeValue,
            altitudeConfidence := p_altitudeConfidence
        }
        
    } // end positionTemplates
    
    group decentralizedEnvironmentalNotificationMessageTemplates {
        
        /**
         * @desc    Send template for DEN Message
         * @param   p_management    The Management Container
         * @param   p_situation     The Situation Container
         * @param   p_location      The Location Container
         * @param   p_alacarte      The Alacarte Container (Default: omit)
         */
        template (value) DecentralizedEnvironmentalNotificationMessage m_denm(
            template (value) ManagementContainer p_management,
            template (omit) SituationContainer p_situation,
            template (omit) LocationContainer p_location,
            template (omit) AlacarteContainer p_alacarte := omit
        ) := {
            management := p_management, 
            situation := p_situation, 
            location := p_location,
            alacarte := p_alacarte
        }
        
        /**
         * @desc    Default receive template for DEN Message
         */
        template (present) DecentralizedEnvironmentalNotificationMessage mw_anyDenm := {
            management := ?, 
            situation := *, 
            location := *,
            alacarte := *
        }
        
        /**
         * @desc    Receive template for DEN Message
         * @param   p_management    The expected Management Container (Default: any)
         * @param   p_situation     The expected Situation Container (Default: any or omit)
         * @param   p_location      The expected location Container (Default: any or omit)
         * @param   p_alacarte      The expected Alacarte Container (Default: any or omit)
         */
        template DecentralizedEnvironmentalNotificationMessage mw_denm(
            template (present) ManagementContainer p_management := ?,
            template SituationContainer p_situation := *,
            template LocationContainer p_location := *,
            template AlacarteContainer p_alacarte := *
        ) modifies mw_anyDenm := {
            management := p_management, 
            situation := p_situation, 
            location := p_location,
            alacarte := p_alacarte
        }
        
        /**
         * @desc    Send template for DEN Message for event termination.
         * @param   p_actionID  The action id
         */
        template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation(
            template (value) ActionID p_actionID,
            template (value) StationType p_stationType
        ) := {
            management := m_denmMgmtConTermination(p_actionID, p_stationType, 1, -, -, -, isCancellation), 
            situation := omit, 
            location := omit,
            alacarte := omit
        }
        
    } // end group decentralizedEnvironmentalNotificationMessageTemplates
    
    group decentralizedManagementTemplates {
        
        /**
         * @desc    Send template for Management Container
         * @param   p_actionID              The action id
         * @param   p_isNegation            The negation flag (Default: false)
         * @param   p_validityDuration      The validity duration (Default: omit)
         * @param   p_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_referenceTime         The reference time (Default: current time)
         */
        template (value) ManagementContainer m_denmMgmtCon(
            template (value) ActionID p_actionID,
            template (value) StationType p_stationType := f_getTsStationType(),
            template (value) ValidityDuration p_validityDuration := defaultValidity,
            template (omit) TransmissionInterval p_transmissionInterval := omit,
            template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
            template (value) TimestampIts p_referenceTime := f_getCurrentTime()
        ) := {
            actionID := p_actionID,
            detectionTime := p_detectionTime,
            referenceTime := p_referenceTime,
            termination := omit,
            eventPosition := m_tsPosition,
            relevanceDistance := lessThan50m,
            relevanceTrafficDirection := allTrafficDirections,
            validityDuration := p_validityDuration,
            transmissionInterval := p_transmissionInterval,
            stationType := p_stationType
        }
        
        /**
         * @desc    Send template for Management Container
         * @param   p_actionID              The action id
         * @param   p_isNegation            The negation flag (Default: false)
         * @param   p_isCancellation        The cancellation flag (Default: false)
         * @param   p_validityDuration      The validity duration (Default: omit)
         * @param   p_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_referenceTime         The reference time (Default: current time)
         */
        template (omit) ManagementContainer m_denmMgmtConTermination (
            template (value) ActionID p_actionID,
            template (value) StationType p_stationType := f_getTsStationType(),
            template (value) ValidityDuration p_validityDuration := defaultValidity,
            template (omit) TransmissionInterval p_transmissionInterval := omit,            
            template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
            template (value) TimestampIts p_referenceTime := f_getCurrentTime(),
            template (value) Termination p_termination
        ) modifies m_denmMgmtCon := {
            termination := p_termination
        }
        
        /**
         * @desc    Send template for Management Container
         * @param   p_actionID              The action id
         * @param   p_isNegation            The negation flag (Default: false)
         * @param   p_isCancellation        The cancellation flag (Default: false)
         * @param   p_validityDuration      The validity duration (Default: omit)
         * @param   p_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_referenceTime         The reference time (Default: current time)
         */
        template ManagementContainer mw_denmMgmtConTermination (
            template (present) ActionID p_actionID,
            template (present) StationType p_stationType := f_getIutStationType(),
            template (present) TimestampIts p_referenceTime := ?,
            template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
            template TransmissionInterval p_transmissionInterval := *,
            template Termination p_termination := *
        ) modifies mw_denmMgmtCon := {
            termination := p_termination
        }
        
        /**
         * @desc    Receive template for Management Container
         * @param   p_actionID              The expected action id
         * @param   p_referenceTime         The reference time (Default: any)
         * @param   p_isNegation            The expected negation flag (Default: false)
         * @param   p_validityDuration      The expected validity duration (Default: any or omit)
         * @param   p_transmissionInterval  The expected transmission interval (Default: any or omit)
         */
        template ManagementContainer mw_denmMgmtCon(
            template (present) ActionID p_actionID,
            template (present) StationType p_stationType := f_getIutStationType(),
            template (present) TimestampIts p_referenceTime := ?,
            template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
            template TransmissionInterval p_transmissionInterval := *,
            template Termination p_termination := *
        ) := {
            actionID := p_actionID,
            detectionTime := ?,
            referenceTime := p_referenceTime,
            termination    := p_termination,
            eventPosition := ?,
            relevanceDistance := *,//?,
            relevanceTrafficDirection := *,//?,
            validityDuration := p_validityDuration,
            transmissionInterval := p_transmissionInterval,
            stationType    := p_stationType
        }
        
        /**
         * @desc    Send template for Test system ActionID
         * @param   p_sequenceNumber    The sequence number (Default: 0)
         */
        template (value) ActionID m_tsActionId(
            template (value) SequenceNumber p_sequenceNumber := 0
        ) := {
            originatingStationID := f_getTsStationId(),
            sequenceNumber := p_sequenceNumber
        }
        
        /**
         * @desc    Default receive template for Management Container
         */
        template (present) ManagementContainer mw_anyDenmMgmtCon := {
            actionID := ?,
            detectionTime := ?,
            referenceTime := ?,
            termination    := *,
            eventPosition := ?,
            relevanceDistance := *,
            relevanceTrafficDirection := *,
            validityDuration := ?,
            transmissionInterval := *,
            stationType    := ?
        }
        
        /**
         * @desc    Receive template for Management Container with the given action id
         * @param   p_actionId  The expected action id (Default: any)
         */
        template (present) ManagementContainer mw_denmMgmtConWithActionID(
            template (present) ActionID p_actionId := ?
        ) modifies mw_anyDenmMgmtCon := {
            actionID := p_actionId
        }
        
        /**
         * @desc    Receive template for Management Container with the given data version
         * @param   p_referenceTime   The expected reference time (Default: any)
         */
        template (present) ManagementContainer mw_denmMgmtConWithReferenceTime(
            template (present) TimestampIts p_referenceTime := ?
        ) modifies mw_anyDenmMgmtCon := {
            referenceTime := p_referenceTime
        }
        
        /**
         * @desc    Send template for ActionID
         * @param   p_sequenceNumber        The sequence number
         * @param   p_originatorStationID   The originator station id (Default: IUT's station id)
         */
        template (value) ActionID m_actionId(
            template (value) SequenceNumber p_sequenceNumber,
            template (value) ITS_Container.StationID p_originatorStationID := f_getIutStationId()
        ) := {
            originatingStationID := p_originatorStationID,
            sequenceNumber := p_sequenceNumber
        }
        
        /**
         * @desc    Receive template for ActionID
         * @param   p_originatorStationID   The expected originator station id (Default: any)
         * @param   p_sequenceNumber        The expected sequence number (Default: any)
         */
        template (present) ActionID mw_actionId(
            template (present) ITS_Container.StationID p_originatorStationID := ?,
            template (present) SequenceNumber p_sequenceNumber := ?
        ) := {
            originatingStationID := p_originatorStationID,
            sequenceNumber := p_sequenceNumber
        }
        
        /**
         * @desc    Default receive template for any ActionID
         */
        template (present) ActionID mw_anyActionId := ?;
        
    } // end group decentralizedManagementTemplates
    
    group decentralizedSituationTemplates {
        
        group situationTemplates {
            
            /**
             * @desc    Send template for Situation Container
             * @param   p_cause                 The cause code
             * @param   p_subCause              The sub-cause code
             * @param   p_informationQuality    The information quality (Default: 0)
             */
            template (value) SituationContainer m_situation(
                template (value) CauseCodeType p_cause, 
                template (value) SubCauseCodeType p_subCause,
                template (value) InformationQuality p_informationQuality := 0
            ) := {
                informationQuality := p_informationQuality,
                eventType := {
                    causeCode := p_cause,
                    subCauseCode := p_subCause
                },
                linkedCause := omit,
                eventHistory := omit
            }
            
            /**
             * @desc    Receive template for Situation Container
             * @param   p_cause                 The expected cause code
             * @param   p_subCause              The expected sub-cause code
             * @param   p_informationQuality    The expected information quality (Default: any)
             */
            template (present) SituationContainer mw_situation(
                template (present) CauseCodeType p_cause, 
                template (present) SubCauseCodeType p_subCause,
                template (present) InformationQuality p_informationQuality := ?
            ) := {
                informationQuality := p_informationQuality,
                eventType := {
                    causeCode := p_cause,
                    subCauseCode := p_subCause
                },
                linkedCause := *,
                eventHistory := *
            }
            
            /**
             * @desc    Default receive template for Situation Container
             */
            template (present) SituationContainer mw_anySitutation := ?;
            
        } // end group situationTemplates
        
    } // end group decentralizedSituationTemplates
    
    group decentralizedLocationTemplates {
        
        /**
         * @desc    Send template for Location Container where no delta is given
         */
        template (value) LocationContainer m_denmLocation_zeroDelta := {
            eventSpeed := omit,
            eventPositionHeading := omit,
            traces := {
                {
                    {
                        pathPosition := {
                            deltaLatitude := 0,
                            deltaLongitude := 0,
                            deltaAltitude := 0
                        },
                        pathDeltaTime := 1
                    }
                }
            },
            roadType := omit 
        }
        
        /**
         * @desc    Default receive template for Location Container
         */
        template (present) LocationContainer mw_anyDenmLocation := {
            eventSpeed := *,
            eventPositionHeading := *,
            traces := ?,
            roadType := *
        }
        
        /**
         * @desc    Receive template for Location Container with the given traces
         * @param   p_traces    The expected traces.
         */
        template (present) LocationContainer mw_denmLocationWithTrace(
            template (present) Traces p_traces
        ) := {
            eventSpeed := *,
            eventPositionHeading := *,
            traces := p_traces,
            roadType := *
        }
        
    } // end group decentralizedLocationTemplates
    
    group alacarteTemplates {
        
        /**
         * @desc    Send template for Alacarte Container including lanePosition
         */
        template (value) AlacarteContainer m_alacarteConLaneCount := {
            lanePosition := 0,
            impactReduction := omit,
            externalTemperature := omit,
            roadWorks := omit,
            positioningSolution := omit,
            stationaryVehicle := omit
        }
         
        /**
         * @desc    Send template for Alacarte Container including impactReduction
         */
        template (value) AlacarteContainer m_alacarteConImpactReduction := {
            lanePosition := omit,
            impactReduction := m_impactReduction,
            externalTemperature := omit,
            roadWorks := omit,
            positioningSolution := omit,
            stationaryVehicle := omit
        }
        
        /**
         * @desc    Send template for ImpactReduction Container
         */
        template (value) ImpactReductionContainer m_impactReduction := {
            heightLonCarrLeft            := 100,
            heightLonCarrRight            := 100,
            posLonCarrLeft                := 127,
            posLonCarrRight             := 127,
            positionOfPillars             := { 30 },
            posCentMass                    := 63,
            wheelBaseVehicle            := 127,
            turningRadius                := 255,
            posFrontAx                    := 20,
            positionOfOccupants            := '00000000000000000000'B,
            vehicleMass                    := 1024,
            requestResponseIndication    := request
        }
         
        /**
         * @desc    Receive template for Alacarte Container including impactReduction
         */
        template (present) AlacarteContainer mw_alacarteConImpactReduction := {
            lanePosition := *,
            impactReduction := mw_impactReduction,
            externalTemperature := *,
            roadWorks := *,
            positioningSolution := *,
            stationaryVehicle := *
        }
        
        /**
         * @desc    Receive template for ImpactReductio nContainer
         */
        template (present) ImpactReductionContainer mw_impactReduction := {
            heightLonCarrLeft            := ?,
            heightLonCarrRight            := ?,
            posLonCarrLeft                := ?,
            posLonCarrRight             := ?,
            positionOfPillars             := ?,
            posCentMass                    := ?,
            wheelBaseVehicle            := ?,
            turningRadius                := ?,
            posFrontAx                    := ?,
            positionOfOccupants            := ?,
            vehicleMass                    := ?,
            requestResponseIndication    := response
        }
        
    } // end alacarteTemplates
    
    group sspTemplates {
        
        template (present) bitstring mw_sspNoTrafficCondition        := '*0'B;
        template (present) bitstring mw_sspNoAccident                := '*0?'B;
        template (present) bitstring mw_sspNoRoadworks               := '*0??'B;
    } // end sspTemplates
    
} // end LibItsDenmTemplates