Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
1a79f5fe
Commit
1a79f5fe
authored
Oct 06, 2016
by
garciay
Browse files
Validation in Livorno (20161003-05)
parent
0b7c9381
Changes
6
Hide whitespace changes
Inline
Side-by-side
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn
View file @
1a79f5fe
...
...
@@ -206,7 +206,7 @@ module ItsRSUsSimulator_Functions {
vc_ivim
:=
false
;
}
// DENM, only if PX_ETSI_USE_CASE_ID is set to 1
if
((
vc_denm
==
true
)
and
(
PX_ETSI_USE_CASE_ID
==
5
))
{
if
((
vc_denm
==
true
)
and
(
PX_ETSI_USE_CASE_ID
==
1
))
{
// Build the list of the DENM events for the specified RSU (PX_RSU_ID) and the given zone (PX_ETSI_ZONE_ID)
for
(
v_counter
:=
0
;
v_counter
<
lengthof
(
PICS_DENM_EVENTS_RSU
[
p_rsu_id
][
PX_ETSI_ZONE_ID
-
1
]);
v_counter
:=
v_counter
+
1
)
{
var
DenmEventsParmsPerZone
v_denmEventsParmsPerZone
:=
PICS_DENM_EVENTS_RSU
[
p_rsu_id
][
PX_ETSI_ZONE_ID
-
1
];
...
...
@@ -235,6 +235,19 @@ module ItsRSUsSimulator_Functions {
v_denms
[
v_counter
].
denm
.
alacarte
:=
m_alacarte
(
v_denmEventsParmsPerZone
[
v_counter
].
roadWorksContainerExtended
);
}
}
// End of 'for' statement
// Update referenceDenms field
for
(
v_counter
:=
0
;
v_counter
<
lengthof
(
PICS_DENM_EVENTS_RSU
[
p_rsu_id
][
PX_ETSI_ZONE_ID
-
1
]);
v_counter
:=
v_counter
+
1
)
{
if
(
ispresent
(
v_denms
[
v_counter
].
denm
.
alacarte
.
roadWorks
))
{
var
integer
v_referenceDenms
:=
0
;
for
(
var
integer
v_counter1
:=
0
;
v_counter1
<
lengthof
(
PICS_DENM_EVENTS_RSU
[
p_rsu_id
][
PX_ETSI_ZONE_ID
-
1
]);
v_counter1
:=
v_counter1
+
1
)
{
if
(
v_counter1
==
v_counter
)
{
continue
;
}
v_denms
[
v_counter
].
denm
.
alacarte
.
roadWorks
.
referenceDenms
[
v_referenceDenms
]
:=
v_denms
[
v_counter1
].
denm
.
management
.
actionID
;
v_referenceDenms
:=
v_referenceDenms
+
1
;
}
// End of 'for' statement
}
}
// End of 'for' statement
}
else
{
vc_denm
:=
false
;
}
...
...
@@ -546,32 +559,54 @@ module ItsRSUsSimulator_Functions {
}
// End of function f_adaptPayload
function
f_send_vehicle_cam
(
in
template
(
value
)
CAM
p_cam
,
in
integer
p_idx
in
template
(
value
)
CAM
p_cam
Simu
,
in
template
(
value
)
CAM
p_camVehicle
)
runs
on
ItsRSUsSimulator
{
// Local variables
var
LongPosVector
v_vehiclePosition
:=
PICS_UC6_VEHICLE_POSITION
;
var
float
v_distanceToCollision
;
var
SpeedValue
v_vehicleSpeed
:=
valueof
(
p_camVehicle
.
cam
.
camParameters
.
highFrequencyContainer
.
basicVehicleContainerHighFrequency
.
speed
.
speedValue
);
var
template
(
value
)
Payload
v_payload
;
p_cam
.
cam
.
generationDeltaTime
:=
f_getCurrentTime
()
mod
65536
;
// See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
p_cam
.
cam
.
camParameters
.
basicContainer
.
referencePosition
:=
PICS_USECASE6_VEHICLE_POSITIONS
[
p_idx
];
v_payload
:=
valueof
(
f_adaptPayload
(
bit2oct
(
encvalue
(
valueof
(
p_cam
))),
PICS_CAM_BTP_DESTINATION_PORT
,
PICS_CAM_BTP_SOURCE_PORT
)
// Compute distance to collision point
v_vehiclePosition
.
latitude
:=
valueof
(
p_camVehicle
.
cam
.
camParameters
.
basicContainer
.
referencePosition
.
latitude
);
v_vehiclePosition
.
longitude
:=
valueof
(
p_camVehicle
.
cam
.
camParameters
.
basicContainer
.
referencePosition
.
longitude
);
v_distanceToCollision
:=
LibItsGeoNetworking_Functions
.
f_distance
(
v_vehiclePosition
,
PICS_UC6_COLLISION_POINT
);
vc_longPosVectorRsu
:=
PICS_UC6_VEHICLE_POSITION
;
vc_longPosVectorRsu
.
latitude
:=
PICS_USECASE6_VEHICLE_POSITIONS
[
p_idx
].
latitude
;
vc_longPosVectorRsu
.
longitude
:=
PICS_USECASE6_VEHICLE_POSITIONS
[
p_idx
].
longitude
;
vc_geoArea
:=
PICS_UC6_VEHICLE_GEOAREA
;
vc_geoArea
.
area
.
geoAreaPosLatitude
:=
PICS_USECASE6_VEHICLE_POSITIONS
[
p_idx
].
latitude
;
vc_geoArea
.
area
.
geoAreaPosLongitude
:=
PICS_USECASE6_VEHICLE_POSITIONS
[
p_idx
].
longitude
;
f_send
(
v_payload
,
PICS_CAM_ITS_AID
);
// Compute time to collision point
if
(
v_vehicleSpeed
!=
0
)
{
var
float
v_timeToCollision
:=
v_distanceToCollision
/
int2float
(
v_vehicleSpeed
);
// Updade simulated CAM to setup the same distance to the collision point
// FIXME p_camSimu.cam.camParameters.basicContainer.referencePosition := PICS_USECASE6_VEHICLE_POSITIONS[p_idx];
// Update generationDeltaTime
p_camSimu
.
cam
.
generationDeltaTime
:=
f_getCurrentTime
()
mod
65536
;
// See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
v_payload
:=
valueof
(
f_adaptPayload
(
bit2oct
(
encvalue
(
valueof
(
p_camSimu
))),
PICS_CAM_BTP_DESTINATION_PORT
,
PICS_CAM_BTP_SOURCE_PORT
)
);
// FIXME Update GN
/*vc_longPosVectorRsu := PICS_UC6_VEHICLE_POSITION;
vc_longPosVectorRsu.latitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].latitude;
vc_longPosVectorRsu.longitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].longitude;
vc_geoArea := PICS_UC6_VEHICLE_GEOAREA;
vc_geoArea.area.geoAreaPosLatitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].latitude;
vc_geoArea.area.geoAreaPosLongitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].longitude;*/
// And send it
f_send
(
v_payload
,
PICS_CAM_ITS_AID
);
}
else
{
}
}
// End of function f_send_vehicle_cam
function
f_send
(
...
...
@@ -582,11 +617,8 @@ module ItsRSUsSimulator_Functions {
if
(
p_its_aid
==
36
)
{
// CAM
v_geoNetworkingPdu
:=
valueof
(
m_geoNwPdu
(
// FIXME Use PIXIT parameter to get a fully configurable template
m_geoNwTsbPacket_payload
(
// TODO modifes 'template (value) GnNonSecuredPacket m_geoNwBroadcastPacket' to set the field
f_incLocalSeqNumber
(),
m_geoNwShbPacket_payload
(
vc_longPosVectorRsu
,
-
,
-
,
valueof
(
p_payload
)
),
m_defaultLifetime
,
...
...
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn
View file @
1a79f5fe
...
...
@@ -584,7 +584,7 @@ module ItsRSUsSimulator_Pics {
group
camUseCase6SyncLocation
{
modulepar
LongPosVector
PICS_UC6_
DETECT
ION_POINT
:=
{
modulepar
LongPosVector
PICS_UC6_
COLLIS
ION_POINT
:=
{
gnAddr
:=
{
typeOfAddress
:=
e_manual
,
stationType
:=
e_unknown
,
...
...
@@ -1212,7 +1212,7 @@ module ItsRSUsSimulator_Pics {
expiryTime
:=
omit
,
protectedZoneLatitude
:=
435924080
,
protectedZoneLongitude
:=
103374530
,
protectedZoneRadius
:=
50
0
,
protectedZoneRadius
:=
50
,
protectedZoneID
:=
1
}
// End of PICS_USECASE9_PCZ_1
...
...
@@ -1379,17 +1379,17 @@ module ItsRSUsSimulator_Pics {
eventHistory
:=
PICS_Z1_D1_Hx
,
traces
:=
PICS_Z1_D1_Tx
,
roadWorksContainerExtended
:=
{
lightBarSirenInUse
:=
LightBarSirenInUse_sirenActivated_
,
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
availableForDriving
,
drivingLaneStatus
:=
'
1
0'B
drivingLaneStatus
:=
'0
001
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
PICS_Z1_D1_POS0
,
trafficFlowRule
:=
passTo
Lef
t
,
trafficFlowRule
:=
passTo
Righ
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z1_D1
...
...
@@ -1486,10 +1486,10 @@ module ItsRSUsSimulator_Pics {
eventHistory
:=
PICS_Z1_D2_Hx
,
traces
:=
PICS_Z1_D2_Tx
,
roadWorksContainerExtended
:=
{
lightBarSirenInUse
:=
LightBarSirenInUse_lightBarActivated_
,
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
availableForDriving
,
drivingLaneStatus
:=
'
11
00'B
drivingLaneStatus
:=
'00
11
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
...
...
@@ -1589,7 +1589,7 @@ module ItsRSUsSimulator_Pics {
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
closed
,
drivingLaneStatus
:=
'
1
100
1
'B
drivingLaneStatus
:=
'
0
100'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
...
...
@@ -1600,8 +1600,9 @@ module ItsRSUsSimulator_Pics {
deltaLongitude
:=
0
,
deltaAltitude
:=
0
},
trafficFlowRule
:=
passToRight
,
referenceDenms
:=
omit
trafficFlowRule
:=
passToLeft
,
referenceDenms
:=
{
}
}
}
// End of PICS_Z1_D3
...
...
@@ -1721,7 +1722,7 @@ module ItsRSUsSimulator_Pics {
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
PICS_Z2_D1_POS0
,
trafficFlowRule
:=
passTo
Lef
t
,
trafficFlowRule
:=
passTo
Righ
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z2_D1
...
...
@@ -1921,14 +1922,14 @@ module ItsRSUsSimulator_Pics {
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
closed
,
drivingLaneStatus
:=
'01'B
drivingLaneStatus
:=
'01
00
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
omit
,
trafficFlowRule
:=
passTo
Righ
t
,
trafficFlowRule
:=
passTo
Lef
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z2_D3
...
...
@@ -2248,7 +2249,7 @@ module ItsRSUsSimulator_Pics {
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
closed
,
drivingLaneStatus
:=
'01'B
drivingLaneStatus
:=
'01
00
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
...
...
@@ -2375,7 +2376,7 @@ module ItsRSUsSimulator_Pics {
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
PICS_Z4_D1_POS0
,
trafficFlowRule
:=
passTo
Lef
t
,
trafficFlowRule
:=
passTo
Righ
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z4_D1
...
...
@@ -2575,7 +2576,7 @@ module ItsRSUsSimulator_Pics {
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
closed
,
drivingLaneStatus
:=
'01'B
drivingLaneStatus
:=
'01
00
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
...
...
@@ -2702,7 +2703,7 @@ module ItsRSUsSimulator_Pics {
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
PICS_Z5_D1_POS0
,
trafficFlowRule
:=
passTo
Lef
t
,
trafficFlowRule
:=
passTo
Righ
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z5_D1
...
...
@@ -2902,14 +2903,14 @@ module ItsRSUsSimulator_Pics {
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
closed
,
drivingLaneStatus
:=
'01'B
drivingLaneStatus
:=
'01
00
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
omit
,
trafficFlowRule
:=
passTo
Righ
t
,
trafficFlowRule
:=
passTo
Lef
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z5_D3
...
...
@@ -3029,7 +3030,7 @@ module ItsRSUsSimulator_Pics {
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
PICS_Z6_D1_POS0
,
trafficFlowRule
:=
passTo
Lef
t
,
trafficFlowRule
:=
passTo
Righ
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z6_D1
...
...
@@ -3229,14 +3230,14 @@ module ItsRSUsSimulator_Pics {
lightBarSirenInUse
:=
omit
,
closedLanes
:=
{
hardShoulderStatus
:=
closed
,
drivingLaneStatus
:=
'01'B
drivingLaneStatus
:=
'01
00
'B
},
restriction
:=
omit
,
speedLimit
:=
PICS_SPEED_LIMIT
,
incidentIndication
:=
omit
,
recommendedPath
:=
omit
,
startingPointSpeedLimit
:=
omit
,
trafficFlowRule
:=
passTo
Righ
t
,
trafficFlowRule
:=
passTo
Lef
t
,
referenceDenms
:=
omit
}
}
// End of PICS_Z6_D3
...
...
@@ -4080,10 +4081,10 @@ module ItsRSUsSimulator_Pics {
modulepar
MapemParmListRsu
PICS_MAPEM_PARMS_RSUs
:=
{
PICS_Z1_M1_SL
,
// RSU #1
{
PICS_Z2_M1_SL
/*
{
intersections := omit,
roadSegments := omit
},
// RSU #2
}
*/
,
// RSU #2
PICS_Z2_M1_SL
,
// RSU #3
PICS_Z5_M1_SL
,
// RSU #4
PICS_Z4_M1_SL
,
// RSU #5
...
...
@@ -4667,7 +4668,7 @@ module ItsRSUsSimulator_Pics {
modulepar
SpatemParmRsu
PICS_SPATEM_PARMS_RSUs
:=
{
PICS_Z1_S1_SL_LIST
,
// RSU #1
{}
,
// RSU #2
PICS_Z2_S1_SL_LIST
/*{}*/
,
// RSU #2
PICS_Z2_S1_SL_LIST
,
// RSU #3
PICS_Z5_S1_SL_LIST
,
// RSU #4
PICS_Z4_S1_SL_LIST
,
// RSU #5
...
...
@@ -6105,12 +6106,11 @@ module ItsRSUsSimulator_Pics {
modulepar
IvimParmListRsu
PICS_IVIM_PARMS_RSUs
:=
{
PICS_Z1_I1_POS1
,
// RSU #1
{
PICS_Z2_I1_POS1
,
/*
{
provider := omit,
iviIdentificationNumber := omit,
iviContainers := omit
},
// RSU #2
PICS_Z2_I1_POS1
,
// RSU #3
},*/
// RSU #2 // RSU #3
PICS_Z5_I1_POS1
,
// RSU #4
PICS_Z4_I1_POS1
,
// RSU #5
{
...
...
@@ -6193,7 +6193,6 @@ module ItsRSUsSimulator_Pics {
* @desc CAM frequency timer
*/
modulepar
float
PICS_CAM_FREQUENCY
:=
1.0
;
modulepar
float
PICS_CAM_FREQUENCY_UC6
:=
0.1
;
/**
* @desc DENM frequency timer
...
...
@@ -6213,7 +6212,7 @@ module ItsRSUsSimulator_Pics {
/**
* @desc IVIM frequency timer
*/
modulepar
float
PICS_IVIM_FREQUENCY
:=
5
.0
;
modulepar
float
PICS_IVIM_FREQUENCY
:=
1
.0
;
}
// End of group generationFrequencies
...
...
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pixits.ttcn
View file @
1a79f5fe
...
...
@@ -38,6 +38,6 @@ module ItsRSUsSimulator_Pixits {
* @desc Indicate which zone to simulate
* @remark Used only for DENM
*/
modulepar
integer
PX_ETSI_ZONE_ID
:=
1
;
modulepar
integer
PX_ETSI_ZONE_ID
:=
2
;
}
// End of module ItsRSUsSimulator_Pixits
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Templates.ttcn
View file @
1a79f5fe
...
...
@@ -80,6 +80,8 @@ module ItsRSUsSimulator_Templates {
* @param p_seqNumber Sequence number of TSB packet
* @param p_sourceLongPosVec Long position vector of source
* @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit)
* @param p_trafficClass TODO
* @param p_payload TODO
*/
template
(
value
)
GnNonSecuredPacket
m_geoNwTsbPacket_payload
(
in
template
(
value
)
UInt16
p_seqNumber
,
...
...
@@ -91,6 +93,20 @@ module ItsRSUsSimulator_Templates {
payload
:=
p_payload
}
/**
* @desc Send template for GeoNetworking SHB Packet
* @param p_sourceLongPosVec Long position vector of source
* @param p_hopLimit The maximum number of hops (Default: c_defaultHopLimit)
* @param p_trafficClass TODO
* @param p_payload TODO
*/
template
(
value
)
GnNonSecuredPacket
m_geoNwShbPacket_payload
(
in
template
(
value
)
LongPosVector
p_sourceLongPosVec
,
in
template
(
value
)
Payload
p_payload
)
modifies
m_geoNwShbPacket
:=
{
payload
:=
p_payload
}
/**
* @desc Receive template for GeoNetworking Unicast Packet
* @param p_destinationShortPosVec Short position vector of destination
...
...
@@ -163,7 +179,7 @@ module ItsRSUsSimulator_Templates {
},
rawPayload
:=
?
}
}
}
// End of template mw_geoNwTsbPacketWithNextHeader_denm
/**
* @desc Receive template for GeoNetworking CAM Packet
...
...
@@ -174,19 +190,25 @@ module ItsRSUsSimulator_Templates {
template
(
present
)
GnNonSecuredPacket
mw_geoNwShbPacketWithNextHeader_cam
(
in
template
(
present
)
LongPosVector
p_sourceLongPosVec
:=
?
,
in
template
(
present
)
UInt8
p_hopLimit
:=
?
,
in
template
(
value
)
NextHeader
p_nextHeader
in
template
(
value
)
NextHeader
p_nextHeader
,
in
template
(
present
)
CAM
p_cam
:=
?
)
modifies
mw_geoNwShbPacket
:=
{
payload
:=
{
decodedPayload
:=
{
btpPacket
:=
mw_btpB
(
PICS_CAM_BTP_DESTINATION_PORT
,
PICS_CAM_BTP_SOURCE_PORT
,
?
{
decodedPayload
:=
{
camPacket
:=
p_cam
},
rawPayload
:=
?
}
)
},
rawPayload
:=
?
}
}
}
// End of template mw_geoNwShbPacketWithNextHeader_cam
}
// End of group geoNetworkingTemplates
...
...
@@ -280,15 +302,31 @@ module ItsRSUsSimulator_Templates {
}
}
// End of template m_camParm
// TODO Add ProtectedZone
template
(
present
)
CAM
mw_cam_stationID
(
in
template
(
present
)
BasicVehicleContainerHighFrequency
p_basicVehicleContainer
:=
mw_HF_BV_speed
(
?
),
in
template
(
value
)
StationID
p_stationID
,
in
template
(
present
)
ReferencePosition
p_referencePosition
:=
?
)
modifies
mw_camMsg_HF_BV
:=
{
header
:=
{
stationID
:=
p_stationID
},
cam
:=
{
camParameters
:=
{
basicContainer
:=
{
stationType
:=
?
,
referencePosition
:=
p_referencePosition
}
}
}
}
// End of template mw_cam_stationID
}
// End of group camTemplates
group
mapemTemplates
{
template
(
value
)
MAPEM
m_mapemParm
(
in
template
(
value
)
StationID
p_stationID
,
in
template
(
value
)
MapData
p_map
in
template
(
value
)
StationID
p_stationID
,
in
template
(
value
)
MapData
p_map
)
:=
{
header
:=
{
protocolVersion
:=
ItsPduHeader_protocolVersion_currentVersion_
,
...
...
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn
View file @
1a79f5fe
...
...
@@ -15,10 +15,6 @@ module ItsRSUsSimulator_TestCases {
import
from
LibItsGeoNetworking_TestSystem
all
;
import
from
LibItsGeoNetworking_TypesAndValues
all
;
import
from
LibItsGeoNetworking_Templates
all
;
import
from
LibItsGeoNetworking_Functions
{
function
f_distance
};
// LibItsDenm
import
from
LibItsDenm_Templates
all
;
...
...
@@ -188,62 +184,26 @@ module ItsRSUsSimulator_TestCases {
mw_geoNwInd
(
mw_geoNwPdu
(
mw_geoNwShbPacketWithNextHeader_cam
(
mw_longPosVectorPosition_vendors
(
PICS_UC6_VEHICLE_POSITION
.
gnAddr
.
mid
// Ignore RSUsimultor CAM messages
),
-
,
e_btpB
))))
{
// Receive a owner CAM message
repeat
;
}
[]
geoNetworkingPort
.
receive
(
mw_geoNwInd
(
mw_geoNwPdu
(
mw_geoNwShbPacketWithNextHeader_cam
(
-
,
/*mw_longPosVectorPosition_vendors(
PICS_UC6_VEHICLE_POSITION.gnAddr.mid // Ignore RSUsimultor CAM messages
),*/
-
,
e_btpB
))))
->
value
v_gnInd
{
// Receive a CAM message
tc_ac
.
stop
;
// Check if already processed
// Check if
it
already processed
v_stationID
:=
int2str
(
v_gnInd
.
msgIn
.
gnPacket
.
packet
.
payload
.
decodedPayload
.
btpPacket
.
payload
.
decodedPayload
.
camPacket
.
header
.
stationID
);
if
(
regexp
(
v_stationIDs
,
charstring
:
"("
&
v_stationID
&
",)"
,
0
)
==
""
)
{
// Vehicle already processed?
// Compute point intersection
var
float
v_distance
:=
LibItsGeoNetworking_Functions
.
f_distance
(
v_gnInd
.
msgIn
.
gnPacket
.
packet
.
extendedHeader
.
shbHeader
.
srcPosVector
,
PICS_UC6_DETECTION_POINT
);
if
(
ff_abs
(
v_distance
-
PICS_UC6_DETECTION_DISTANCE
)
<
PICS_UC6_DETECTION_EPSILLON
)
{
//log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " in of area (", ff_abs(v_distance - PICS_UC6_DETECTION_DISTANCE), ") ***");
v_vehicles
[
v_vehiclesIdx
]
:=
ItsRSUsSimulator
.
create
(
"Node"
&
int2char
(
v_vehiclesIdx
+
65
))
alive
;
v_vehicles
[
v_vehiclesIdx
].
start
(
f_startVehicleSimulator
(
v_vehicles
[
v_vehiclesIdx
],
v_vehiclesIdx
));
v_vehiclesIdx
:=
v_vehiclesIdx
+
1
;
v_stationIDs
:=
v_stationIDs
&
v_stationID
&
","
;
////log("*** " & testcasename() & ": DEBUG: New v_stationIDs: " & v_stationIDs & " ***");
}
else
{
// Nothing to do
//log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " out of area (", ff_abs(v_distance - PICS_UC6_DETECTION_DISTANCE), ") ***");
}
if
(
regexp
(
v_stationIDs
,
charstring
:
"("
&
v_stationID
&
",)"
,
0
)
==
""
)
{
// Vehicle not processed yet
v_vehicles
[
v_vehiclesIdx
]
:=
ItsRSUsSimulator
.
create
(
"Node"
&
int2char
(
v_vehiclesIdx
+
65
))
alive
;
v_vehicles
[
v_vehiclesIdx
].
start
(
f_startVehicleSimulator
(
v_vehicles
[
v_vehiclesIdx
],
v_gnInd
.
msgIn
.
gnPacket
.
packet
.
payload
.
decodedPayload
.
btpPacket
.
payload
.
decodedPayload
.
camPacket
));
v_vehiclesIdx
:=
v_vehiclesIdx
+
1
;
v_stationIDs
:=
v_stationIDs
&
v_stationID
&
","
;
log
(
"*** "
&
testcasename
()
&
": DEBUG: New v_stationIDs: "
&
v_stationIDs
&
" ***"
);
}
else
{
// Nothing to do
////
log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " already processed ***");
log
(
"*** "
&
testcasename
()
&
": DEBUG: StationID: "
&
v_stationID
&
" already processed ***"
);
}
tc_ac
.
start
;
repeat
;
}
[]
geoNetworkingPort
.
receive
(
mw_geoNwInd
(
mw_geoNwPdu
(
?
)))
{
// Receive a CAM message
//log("*** " & testcasename() & ": DEBUG: Recieving unsollicited message ***");
// Nothing to do, just for logging purposes
tc_ac
.
stop
;
tc_ac
.
start
;
repeat
;
}
[]
cfPort
.
receive
(
CfEvent
:?
)
->
value
v_cfEvent
{
//log("*** " & testcasename() & ": DEBUG: Configuration port command:", v_cfEvent, " ***");
if
(
f_process_cf_event
(
v_cfEvent
)
==
true
)
{
...
...
@@ -252,7 +212,7 @@ module ItsRSUsSimulator_TestCases {
all
component
.
stop
;
}
[]
tc_ac
.
timeout
{
//
log("*** " & testcasename() & ": DEBUG: No CAM message received ***");
log
(
"*** "
&
testcasename
()
&
": DEBUG: No CAM message received ***"
);
all
component
.
stop
;
}
}
// End of 'alt' statement
...
...
@@ -270,30 +230,39 @@ module ItsRSUsSimulator_TestCases {
function
f_startVehicleSimulator
(
in
ItsRSUsSimulator
p_component
,
in
integer
p_idx
in
CAM
p_camVehicle
)
runs
on
ItsRSUsSimulator
{
// Local variables
var
integer
v_idx
:=
0
;
var
template
(
value
)
CAM
v_cam
;
var
GeoNetworkingInd
v_gnInd
;
var
template
(
value
)
CAM
v_cam
Simu
;
////
log("*** " & testcasename() & ": DEBUG: >>> f_startVehicleSimulator: " & int2str(p_
idx
) & " ***");
f_initialiseVehicleSimulatorComponent
(
p_component
,
v_cam
);
log
(
"*** "
&
testcasename
()
&
": DEBUG: >>> f_startVehicleSimulator: "
&
int2str
(
p_
camVehicle
.
header
.
stationID
)
&
" ***"
);
f_initialiseVehicleSimulatorComponent
(
p_component
,
v_cam
Simu
);
tc_ca
_uc6
.
start
;
tc_ca
m
.
start
;
alt
{
[]
geoNetworkingPort
.
receive
(
mw_geoNwInd
(
mw_geoNwPdu
(
mw_geoNwShbPacketWithNextHeader_cam
(
-
,
-
,
e_btpB
,
mw_cam_stationID
(
-
,
p_camVehicle
.
header
.
stationID
)))))
->
value
v_gnInd
{
// Receive a CAM message from the processed vehicle
log
(
"*** "
&
testcasename
()
&
": DEBUG: Processing CAM #"
&
int2str
(
p_camVehicle
.
header
.
stationID
)
&
" ***"
);
tc_cam
.
stop
;
f_send_vehicle_cam
(
v_camSimu
,
v_gnInd
.
msgIn
.
gnPacket
.
packet
.
payload
.
decodedPayload
.
btpPacket
.
payload
.
decodedPayload
.
camPacket
);
tc_cam
.
start
;
}
/*[] cfPort.receive {
repeat;
}*/
[]
tc_ca_uc6
.
timeout
{
//log("*** " & testcasename() & ": DEBUG: Processing CAM #" & int2str(v_idx) & " ***");
tc_ca_uc6
.
stop
;
f_send_vehicle_cam
(
v_cam
,
v_idx
);
v_idx
:=
v_idx
+
1
;
if
(
v_idx
<
lengthof
(
PICS_USECASE6_VEHICLE_POSITIONS
))
{
tc_ca_uc6
.
start
;
repeat
;
}
// else, terminate
[]
tc_cam
.
timeout
{
log
(
"*** "
&
testcasename
()
&
": DEBUG: No CAM message received ***"
);
}
}
// End of 'altstep' statement
...
...