LibItsSremSsem_Templates.ttcn 37.7 KB
Newer Older
garciay's avatar
garciay committed
1
/**
2
 *    @author   ETSI  STF517
Yann Garcia's avatar
Yann Garcia committed
3
4
 *    @version  $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/SremSsem/LibItsSremSsem_Templates.ttcn $
 *              $Id: LibItsSremSsem_Templates.ttcn 1312 2016-12-14 09:21:45Z garciay $
garciay's avatar
garciay committed
5
 *    @desc     Module containing base template definitions for SREM SSEM
garciay's avatar
garciay committed
6
7
8
9
 *    @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.
garciay's avatar
garciay committed
10
11
12
13
14
15
16
17
18
19
20
21
22
 *
 */
module LibItsSremSsem_Templates {

    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    
    // LibIts
    import from ITS_Container language "ASN.1:1997" all;
    import from SREM_PDU_Descriptions language "ASN.1:1997" all;
    import from SSEM_PDU_Descriptions language "ASN.1:1997" all;
    import from DSRC language "ASN.1:1997" all;
Yann Garcia's avatar
Yann Garcia committed
23
    import from DSRC_REGION_noCircular language "ASN.1:1997" all;
24
    import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
garciay's avatar
garciay committed
25
26
27
    
    // LibItsCommon
    import from LibItsCommon_TypesAndValues all;
garciay's avatar
garciay committed
28
    import from LibItsCommon_Functions all;
29
    import from LibItsCommon_ASN1_NamedNumbers all;
garciay's avatar
garciay committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    
    // LibItsSremSsem
    import from LibItsSremSsem_TestSystem all;
    import from LibItsSremSsem_TypesAndValues all;
    import from LibItsSremSsem_Pixits all;

    group primitivesTemplates {
        
        /**
         * @desc    Send template for SREM Message (SremSsemPort Primitive)
         * @param   p_sremMsg    The SREM Message to be sent
         */
        template (value) SremReq m_sremReq(
                                            in template (value) SREM p_sremMsg
        ) := {
            msgOut := p_sremMsg
        }
        
        /**
         * @desc    Receive template for SREM Message (SremSsemPort Primitive)
         * @param   p_sremMsg    The expected SREM Message
         */
        template (present) SremInd mw_sremInd(
53
                                              template (present) SREM p_sremMsg
garciay's avatar
garciay committed
54
55
        ) := {
            msgIn := p_sremMsg,
56
            recvTime            := *,
garciay's avatar
garciay committed
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
            gnNextHeader        := *,
            gnHeaderType        := *,
            gnHeaderSubtype     := *,
            gnLifetime          := *,
            gnTrafficClass      := *,
            btpDestinationPort  := *,
            btpInfo             := *,
            ssp                 := *,
            its_aid             := * 
        }
        
        /**
         * @desc    Receive template for SREM Message (SremSsemPort Primitive)
         * @param   p_sremMsg          The expected SREM 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) SremInd mw_sremIndWithGnParameters(
                                                               template (present) SREM p_sremMsg,
                                                               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_sremInd := { 
            gnNextHeader    := p_gnNextHeader,
            gnHeaderType    := p_gnHeaderType,
            gnHeaderSubtype := p_gnHeaderSubtype,
            gnLifetime      := p_gnLifetime,
            gnTrafficClass  := p_gnTrafficClass
        }
        
        /**
         * @desc    Receive template for SREM Message (SremSsemPort Primitive)
         * @param   p_sremMsg              Expected SREM 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)
         */
Yann Garcia's avatar
Yann Garcia committed
98
99
100
101
        template (present) SremInd mw_sremIndWithBtpParameters(
                                                               template (present) SREM p_sremMsg,
                                                               template UInt16 p_btpDestinationPort := *,
                                                               template UInt16 p_btpInfo := *
garciay's avatar
garciay committed
102
103
104
105
106
107
108
109
110
111
112
113
114
        ) modifies mw_sremInd := { 
            btpDestinationPort  := p_btpDestinationPort,
            btpInfo             := p_btpInfo
        };
        
        /**
         * @desc    Receive template for SREM Message (SremSsemPort Primitive)
         * @param   p_sremMsg  The expected SREM Message
         * @param   p_ssp       SSP value
         * @param   p_its_aid   ITS-AID value
         */
        template (present) SremInd mw_sremIndWithSecurityParameters(
                                                                     template (present) SREM p_sremMsg,
Yann Garcia's avatar
Yann Garcia committed
115
116
                                                                     template (present) Bit24 p_ssp := ?,
                                                                     template (present) UInt32 p_its_aid := ?
garciay's avatar
garciay committed
117
118
119
120
121
122
123
124
125
126
        ) modifies mw_sremInd := { 
            ssp     := p_ssp,
            its_aid := p_its_aid
        }
        
        /**
         * @desc    Send template for SSEM Message (SremSsemPort Primitive)
         * @param   p_ssemMsg    The SSEM Message to be sent
         */
        template (value) SsemReq m_ssemReq(
127
                                           in template (value) SSEM p_ssemMsg
garciay's avatar
garciay committed
128
129
130
131
132
133
134
135
136
        ) := {
            msgOut := p_ssemMsg
        }
        
        /**
         * @desc    Receive template for SSEM Message (SremSsemPort Primitive)
         * @param   p_ssemMsg    The expected SSEM Message
         */
        template (present) SsemInd mw_ssemInd(
137
                                              template (present) SSEM p_ssemMsg := ?
garciay's avatar
garciay committed
138
139
        ) := {
            msgIn               := p_ssemMsg,
Yann Garcia's avatar
Yann Garcia committed
140
            recvTime            := *,
garciay's avatar
garciay committed
141
142
143
144
145
146
147
            gnNextHeader        := *,
            gnHeaderType        := *,
            gnHeaderSubtype     := *,
            gnLifetime          := *,
            gnTrafficClass      := *,
            btpDestinationPort  := *,
            btpInfo             := *,
148
            ssp                 := *,
garciay's avatar
garciay committed
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
            its_aid             := * 
        };

        /**
         * @desc    Receive template for SSEM Message (SremSsemPort Primitive)
         * @param   p_ssemMsg         The expected SSEM 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) SsemInd mw_ssemIndWithGnParameters(
                                                              template (present) SSEM p_ssemMsg,
                                                              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_ssemInd := { 
            gnNextHeader    := p_gnNextHeader,
            gnHeaderType    := p_gnHeaderType,
            gnHeaderSubtype := p_gnHeaderSubtype,
            gnLifetime      := p_gnLifetime,
            gnTrafficClass  := p_gnTrafficClass
        }
        
        /**
         * @desc    Receive template for SSEM Message (SremSsemPort Primitive)
         * @param   p_ssemMsg             Expected SREM 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)
         */
182
        template(present) SsemInd mw_ssemIndWithBtpParameters(
Yann Garcia's avatar
Yann Garcia committed
183
184
185
                                                              template (present) SSEM p_ssemMsg,
                                                              template UInt16 p_btpDestinationPort := *,
                                                              template UInt16 p_btpInfo := *
garciay's avatar
garciay committed
186
187
188
189
190
191
192
193
194
195
196
197
        ) modifies mw_ssemInd := { 
            btpDestinationPort  := p_btpDestinationPort,
            btpInfo             := p_btpInfo
        };

        /**
         * @desc    Receive template for SSEM Message (SremSsemPort Primitive)
         * @param   p_ssemMsg  The expected SSEM Message
         * @param   p_ssp        SSP value
         * @param   p_its_aid    ITS-AID value
         */
        template (present) SsemInd mw_ssemIndWithSecurityParameters(
garciay's avatar
garciay committed
198
                                                                    template (present) SSEM p_ssemMsg,
Yann Garcia's avatar
Yann Garcia committed
199
200
                                                                    template (present) Bit24 p_ssp := ?,
                                                                    template (present) UInt32 p_its_aid := ?
garciay's avatar
garciay committed
201
202
203
204
205
206
207
208
209
210
211
212
213
        ) modifies mw_ssemInd := { 
            ssp     := p_ssp,
            its_aid := p_its_aid
        }
        
    }

    group utPrimitives {
            
        /**
         * @desc    Send template for Upper Tester event initialization
         * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use
        */
214
215
216
217
        template (value) UtSremInitialize m_sremSsemInitialize(
                                                               in HashedId8 p_hashedId8 := '0000000000000000'O
                                                               ) := {
            hashedId8 := p_hashedId8
garciay's avatar
garciay committed
218
219
220
221
222
        }

        /**
        * @desc    Send template for Upper Tester Trigger event
        */
223
224
        template (value) UtSremTrigger m_utTriggerEvent( 
                                                        in template (value) BasicVehicleRole p_basicVehicleRole,
225
226
                                                        in template (value) RequestImportanceLevel p_requestImportanceLevel,
                                                        in template (value) IntersectionID p_intersectionId
227
228
        ) := {
            basicVehicleRole        := p_basicVehicleRole,
229
230
            requestImportanceLevel  := p_requestImportanceLevel,
            intersectionId          := p_intersectionId
231
232
233
234
235
236
237
238
239
240
        }
        
        template (value) UtSremUpdate m_utUpdateEvent(
                                                      in template (value) RequestID p_requestID,
                                                      in template (value) BasicVehicleRole p_basicVehicleRole,
                                                      in template (value) RequestImportanceLevel p_requestImportanceLevel
        ) := {
            requestID               := p_requestID,
            basicVehicleRole        := p_basicVehicleRole,
            requestImportanceLevel  := p_requestImportanceLevel
garciay's avatar
garciay committed
241
        }
242
        
243
244
245
246
247
248
        template (value) UtSremCancelation m_UtSremCancelationEvent(
                                                                    in template (value) RequestID p_requestID
        ) := {
            requestID := p_requestID
        }
        
garciay's avatar
garciay committed
249
250
    }

garciay's avatar
garciay committed
251
    group sremSsemPduTemplates {
garciay's avatar
garciay committed
252
253
254
255
256
257
258
259
        
        /**
         * @desc    Send template for SREM PDU
         * @param   p_map  The SREM Message
         */
        template (value) SREM m_sremPdu(
                                          in template (value) SignalRequestMessage p_srm
        ) := {
260
            header  := m_itsPduHeader( - , - ,LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_ ),
garciay's avatar
garciay committed
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
            srm    := p_srm
        }
        
        /**
         * @desc    Receive template for SREM PDU
         * @param   p_map  The SREM Message
         */
        template (present) SREM mw_sremPdu(
                                            template (present) SignalRequestMessage p_srm := ?
        ) := {
            header  := mw_itsPduHeaderSrem,
            srm     := p_srm
        }
        
        /**
         * @desc    Send template for SSEM PDU
         * @param   p_spat  The SSEM Message
         */
        template (value) SSEM m_ssemPdu(
                                        in template (value) SignalStatusMessage p_ssm
        ) := {
282
            header  := m_itsPduHeader( - , - , LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_),
garciay's avatar
garciay committed
283
284
285
286
287
288
289
290
291
292
293
294
295
296
            ssm     := p_ssm
        }
        
        /**
         * @desc    Receive template for SSEM PDU
         * @param   p_spat  The SSEM Message
         */
        template (present) SSEM mw_ssemPdu(
                                           template (present) SignalStatusMessage p_ssm := ?
        ) := {
            header  := mw_itsPduHeaderSsem,
            ssm     := p_ssm
        }
        
garciay's avatar
garciay committed
297
    } // End of group sremSsemPduTemplates
garciay's avatar
garciay committed
298
299
300
301
302
303
304
305
306
307
308
    
    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 SREM SSEM protocol version)
         * @param   p_messageID         The message Id (Default: SREM SSEM id)
         */
        template (value) ItsPduHeader m_itsPduHeader(
                                                     in template (value) StationID p_stationID := f_getTsStationId(),
309
                                                     in template (value) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
garciay's avatar
garciay committed
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
                                                     in template (value) ItsPduHeader.messageID p_messageID
        ) := {
            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 SREM SSEM protocol version)
         * @param   p_messageID         The expected message id (Default: SREM SSEM message id)
         */
        template ItsPduHeader mw_itsPduHeader(
                                              template (present) StationID p_stationID := ?,
325
                                              template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
garciay's avatar
garciay committed
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
                                              template (present) ItsPduHeader.messageID p_messageID := ?
        ) := {
            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 SREM SSEM protocol version)
         * @param   p_messageID         The expected message id (Default: SREM id)
         */
        template ItsPduHeader mw_itsPduHeaderSrem(
                                                   template (present) StationID p_stationID := ?,
341
342
                                                   template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
                                                   template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_srem_
garciay's avatar
garciay committed
343
344
345
346
347
348
349
350
351
352
353
354
        ) := {
            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 SREM SSEM protocol version)
         * @param   p_messageID         The expected message id (Default: SSEM id)
         */
355
356
357
        template (present) ItsPduHeader mw_itsPduHeaderSsem(
                                                            template (present) StationID p_stationID := ?,
                                                            template (present) ItsPduHeader.protocolVersion p_protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
358
                                                    template (present) ItsPduHeader.messageID p_messageID := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_ssem_
garciay's avatar
garciay committed
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
        ) := {
            protocolVersion := p_protocolVersion,
            messageID       := p_messageID,
            stationID       := p_stationID
        }
        
        /**
         * @desc    Default receive template for the station id
         */
        template (present) StationID mw_anyStationId := ?;
        
    } // End of group headerTemplates

    group sremSsemTemplates {
        
garciay's avatar
garciay committed
374
375
376
377
378
379
380
381
        template (omit) IntersectionReferenceID m_intersectionReferenceID(
                                                                          in template (value) IntersectionID p_intersectionID := 0,
                                                                          in template (omit) RoadRegulatorID p_roadRegulatorID := omit
        ) := {
            region  := p_roadRegulatorID,   // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs
            id      := p_intersectionID     // a unique mapping to the intersection in question within the above region of use
        }
        
382
383
384
385
386
387
388
389
        template IntersectionReferenceID mw_intersectionReferenceID(
                                                                    template (present) IntersectionID p_intersectionID := ?,
                                                                    template RoadRegulatorID p_roadRegulatorID := *
        ) := {
            region  := p_roadRegulatorID,   // a globally unique regional assignment value typical assigned to a regional DOT authority the value zero shall be used for testing needs
            id      := p_intersectionID     // a unique mapping to the intersection in question within the above region of use
        }
        
garciay's avatar
garciay committed
390
391
        group sremTemplates {
            
garciay's avatar
garciay committed
392
393
394
395
396
397
398
399
            group sremTemplatesSend {
                
                /**
                 * @desc    Send template for SREM Message
                 */
                template (value) SignalRequestMessage m_defaultSrem := {
                    timeStamp       := omit,
                    second          := PX_SECOND,
400
                    sequenceNumber  := PX_SEQUENCE_NUMBER,
garciay's avatar
garciay committed
401
                    requests        := { 
402
403
404
405
406
                        valueof(
                            m_signalRequestPackage(
                                valueof(
                                    m_signalRequest(
                                        m_intersectionReferenceID,
407
                                        PX_REQUEST_ID,
408
409
410
411
                                        priorityRequestTypeReserved,
                                        { lane := 1 }
                    )))) },
                    requestor       := valueof(m_requestorDescription(m_vehicleID(f_getIutStationId()))),
garciay's avatar
garciay committed
412
413
414
                    regional        := omit
                }
                
415
416
417
418
419
420
421
422
423
424
425
                /**
                 * @desc    Send template for SREM Message
                 */
                template (omit) SignalRequestMessage m_srem(
                                                            in template (value) RequestorDescription p_requestorDescription,
                                                            in template (omit) SignalRequestList p_requests := omit
                                                            ) modifies m_defaultSrem := {
                    requests        := p_requests,
                    requestor       := p_requestorDescription
                }
                
garciay's avatar
garciay committed
426
427
428
429
430
431
                template (value) SignalRequestPackage m_signalRequestPackage(
                                                                            in template (value) SignalRequest p_request
                ) := {
                    request     := p_request,
                    minute      := omit,
                    second      := omit,
garciay's avatar
garciay committed
432
                    duration    := omit,
garciay's avatar
garciay committed
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
                    regional    := omit
                }
                
                template (omit) SignalRequest m_signalRequest(
                                                               in template (value) IntersectionReferenceID p_id,
                                                               in template (value) RequestID p_requestID,
                                                               in template (value) PriorityRequestType p_requestType,
                                                               in template (value) IntersectionAccessPoint p_inBoundLane,
                                                               in template (omit) IntersectionAccessPoint p_outBoundLane := omit
                ) := {
                    id              := p_id,
                    requestID       := p_requestID,
                    requestType     := p_requestType,
                    inBoundLane     := p_inBoundLane,
                    outBoundLane    := p_outBoundLane,
                    regional        := omit
                }
                
                template (omit) RequestorDescription m_requestorDescription(
                                                                            in template (value) VehicleID p_id,
                                                                            in template (omit) RequestorType p_type := omit,
                                                                            in template (omit) RequestorPositionVector p_position := omit,
                                                                            in template (omit) TransitVehicleStatus p_transitStatus := omit,
                                                                            in template (omit) TransitVehicleOccupancy p_transitOccupancy := omit
                ) := {
                    id                  := p_id,                // The ID used in the BSM or CAM of the requestor
                    type_               := p_type,              // Information regarding all type and class data about the requesting vehicle 
                    position            := p_position,          // The location of the requesting vehicle
                    name                := omit,                // A human readable name for debugging use
                    routeName           := omit,                // A string for transit operations use
                    transitStatus       := p_transitStatus,     // current vehicle state (loading, etc.)
                    transitOccupancy    := p_transitOccupancy,  // current vehicle occupancy 
                    transitSchedule     := omit,                // current vehicle schedule adherence 
                    regional            := omit
                }
                
                template (value) VehicleID m_vehicleID(
                                                       in template (value) StationID p_stationID
                ) := {
                    stationID   := p_stationID
                }
                
                template (omit) RequestorType m_requestorType(
                                                              in template (value) BasicVehicleRole p_role,
                                                              in template (omit) RequestSubRole p_subrole := omit,
                                                              in template (omit) RequestImportanceLevel p_request := omit
                ) := {
                    role        := p_role,      // Basic role of this user at this time
                    subrole     := p_subrole,   // A local list with role based items 
                    request     := p_request,   // A local list with request items 
                    iso3883     := omit,
                    hpmsType    := omit,        // HPMS classification types
                    regional    := omit
                }
                
            } // End of  group sremTemplatesSend
garciay's avatar
garciay committed
489
            
garciay's avatar
garciay committed
490
491
492
493
494
495
496
497
498
499
500
501
            group sremTemplatesRecv {
                
                /**
                 * @desc    Receive template for SREM Message
                 */
                template (present) SignalRequestMessage mw_defaultSrem := {
                    timeStamp       := *,
                    second          := ?,
                    sequenceNumber  := *,
                    requests        := *,
                    requestor       := ?,
                    regional        := *
502
                } // End of template mw_defaultSrem
garciay's avatar
garciay committed
503
504
505
506
                
                /**
                 * @desc    Receive template for SREM Message with no LayerType
                 */
507
508
                template (present) SignalRequestMessage mw_sremWellFormatted(
                                                                             template (present) RequestorDescription p_requestor := ?,
509
510
                                                                             template (present) SignalRequestList p_requests := ?,
                                                                             template (present) MsgCount p_sequenceNumber := ?,
Yann Garcia's avatar
Yann Garcia committed
511
512
                                                                             template (present) DSecond p_second := ?,
                                                                             template MinuteOfTheYear p_timeStamp := *
513
                ) modifies mw_defaultSrem := {
514
515
516
517
518
                  timeStamp      := p_timeStamp,
                  second         := p_second,
                  sequenceNumber := p_sequenceNumber,
                  requests       := p_requests,
                  requestor      := p_requestor
519
                } // End of template mw_sremWellFormatted
garciay's avatar
garciay committed
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
                template (present) SignalRequestPackage mw_signalRequestPackage(
                                                                                template (present) SignalRequest p_request := ?
                ) := {
                    request     := p_request,
                    minute      := *,
                    second      := *,
                    duration    := *,
                    regional    := *
                }
                
                template SignalRequest mw_signalRequest(
                                                        template (present) IntersectionReferenceID p_id := ?,
                                                        template (present) RequestID p_requestID := ?,
                                                        template (present) PriorityRequestType p_requestType := priorityRequest,
                                                        template (present) IntersectionAccessPoint p_inBoundLane := ?,
                                                        template IntersectionAccessPoint p_outBoundLane := *
                ) := {
                    id              := p_id,
                    requestID       := p_requestID,
                    requestType     := p_requestType,
                    inBoundLane     := p_inBoundLane,
                    outBoundLane    := p_outBoundLane,
                    regional        := *
                }
                
                template (present) RequestorDescription mw_requestorDescription(
                                                                                template (present) VehicleID p_id := ?,
                                                                                template RequestorType p_type := *,
                                                                                template RequestorPositionVector p_position := *,
                                                                                template TransitVehicleStatus p_transitStatus := *,
                                                                                template TransitVehicleOccupancy p_transitOccupancy := *,
                                                                                template DeltaTime p_transitSchedule := *
                ) := {
                    id                  := p_id,                // The ID used in the BSM or CAM of the requestor
                    type_               := p_type,              // Information regarding all type and class data about the requesting vehicle 
                    position            := p_position,          // The location of the requesting vehicle
                    name                := *,                   // A human readable name for debugging use
                    routeName           := *,                   // A string for transit operations use
                    transitStatus       := p_transitStatus,     // current vehicle state (loading, etc.)
                    transitOccupancy    := p_transitOccupancy,  // current vehicle occupancy 
                    transitSchedule     := p_transitSchedule,   // current vehicle schedule adherence 
                    regional            := *
                } // End of template mw_requestorDescription
                
                template (present) RequestorPositionVector mw_requestor_position(
                                                                                 template (present) Position3D p_position := ?
                ) := {
                  position           := p_position,
                  heading            := *, 
                  speed              := *
                } // End of template mw_requestor_position
                
                template RequestorType mw_requestorType(
                                                        template (present) BasicVehicleRole p_role := ?,
                                                        template RequestSubRole p_subrole := *,
                                                        template RequestImportanceLevel p_request := *
                ) := {
                    role        := p_role,      // Basic role of this user at this time
                    subrole     := p_subrole,   // A local list with role based items 
                    request     := p_request,   // A local list with request items 
                    iso3883     := *,
                    hpmsType    := *,        // HPMS classification types
                    regional    := *
                } // End of template mw_requestorType
garciay's avatar
garciay committed
585
586
                
            } // End of  group sremTemplatesRecv
587
            
garciay's avatar
garciay committed
588
589
590
591
592
593
594
595
596
597
598
        } // End of group sremTemplates 
        
        group ssemTemplates {
            
            /**
             * @desc    Send template for SignalStatusMessage Message
             */
            template (value) SignalStatusMessage m_defaultSsem := {
                timeStamp       := omit,
                second          := PX_SECOND,
                sequenceNumber  := omit,
Yann Garcia's avatar
Yann Garcia committed
599
600
601
602
603
604
605
606
607
608
609
610
611
612
                status          := { 
                                      m_signalStatus(
                                                     PX_SEQUENCE_NUMBER, 
                                                     m_requestorDescription(
                                                                            m_vehicleID(f_getIutStationId()
                                                                            )), 
                                                     m_signalRequest(
                                                                     m_intersectionReferenceID, 
                                                                     PX_REQUEST_ID, 
                                                                     priorityRequestTypeReserved, 
                                                                     { lane := 1 } 
                                                                     )
                                                     ) 
                                      },
613
614
615
616
617
618
619
620
621
622
                regional        := omit
            }
            
            /**
             * @desc    Send template for SignalStatusMessage Message
             */
            template (value) SignalStatusMessage m_ssem(
                                                        in SignalRequestMessage p_signalRequestMessage
            ) modifies m_defaultSsem := {
                second      := p_signalRequestMessage.second,
Yann Garcia's avatar
Yann Garcia committed
623
                status      := { m_signalStatus(p_signalRequestMessage.sequenceNumber, p_signalRequestMessage.requestor, p_signalRequestMessage.requests[0].request) },
624
625
626
                regional    := omit
            }
            
627
628
629
630
631
632
633
634
635
636
637
638
639
            /**
             * @desc    Receive template for SSEM Message
             */
            template (present) SignalStatusMessage mw_ssemWellFormatted(
                                                                        template (present) MsgCount p_sequenceNumber := ?,
                                                                        template (present) SignalStatus p_status := ?
            ) := {
                timeStamp       := *,
                second          := ?,
                sequenceNumber  := p_sequenceNumber,
                status          := { p_status },
                regional        := *
            }
640
641
            
            template (value) SignalStatus m_signalStatus(
642
                                                         in template (value) MsgCount p_sequenceNumber,
Yann Garcia's avatar
Yann Garcia committed
643
644
                                                         in template (value) RequestorDescription p_requestor,
                                                         in template (value) SignalRequest p_signalRequest
645
            ) := {
646
                sequenceNumber  := p_sequenceNumber,
Yann Garcia's avatar
Yann Garcia committed
647
                id              := p_signalRequest.id,
Yann Garcia's avatar
Yann Garcia committed
648
                sigStatus       := { m_signalStatusPackage(m_requester(p_requestor, p_signalRequest.requestID, p_sequenceNumber)) },
649
650
651
                regional        := omit
            }
            
652
653
654
655
656
657
658
659
660
661
662
            template (present) SignalStatus mw_signalStatus(
                                                            template (present) MsgCount p_sequenceNumber := ?,
                                                            template (present) IntersectionReferenceID p_id := ?,
                                                            template (present) SignalStatusPackage p_sigStatus := ?
            ) := {
                sequenceNumber  := p_sequenceNumber,
                id              := p_id,
                sigStatus       := { p_sigStatus },
                regional        := *
            }
            
Yann Garcia's avatar
Yann Garcia committed
663
664
665
666
            template (value) SignalRequesterInfo m_requester(
                                                             in template (value) RequestorDescription p_requestor,
                                                             in template (value) RequestID p_request,
                                                             in template (value) MsgCount p_sequenceNumber
667
            ) := {
Yann Garcia's avatar
Yann Garcia committed
668
                id             := p_requestor.id,
669
670
                request        := p_request,
                sequenceNumber := p_sequenceNumber,
Yann Garcia's avatar
Yann Garcia committed
671
672
                role           := omit,//p_requestor.type_.role,
                typeData       := p_requestor.type_
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
            }
            
            template SignalRequesterInfo mw_requester(
                                                      template (present) VehicleID p_id := ?,
                                                      template (present) RequestID p_request := ?,
                                                      template (present) MsgCount p_sequenceNumber := ?,
                                                      template BasicVehicleRole role := *
            ) := {
                id             := p_id,
                request        := p_request,
                sequenceNumber := p_sequenceNumber,
                role           := *,
                typeData       := *
            }
            
            template (value) SignalStatusPackage m_signalStatusPackage(
                                                                       in template (value) SignalRequesterInfo p_requester
            ) := {
                requester   := p_requester,
692
693
694
695
696
697
698
699
700
                inboundOn   := {
                    approach := 0
                },
                outboundOn  := omit,
                minute      := omit,
                second      := omit,
                duration    := omit,
                status      := processing,
                regional    := omit
garciay's avatar
garciay committed
701
702
            }
            
703
704
            template SignalStatusPackage mw_signalStatusPackage(
                                                                template (present) SignalRequesterInfo p_requester := ?
garciay's avatar
garciay committed
705
            ) := {
706
707
708
709
710
711
712
713
                requester   := p_requester,
                inboundOn   := ?,
                outboundOn  := *,
                minute      := *,
                second      := *,
                duration    := *,
                status      := ?,
                regional    := *
garciay's avatar
garciay committed
714
715
716
717
718
719
720
            }
            
        } // End of group ssemTemplates
        
    } // End of group sremSsemTemplates

} // End of module LibItsSremSsem_Templates