LibItsDenm_Templates.ttcn 36.2 KB
Newer Older
1
/**
2
3
4
5
 *    @author     ETSI / STF449
 *  @version     $URL$
 *                $Id$
 *    @desc        Module containing base template definitions for DENM
6
7
 *
 */
berge's avatar
berge committed
8
module LibItsDenm_Templates {
9
    
10
11
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
12
    import from LibCommon_DataStrings all;
13
     
14
15
16
17
18
    // LibIts
    import from ITS_Container language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    
    // LibItsCommon
tepelmann's avatar
tepelmann committed
19
    import from LibItsCommon_TypesAndValues all;
20
    import from LibItsCommon_Functions all;
21
    import from LibItsCommon_Pixits all;
22
23
    
    // LibItsDenm
reinaortega's avatar
reinaortega committed
24
25
    import from LibItsDenm_TestSystem all;
    import from LibItsDenm_TypesAndValues all;
tepelmann's avatar
tepelmann committed
26
    
garciay's avatar
garciay committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    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 
    
berge's avatar
berge committed
42
    group primitivesTemplates {
43
        
berge's avatar
berge committed
44
45
        /**
         * @desc    Send template for DEN Message (DenmPort Primitive)
tepelmann's avatar
tepelmann committed
46
         * @param   p_denMsg    The DEN Message to be sent
47
48
         */
        template (value) DenmReq m_denmReq(
tepelmann's avatar
tepelmann committed
49
            template (value) DENM p_denMsg
tepelmann's avatar
tepelmann committed
50
        ) := {
tepelmann's avatar
tepelmann committed
51
52
53
            msgOut := p_denMsg
        }
        
berge's avatar
berge committed
54
55
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
tepelmann's avatar
tepelmann committed
56
         * @param   p_denMsg    The expected DEN Message
57
         */
tepelmann's avatar
tepelmann committed
58
        template (present) DenmInd mw_denmInd(
tepelmann's avatar
tepelmann committed
59
            template (present) DENM p_denMsg
tepelmann's avatar
tepelmann committed
60
        ) := {
61
62
63
64
65
66
67
68
69
70
            msgIn               := p_denMsg,
            gnNextHeader        := *,
            gnHeaderType        := *,
            gnHeaderSubtype     := *,
            gnLifetime          := *,
            gnTrafficClass      := *,
            btpDestinationPort  := *,
            btpInfo             := *,
            ssp                 := *,
            its_aid             := *
tepelmann's avatar
tepelmann committed
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

        /**
         * @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 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    
        };
        
97
98
99
100
101
102
103
104
        /**
         * @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 DenmInd mw_denmIndWithSecurityParameters(
                                                          template (present) DENM p_denMsg,
105
                                                          template Bit256 p_ssp := *,
106
                                                          template UInt32 p_its_aid := c_its_aid_DENM
107
108
109
110
111
        ) modifies mw_denmInd := { 
            ssp             := p_ssp,
            its_aid         := p_its_aid
        };
        
112
113
114
115
116
117
118
119
        /**
         * @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 DenmInd mw_denmIndWithBtpParameters (
            template (present) DENM p_denMsg,
garciay's avatar
garciay committed
120
121
            in template UInt16 p_btpDestinationPort := *,
            in template UInt16 p_btpInfo := *
122
123
124
125
        ) modifies mw_denmInd := { 
            btpDestinationPort := p_btpDestinationPort,
            btpInfo := p_btpInfo     
        };
tepelmann's avatar
tepelmann committed
126
        
127
128
        group utPrimitives {
            
129
            /**
tepelmann's avatar
tepelmann committed
130
             * @desc    Send template for Upper Tester event initialization
131
132
             */
            template (value) UtInitialize m_denmInitialize := {
garciay's avatar
garciay committed
133
                hashedId8 := '0000000000000000'O
134
135
            }
            
136
137
138
139
140
141
            /**
             * @desc    Send template for Upper Tester event changePseudonym
             */
            template (value) UtChangePseudonym m_utChangePseudonym := {
            }
            
berge's avatar
berge committed
142
            /**
143
             * @desc    Send template for Upper Tester Trigger event
garciay's avatar
garciay committed
144
145
146
147
             * @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)
148
             * @param   p_repetitionInterval            The repetition interval (Default: omit)
149
             * @param   p_transmissionInterval          The transmission interval (Default: omit)
garciay's avatar
garciay committed
150
             * @param   p_alacarte                      The Alacarte container (Default: omit)
151
             */
152
            template (value) UtDenmTrigger m_utTriggerEvent(
tepelmann's avatar
tepelmann committed
153
                template (value) SituationContainer p_situation,
154
                template (omit) ValidityDuration p_validityDuration := c_duration_2sec,
155
                template (omit) ValidityDuration p_repetitionDuration := omit,
156
                template (omit) TransmissionInterval p_repetitionInterval := omit,
tepelmann's avatar
tepelmann committed
157
158
159
160
                template (omit) TransmissionInterval p_transmissionInterval := omit,
                template (omit) AlacarteContainer p_alacarte := omit
            ) := {
                detectionTime := f_getCurrentTime(),
161
                validityDuration := p_validityDuration,
tepelmann's avatar
tepelmann committed
162
                repetitionDuration := p_repetitionDuration,
163
                situation := p_situation,
tepelmann's avatar
tepelmann committed
164
                relevanceDistance := lessThan50m,
165
                relevanceTrafficDirection := allTrafficDirections,
tepelmann's avatar
tepelmann committed
166
                transmissionInterval := p_transmissionInterval,
167
168
                repetitionInterval := p_repetitionInterval,
                alacarte := p_alacarte
169
170
            }
            
garciay's avatar
garciay committed
171
172
173
174
175
176
177
178
179
            /**
             * @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)
180
             * @param p_repetitionInterval            The repetition interval (Default: omit)
garciay's avatar
garciay committed
181
182
             * @param p_transmissionInterval        The transmission interval (Default: omit)
             * @param p_alacarte                    The Alacarte Container (Default: omit)
tepelmann's avatar
tepelmann committed
183
             */
184
            template (value) UtDenmUpdate m_utUpdateEvent(
tepelmann's avatar
tepelmann committed
185
186
187
188
189
190
                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,
191
                template (omit) ValidityDuration p_repetitionDuration := omit,
192
                template (omit) TransmissionInterval p_repetitionInterval := omit,
tepelmann's avatar
tepelmann committed
193
194
195
196
197
198
199
200
201
202
203
                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,
204
205
                repetitionInterval := p_repetitionInterval,
                alacarte := p_alacarte
tepelmann's avatar
tepelmann committed
206
207
            }
            
berge's avatar
berge committed
208
209
            /**
             * @desc    Send template for Upper Tester event cancellation
tepelmann's avatar
tepelmann committed
210
             * @param   p_actionId  The action id
211
             */
212
            template (value) UtDenmTermination m_utEventCancellation(
tepelmann's avatar
tepelmann committed
213
                template (value) ActionID p_actionId
tepelmann's avatar
tepelmann committed
214
215
            ) := {
                actionId := p_actionId
216
217
            }
            
garciay's avatar
garciay committed
218
219
220
221
222
            /**
             * @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)
tepelmann's avatar
tepelmann committed
223
             */
berge's avatar
berge committed
224
            template (value) UtChangePosition m_utChangePosition(
tepelmann's avatar
tepelmann committed
225
226
227
228
229
230
231
232
                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
            }
berge's avatar
berge committed
233
            
234
235
        } // end utPrimitives
      
tepelmann's avatar
tepelmann committed
236
237
    } // end primitives
    
berge's avatar
berge committed
238
239
    group denmPduTemplates {
        
berge's avatar
berge committed
240
        /**
tepelmann's avatar
tepelmann committed
241
         * @desc    Send template for DENM PDU
tepelmann's avatar
tepelmann committed
242
         * @param   p_denm  The DEN Message
243
         */
tepelmann's avatar
tepelmann committed
244
        template (value) DENM m_denmPdu(
tepelmann's avatar
tepelmann committed
245
            template (value) DecentralizedEnvironmentalNotificationMessage p_denm
tepelmann's avatar
tepelmann committed
246
247
248
        ) := {
            header := m_itsPduHeader,
            denm := p_denm
berge's avatar
berge committed
249
250
        }
        
251
        /**
tepelmann's avatar
tepelmann committed
252
253
         * @desc    Default receive template for DENM PDU
         * @param   p_itsPduHeader  The expected ITS PDU header (Default: any)
garciay's avatar
garciay committed
254
         * @param   p_denm          The expected DEN Message (Default: any)
255
256
         */
        template DENM mw_anyDenmPdu(
tepelmann's avatar
tepelmann committed
257
258
            template (present) ItsPduHeader p_itsPduHeader := ?,
            template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ?
259
260
261
262
263
        ) := {
            header := p_itsPduHeader,
            denm := p_denm
        }
        
berge's avatar
berge committed
264
        /**
tepelmann's avatar
tepelmann committed
265
         * @desc    Receive template for DENM PDU
tepelmann's avatar
tepelmann committed
266
         * @param   p_denm              The expected DEN Message 
garciay's avatar
garciay committed
267
268
269
         * @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)
270
         */
tepelmann's avatar
tepelmann committed
271
272
        template (present) DENM mw_denmPdu(
            template (present) DecentralizedEnvironmentalNotificationMessage p_denm,
tepelmann's avatar
tepelmann committed
273
            template (present) StationID p_stationID := ?,
274
275
            template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
            template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_
tepelmann's avatar
tepelmann committed
276
277
278
        ) := {
            header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID),
            denm := p_denm
berge's avatar
berge committed
279
        }
tepelmann's avatar
tepelmann committed
280
281
282
283
284
        
    } // end denmPduTemplates
    
    group headerTemplates {
        
berge's avatar
berge committed
285
        /**
tepelmann's avatar
tepelmann committed
286
         * @desc    Default send template for ITS PDU header
tepelmann's avatar
tepelmann committed
287
288
289
         * @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)
290
         */
tepelmann's avatar
tepelmann committed
291
292
        template (value) ItsPduHeader m_itsPduHeader(
            template (value) StationID p_stationID := f_getTsStationId(),
293
294
            template (value) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
            template (value) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_
295
        ) := {
tepelmann's avatar
tepelmann committed
296
297
298
            protocolVersion := p_protocolVersion,
            messageID := p_messageID,
            stationID := p_stationID
berge's avatar
berge committed
299
        }
tepelmann's avatar
tepelmann committed
300
        
berge's avatar
berge committed
301
        /**
tepelmann's avatar
tepelmann committed
302
         * @desc    Default receive template for ITS PDU header
garciay's avatar
garciay committed
303
304
305
         * @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)
306
         */
tepelmann's avatar
tepelmann committed
307
308
        template ItsPduHeader mw_itsPduHeader(
            template (present) StationID p_stationID := ?,
309
310
            template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
            template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_
311
        ) := {
tepelmann's avatar
tepelmann committed
312
313
314
315
316
            protocolVersion := p_protocolVersion,
            messageID := p_messageID,
            stationID := p_stationID
        }
        
garciay's avatar
garciay committed
317
318
        /**
         * @desc    Default receive template for the station id
tepelmann's avatar
tepelmann committed
319
         */
berge's avatar
berge committed
320
        template (present) StationID mw_anyStationId := ?;
berge's avatar
berge committed
321
        
tepelmann's avatar
tepelmann committed
322
323
    } // end headerTemplates
    
324
325
326
327
328
329
330
331
    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
garciay's avatar
garciay committed
332
        )  := (valueof(p_time)-PX_TIME_DELTA .. valueof(p_time)+PX_TIME_DELTA);
333
334
335
        
    } // end timeTemplates
    
336
    group positionTemplates {
tepelmann's avatar
tepelmann committed
337
        
garciay's avatar
garciay committed
338
339
340
        /**
         * @desc    Send template for the test system position
         * @param   p_longitude The longitude (Default: Test system's longitude)
tepelmann's avatar
tepelmann committed
341
342
         * @param   p_latitude  The latitude (Default: Test system's latitude)
         * @see     m_posConfidenceEllipse
garciay's avatar
garciay committed
343
         * @see     m_elevation
tepelmann's avatar
tepelmann committed
344
         */
tepelmann's avatar
tepelmann committed
345
346
347
348
349
350
351
        template (value) ReferencePosition m_tsPosition(
            template (value) Longitude p_longitude := f_getTsLongitude(),
            template (value) Latitude p_latitude := f_getTsLatitude()
        ) := {
            longitude := p_longitude,
            latitude := p_latitude,
            positionConfidenceEllipse := m_posConfidenceEllipse,
berge's avatar
berge committed
352
            altitude := m_altitude
tepelmann's avatar
tepelmann committed
353
354
        }
        
garciay's avatar
garciay committed
355
356
357
358
        /**
         * @desc    Send template for the position confidence
         * @param   p_semiMajorConfidence   The major confidence (Default: 1cm)
         * @param   p_semiMinorConfidence   The minor confidence (Default: 1cm)
359
         * @param   p_semiMajorOrientation  The major orientation (Default: HeadingValue_wgs84North)
tepelmann's avatar
tepelmann committed
360
         */
tepelmann's avatar
tepelmann committed
361
        template (value) PosConfidenceEllipse m_posConfidenceEllipse(
362
363
            template (value) SemiAxisLength p_semiMajorConfidence := SemiAxisLength_oneCentimeter_,
            template (value) SemiAxisLength p_semiMinorConfidence := SemiAxisLength_oneCentimeter_,
364
            template (value) HeadingValue p_semiMajorOrientation := HeadingValue_wgs84North
tepelmann's avatar
tepelmann committed
365
366
367
368
369
370
        ) := {
            semiMajorConfidence := p_semiMajorConfidence,
            semiMinorConfidence := p_semiMinorConfidence,
            semiMajorOrientation := p_semiMajorOrientation
        }
        
garciay's avatar
garciay committed
371
372
373
374
        /**
         * @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)
tepelmann's avatar
tepelmann committed
375
         */
berge's avatar
berge committed
376
        template (value) Altitude m_altitude(
377
            template (value) AltitudeValue p_altitudeValue := AltitudeValue_referenceEllipsoidSurface_,
berge's avatar
berge committed
378
            template (value) AltitudeConfidence p_altitudeConfidence := alt_000_01
tepelmann's avatar
tepelmann committed
379
        ) := {
berge's avatar
berge committed
380
381
            altitudeValue := p_altitudeValue,
            altitudeConfidence := p_altitudeConfidence
382
383
384
385
        }
        
    } // end positionTemplates
    
berge's avatar
berge committed
386
    group decentralizedEnvironmentalNotificationMessageTemplates {
tepelmann's avatar
tepelmann committed
387
        
berge's avatar
berge committed
388
389
        /**
         * @desc    Send template for DEN Message
tepelmann's avatar
tepelmann committed
390
391
392
         * @param   p_management    The Management Container
         * @param   p_situation     The Situation Container
         * @param   p_location      The Location Container
garciay's avatar
garciay committed
393
         * @param   p_alacarte      The Alacarte Container (Default: omit)
394
395
         */
        template (value) DecentralizedEnvironmentalNotificationMessage m_denm(
tepelmann's avatar
tepelmann committed
396
397
398
            template (value) ManagementContainer p_management,
            template (omit) SituationContainer p_situation,
            template (omit) LocationContainer p_location,
tepelmann's avatar
tepelmann committed
399
            template (omit) AlacarteContainer p_alacarte := omit
tepelmann's avatar
tepelmann committed
400
401
402
403
        ) := {
            management := p_management, 
            situation := p_situation, 
            location := p_location,
tepelmann's avatar
tepelmann committed
404
            alacarte := p_alacarte
tepelmann's avatar
tepelmann committed
405
        }
tepelmann's avatar
tepelmann committed
406
        
berge's avatar
berge committed
407
408
        /**
         * @desc    Default receive template for DEN Message
409
         */
tepelmann's avatar
tepelmann committed
410
        template (present) DecentralizedEnvironmentalNotificationMessage mw_anyDenm := {
berge's avatar
berge committed
411
            management := ?, 
tepelmann's avatar
tepelmann committed
412
413
414
415
416
            situation := *, 
            location := *,
            alacarte := *
        }
        
berge's avatar
berge committed
417
418
        /**
         * @desc    Receive template for DEN Message
tepelmann's avatar
tepelmann committed
419
420
         * @param   p_management    The expected Management Container (Default: any)
         * @param   p_situation     The expected Situation Container (Default: any or omit)
garciay's avatar
garciay committed
421
422
         * @param   p_location      The expected location Container (Default: any or omit)
         * @param   p_alacarte      The expected Alacarte Container (Default: any or omit)
423
         */
tepelmann's avatar
tepelmann committed
424
425
426
427
        template (present) DecentralizedEnvironmentalNotificationMessage mw_denm(
            template (present) ManagementContainer p_management := ?,
            template SituationContainer p_situation := *,
            template LocationContainer p_location := *,
berge's avatar
berge committed
428
            template AlacarteContainer p_alacarte := *
tepelmann's avatar
tepelmann committed
429
430
431
432
        ) modifies mw_anyDenm := {
            management := p_management, 
            situation := p_situation, 
            location := p_location,
berge's avatar
berge committed
433
            alacarte := p_alacarte
tepelmann's avatar
tepelmann committed
434
        }
tepelmann's avatar
tepelmann committed
435
        
berge's avatar
berge committed
436
        /**
tepelmann's avatar
tepelmann committed
437
         * @desc    Send template for DEN Message for event termination.
garciay's avatar
garciay committed
438
         * @param   p_actionID  The action id
439
         */
tepelmann's avatar
tepelmann committed
440
        template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation(
441
            template (value) ActionID p_actionID,
442
            template (value) StationType p_stationType
tepelmann's avatar
tepelmann committed
443
        ) := {
444
            management := m_denmMgmtConTermination(p_actionID, p_stationType, 1, -, -, -, isCancellation), 
tepelmann's avatar
tepelmann committed
445
446
447
            situation := omit, 
            location := omit,
            alacarte := omit
tepelmann's avatar
tepelmann committed
448
        }
449
        
berge's avatar
berge committed
450
    } // end group decentralizedEnvironmentalNotificationMessageTemplates
tepelmann's avatar
tepelmann committed
451
    
452
    group decentralizedManagementTemplates {
tepelmann's avatar
tepelmann committed
453
        
berge's avatar
berge committed
454
        /**
tepelmann's avatar
tepelmann committed
455
         * @desc    Send template for Management Container
garciay's avatar
garciay committed
456
457
458
459
         * @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)
460
         * @param   p_detectionTime         The detection time (Default: current time)
garciay's avatar
garciay committed
461
         * @param   p_referenceTime         The reference time (Default: current time)
462
         */
tepelmann's avatar
tepelmann committed
463
464
        template (value) ManagementContainer m_denmMgmtCon(
            template (value) ActionID p_actionID,
465
            template (value) StationType p_stationType := f_getTsStationType(),
466
            template (value) ValidityDuration p_validityDuration := defaultValidity,
467
            template (omit) TransmissionInterval p_transmissionInterval := omit,
468
469
            template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
            template (value) TimestampIts p_referenceTime := f_getCurrentTime()
tepelmann's avatar
tepelmann committed
470
        ) := {
tepelmann's avatar
tepelmann committed
471
            actionID := p_actionID,
berge's avatar
berge committed
472
            detectionTime := p_detectionTime,
473
            referenceTime := p_referenceTime,
474
            termination := omit,
tepelmann's avatar
tepelmann committed
475
476
            eventPosition := m_tsPosition,
            relevanceDistance := lessThan50m,
477
            relevanceTrafficDirection := allTrafficDirections,
berge's avatar
berge committed
478
            validityDuration := p_validityDuration,
479
480
            transmissionInterval := p_transmissionInterval,
            stationType := p_stationType
481
        }
tepelmann's avatar
tepelmann committed
482
        
483
484
485
486
487
488
489
490
491
492
493
494
        /**
         * @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 (value) ManagementContainer m_denmMgmtConTermination (
            template (value) ActionID p_actionID,
495
            template (value) StationType p_stationType := f_getTsStationType(),
496
            template (value) ValidityDuration p_validityDuration := defaultValidity,
497
498
499
500
501
502
503
504
            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
        }
        
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
        /**
         * @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 (present) 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
        }
        
berge's avatar
berge committed
526
        /**
tepelmann's avatar
tepelmann committed
527
         * @desc    Receive template for Management Container
garciay's avatar
garciay committed
528
529
         * @param   p_actionID              The expected action id
         * @param   p_referenceTime         The reference time (Default: any)
530
         * @param   p_isNegation            The expected negation flag (Default: false)
garciay's avatar
garciay committed
531
532
         * @param   p_validityDuration      The expected validity duration (Default: any or omit)
         * @param   p_transmissionInterval  The expected transmission interval (Default: any or omit)
berge's avatar
berge committed
533
         */
tepelmann's avatar
tepelmann committed
534
        template (present) ManagementContainer mw_denmMgmtCon(
berge's avatar
berge committed
535
            template (present) ActionID p_actionID,
536
            template (present) StationType p_stationType := f_getIutStationType(),
537
            template (present) TimestampIts p_referenceTime := ?,
538
            template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
539
540
            template TransmissionInterval p_transmissionInterval := *,
            template Termination p_termination := *
tepelmann's avatar
tepelmann committed
541
        ) := {
berge's avatar
berge committed
542
543
            actionID := p_actionID,
            detectionTime := ?,
544
            referenceTime := p_referenceTime,
545
            termination    := p_termination,
berge's avatar
berge committed
546
            eventPosition := ?,
547
548
            relevanceDistance := *,//?,
            relevanceTrafficDirection := *,//?,
berge's avatar
berge committed
549
            validityDuration := p_validityDuration,
550
            transmissionInterval := p_transmissionInterval,
551
            stationType    := p_stationType
berge's avatar
berge committed
552
        }
tepelmann's avatar
tepelmann committed
553
        
berge's avatar
berge committed
554
555
        /**
         * @desc    Send template for Test system ActionID
garciay's avatar
garciay committed
556
         * @param   p_sequenceNumber    The sequence number (Default: 0)
tepelmann's avatar
tepelmann committed
557
         */
tepelmann's avatar
tepelmann committed
558
        template (value) ActionID m_tsActionId(
tepelmann's avatar
tepelmann committed
559
            template (value) SequenceNumber p_sequenceNumber := 0
tepelmann's avatar
tepelmann committed
560
        ) := {
561
            originatingStationID := f_getTsStationId(),
tepelmann's avatar
tepelmann committed
562
            sequenceNumber := p_sequenceNumber
berge's avatar
berge committed
563
564
        }
        
565
        /**
tepelmann's avatar
tepelmann committed
566
         * @desc    Default receive template for Management Container
567
         */
tepelmann's avatar
tepelmann committed
568
        template (present) ManagementContainer mw_anyDenmMgmtCon := {
569
570
            actionID := ?,
            detectionTime := ?,
571
            referenceTime := ?,
572
            termination    := *,
573
            eventPosition := ?,
574
575
576
            relevanceDistance := *,
            relevanceTrafficDirection := *,
            validityDuration := *, // It seems that a default value can be omitted (asn1studio)
577
            transmissionInterval := *,
578
            stationType    := ?
579
580
581
        }
        
        /**
tepelmann's avatar
tepelmann committed
582
         * @desc    Receive template for Management Container with the given action id
garciay's avatar
garciay committed
583
         * @param   p_actionId  The expected action id (Default: any)
584
         */
tepelmann's avatar
tepelmann committed
585
586
        template (present) ManagementContainer mw_denmMgmtConWithActionID(
            template (present) ActionID p_actionId := ?
587
588
589
590
591
        ) modifies mw_anyDenmMgmtCon := {
            actionID := p_actionId
        }
        
        /**
tepelmann's avatar
tepelmann committed
592
         * @desc    Receive template for Management Container with the given data version
garciay's avatar
garciay committed
593
         * @param   p_referenceTime   The expected reference time (Default: any)
594
         */
595
596
        template (present) ManagementContainer mw_denmMgmtConWithReferenceTime(
            template (present) TimestampIts p_referenceTime := ?
597
        ) modifies mw_anyDenmMgmtCon := {
598
            referenceTime := p_referenceTime
599
600
601
        }
        
        /**
tepelmann's avatar
tepelmann committed
602
         * @desc    Send template for ActionID
garciay's avatar
garciay committed
603
604
         * @param   p_sequenceNumber        The sequence number
         * @param   p_originatorStationID   The originator station id (Default: IUT's station id)
605
606
         */
        template (value) ActionID m_actionId(
tepelmann's avatar
tepelmann committed
607
            template (value) SequenceNumber p_sequenceNumber,
608
            template (value) ITS_Container.StationID p_originatorStationID := f_getIutStationId()
609
        ) := {
610
            originatingStationID := p_originatorStationID,
611
612
613
614
615
            sequenceNumber := p_sequenceNumber
        }
        
        /**
         * @desc    Receive template for ActionID
garciay's avatar
garciay committed
616
617
         * @param   p_originatorStationID   The expected originator station id (Default: any)
         * @param   p_sequenceNumber        The expected sequence number (Default: any)
618
         */
berge's avatar
berge committed
619
        template (present) ActionID mw_actionId(
620
            template (present) ITS_Container.StationID p_originatorStationID := ?,
tepelmann's avatar
tepelmann committed
621
            template (present) SequenceNumber p_sequenceNumber := ?
622
        ) := {
623
            originatingStationID := p_originatorStationID,
624
625
626
            sequenceNumber := p_sequenceNumber
        }
        
berge's avatar
berge committed
627
        /**
tepelmann's avatar
tepelmann committed
628
         * @desc    Default receive template for any ActionID
berge's avatar
berge committed
629
630
631
         */
        template (present) ActionID mw_anyActionId := ?;
        
632
    } // end group decentralizedManagementTemplates
tepelmann's avatar
tepelmann committed
633
    
berge's avatar
berge committed
634
    group decentralizedSituationTemplates {
tepelmann's avatar
tepelmann committed
635
        
berge's avatar
berge committed
636
        group situationTemplates {
tepelmann's avatar
tepelmann committed
637
            
berge's avatar
berge committed
638
            /**
tepelmann's avatar
tepelmann committed
639
640
641
             * @desc    Send template for Situation Container
             * @param   p_cause                 The cause code
             * @param   p_subCause              The sub-cause code
garciay's avatar
garciay committed
642
             * @param   p_informationQuality    The information quality (Default: 0)
643
             */
tepelmann's avatar
tepelmann committed
644
645
646
            template (value) SituationContainer m_situation(
                template (value) CauseCodeType p_cause, 
                template (value) SubCauseCodeType p_subCause,
berge's avatar
berge committed
647
                template (value) InformationQuality p_informationQuality := 0
tepelmann's avatar
tepelmann committed
648
            ) := {
tepelmann's avatar
tepelmann committed
649
650
651
652
653
                informationQuality := p_informationQuality,
                eventType := {
                    causeCode := p_cause,
                    subCauseCode := p_subCause
                },
654
655
                linkedCause := omit,
                eventHistory := omit
tepelmann's avatar
tepelmann committed
656
657
            }
            
658
            /**
tepelmann's avatar
tepelmann committed
659
660
661
662
             * @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)
663
664
665
666
667
             */
            template (present) SituationContainer mw_situation(
                template (present) CauseCodeType p_cause, 
                template (present) SubCauseCodeType p_subCause,
                template (present) InformationQuality p_informationQuality := ?
tepelmann's avatar
tepelmann committed
668
            ) := {
669
670
671
672
673
                informationQuality := p_informationQuality,
                eventType := {
                    causeCode := p_cause,
                    subCauseCode := p_subCause
                },
674
675
                linkedCause := *,
                eventHistory := *
676
677
            }
            
tepelmann's avatar
tepelmann committed
678
            /**
tepelmann's avatar
tepelmann committed
679
680
681
             * @desc    Default receive template for Situation Container
             */
            template (present) SituationContainer mw_anySitutation := ?;
tepelmann's avatar
tepelmann committed
682
            
berge's avatar
berge committed
683
        } // end group situationTemplates
tepelmann's avatar
tepelmann committed
684
        
berge's avatar
berge committed
685
    } // end group decentralizedSituationTemplates
tepelmann's avatar
tepelmann committed
686
    
687
    group decentralizedLocationTemplates {
tepelmann's avatar
tepelmann committed
688
        
689
        /**
tepelmann's avatar
tepelmann committed
690
         * @desc    Send template for Location Container where no delta is given
691
         */
tepelmann's avatar
tepelmann committed
692
693
694
695
696
697
698
699
700
        template (value) LocationContainer m_denmLocation_zeroDelta := {
            eventSpeed := omit,
            eventPositionHeading := omit,
            traces := {
                {
                    {
                        pathPosition := {
                            deltaLatitude := 0,
                            deltaLongitude := 0,
berge's avatar
berge committed
701
                            deltaAltitude := 0
tepelmann's avatar
tepelmann committed
702
703
704
                        },
                        pathDeltaTime := 0
                    }
705
706
                }
            },
berge's avatar
berge committed
707
            roadType := omit 
tepelmann's avatar
tepelmann committed
708
709
        }
        
710
        /**
tepelmann's avatar
tepelmann committed
711
         * @desc    Default receive template for Location Container
712
713
714
715
716
         */
        template (present) LocationContainer mw_anyDenmLocation := {
            eventSpeed := *,
            eventPositionHeading := *,
            traces := ?,
berge's avatar
berge committed
717
            roadType := *
718
719
720
        }
        
        /**
tepelmann's avatar
tepelmann committed
721
         * @desc    Receive template for Location Container with the given traces
garciay's avatar
garciay committed
722
         * @param   p_traces    The expected traces.
723
724
         */
        template (present) LocationContainer mw_denmLocationWithTrace(
tepelmann's avatar
tepelmann committed
725
            template (present) Traces p_traces
726
727
728
729
        ) := {
            eventSpeed := *,
            eventPositionHeading := *,
            traces := p_traces,
berge's avatar
berge committed
730
            roadType := *
731
732
733
        }
        
    } // end group decentralizedLocationTemplates
734
    
735
    group alacarteTemplates {
tepelmann's avatar
tepelmann committed
736
        
tepelmann's avatar
tepelmann committed
737
        /**
738
         * @desc    Send template for Alacarte Container including lanePosition
tepelmann's avatar
tepelmann committed
739
740
         */
        template (value) AlacarteContainer m_alacarteConLaneCount := {
741
            lanePosition := 0,
tepelmann's avatar
tepelmann committed
742
743
744
745
746
747
            impactReduction := omit,
            externalTemperature := omit,
            roadWorks := omit,
            positioningSolution := omit,
            stationaryVehicle := omit
        }
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
         
        /**
         * @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 := {
765
766
767
768
769
770
771
772
773
774
775
776
            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
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
        }
         
        /**
         * @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 := {
795
796
797
798
799
800
801
802
803
804
805
806
            heightLonCarrLeft            := ?,
            heightLonCarrRight            := ?,
            posLonCarrLeft                := ?,
            posLonCarrRight             := ?,
            positionOfPillars             := ?,
            posCentMass                    := ?,
            wheelBaseVehicle            := ?,
            turningRadius                := ?,
            posFrontAx                    := ?,
            positionOfOccupants            := ?,
            vehicleMass                    := ?,
            requestResponseIndication    := response
807
        }
tepelmann's avatar
tepelmann committed
808
        
809
    } // end alacarteTemplates
berge's avatar
berge committed
810
    
811
    group sspTemplates {
812
        
813
814
815
        template (present) bitstring mw_sspNoTrafficCondition        := '*0'B;
        template (present) bitstring mw_sspNoAccident                := '*0?'B;
        template (present) bitstring mw_sspNoRoadworks               := '*0??'B;
816
817
    } // end sspTemplates
    
berge's avatar
berge committed
818
} // end LibItsDenmTemplates