Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TTCN-3 Libraries
LibIts
Commits
eabe914e
Commit
eabe914e
authored
May 22, 2014
by
filatov
Browse files
ITS STF449 branch merged into trunk
parents
f4e05738
fc3f08f4
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
asn1/DENM/DENM.asn
View file @
eabe914e
...
@@ -7,7 +7,7 @@ DEFINITIONS AUTOMATIC TAGS ::=
...
@@ -7,7 +7,7 @@ DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
BEGIN
IMPORTS
IMPORTS
ItsPduHeader, CauseCode, StationID, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LaneNumber, LightBarSirenInUse, PathHistory, Road
Class
, HeightLonCarr, PosLonCarr, PosPillar, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType FROM ITS-Container {
ItsPduHeader, CauseCode, StationID, Speed, InformationQuality, ReferencePosition, ClosedLanes, DangerousGoodsExtended, Heading, LaneNumber, LightBarSirenInUse, PathHistory, Road
Type
, HeightLonCarr, PosLonCarr, PosPillar, PosCentMass, PositioningSolutionType, RequestResponseIndication, StationType, SpeedLimit, StationarySince, TimestampIts, WheelBaseVehicle, TurningRadius, PosFrontAx, PositionOfOccupants, Temperature, VehicleMass, VehicleIdentification, EnergyStorageType FROM ITS-Container {
itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)
itu-t (0) identified-organization (4) etsi (0) itsDomain (5) wg1 (1) ts (102894) cdd (2) version (1)
};
};
...
@@ -49,7 +49,7 @@ LocationContainer ::= SEQUENCE {
...
@@ -49,7 +49,7 @@ LocationContainer ::= SEQUENCE {
eventSpeed Speed OPTIONAL,
eventSpeed Speed OPTIONAL,
eventPositionHeading Heading OPTIONAL,
eventPositionHeading Heading OPTIONAL,
traces Traces,
traces Traces,
road
Class RoadClass
OPTIONAL
road
Type RoadType
OPTIONAL
}
}
ImpactReductionContainer ::= SEQUENCE {
ImpactReductionContainer ::= SEQUENCE {
...
...
asn1/ITS-Container/ITS-Container.asn
View file @
eabe914e
...
@@ -8,7 +8,7 @@ BEGIN
...
@@ -8,7 +8,7 @@ BEGIN
ItsPduHeader ::= SEQUENCE {
ItsPduHeader ::= SEQUENCE {
protocolVersion INTEGER{ currentVersion(1) } (0..255),
protocolVersion INTEGER{ currentVersion(1) } (0..255),
messageID INTEGER{ denm(1),cam(2), poi(3) } (0..255),
messageID INTEGER{ denm(1),cam(2), poi(3)
, spat(4), map(5), ivi(6), ivs(7), ev-rsr(8)
} (0..255),
stationID StationID
stationID StationID
}
}
...
@@ -18,33 +18,50 @@ ReferencePosition ::= SEQUENCE {
...
@@ -18,33 +18,50 @@ ReferencePosition ::= SEQUENCE {
latitude Latitude,
latitude Latitude,
longitude Longitude,
longitude Longitude,
positionConfidenceEllipse PosConfidenceEllipse ,
positionConfidenceEllipse PosConfidenceEllipse ,
elevation Elevation
altitude Altitude
}
}
DeltaReferencePosition ::= SEQUENCE {
DeltaReferencePosition ::= SEQUENCE {
deltaLatitude DeltaLatitude,
deltaLatitude DeltaLatitude,
deltaLongitude DeltaLongitude,
deltaLongitude DeltaLongitude,
delta
Elevation DeltaElevation
delta
Altitude DeltaAltitude
}
}
Longitude ::= INTEGER { oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001) } (-1799999999..1800000001) -- multiples of 0.1 microdegree
Longitude ::= INTEGER { oneMicrodegreeEast (10), oneMicrodegreeWest (-10), unavailable(1800000001) } (-1799999999..1800000001) -- multiples of 0.1 microdegree
Latitude ::= INTEGER { oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001) } (-900000000..900000001) -- multiples of 0.1 microdegree
Latitude ::= INTEGER { oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10), unavailable(900000001) } (-900000000..900000001) -- multiples of 0.1 microdegree
Elevation
::= SEQUENCE {
Altitude
::= SEQUENCE {
elevationValue Elevation
Value,
altitudeValue Altitude
Value,
elevation
Confidence
Elevation
Confidence
altitude
Confidence
Altitude
Confidence
}
}
ElevationValue ::= INTEGER { seaLevel(0), oneMeter(1), unavailable(7191) } (-1000..7191)
AltitudeValue ::= INTEGER { seaLevel(0), oneCentimeter(1), unavailable(800001) } (-100000..800001)
ElevationConfidence ::= INTEGER { withinOneMeter(1), outOfRange(126), unavailable(127) } (1..127)
AltitudeConfidence ::= ENUMERATED {
alt-000-01 (0),
alt-000-02 (1),
alt-000-05 (2),
alt-000-10 (3),
alt-000-20 (4),
alt-000-50 (5),
alt-001-00 (6),
alt-002-00 (7),
alt-005-00 (8),
alt-010-00 (9),
alt-020-00 (10),
alt-050-00 (11),
alt-100-00 (12),
alt-200-00 (13),
outOfRange (14),
unavailable (15)
}
DeltaLongitude ::= INTEGER { oneMicrodegreeEast (10), oneMicrodegreeWest (-10) } (-131072..131071) -- multiples of 0.1 microdegree
DeltaLongitude ::= INTEGER { oneMicrodegreeEast (10), oneMicrodegreeWest (-10) } (-131072..131071) -- multiples of 0.1 microdegree
DeltaLatitude ::= INTEGER { oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) } (-131072..131071) -- multiples of 0.1 microdegree
DeltaLatitude ::= INTEGER { oneMicrodegreeNorth (10), oneMicrodegreeSouth (-10) } (-131072..131071) -- multiples of 0.1 microdegree
Delta
Elevation
::= INTEGER { one
M
eterUp (1), one
M
eterDown (-1), unavailable(128) } (-127..128)
Delta
Altitude
::= INTEGER { one
Centim
eterUp (1), one
Centim
eterDown (-1), unavailable(128
00
) } (-127
00
..128
00
)
PosConfidenceEllipse ::= SEQUENCE {
PosConfidenceEllipse ::= SEQUENCE {
...
@@ -70,13 +87,13 @@ PtActivationType ::= INTEGER { undefinedCodingType(0), r09-16CodingType(1), vdv-
...
@@ -70,13 +87,13 @@ PtActivationType ::= INTEGER { undefinedCodingType(0), r09-16CodingType(1), vdv-
PtActivationData ::= OCTET STRING (SIZE(1..20))
PtActivationData ::= OCTET STRING (SIZE(1..20))
AccelerationControl ::= BIT STRING {
AccelerationControl ::= BIT STRING {
brakePedal
Active
(0),
brakePedal
Engaged
(0),
gasPedal
Active
(1),
gasPedal
Engaged
(1),
emergencyBrake
Active
(2),
emergencyBrake
Engaged
(2),
collisionWarning
Active
(3),
collisionWarning
Engaged
(3),
acc
Active
(4),
acc
Engaged
(4),
cruiseControl (5),
cruiseControl
Engaged
(5),
speedLimiter
Active
(6)
speedLimiter
Engaged
(6)
} (SIZE(7))
} (SIZE(7))
...
@@ -159,7 +176,7 @@ SemiAxisLength ::= INTEGER{ oneCentimeter(1), outOfRange(4094), unavailable(4095
...
@@ -159,7 +176,7 @@ SemiAxisLength ::= INTEGER{ oneCentimeter(1), outOfRange(4094), unavailable(4095
DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4) } (0..255)
DangerousEndOfQueueSubCauseCode ::= INTEGER {unavailable(0), suddenEndOfQueue(1), queueOverHill(2), queueAroundBend(3), queueInTunnel(4) } (0..255)
DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrake(1), preCrashSystem
Activat
ed(2), esp
Activat
ed(3), abs
Activat
ed(4), aeb
Activat
ed(5), brakeWarning
Activat
ed(6), collisionRiskWarning
Activat
ed(7) } (0..255)
DangerousSituationSubCauseCode ::= INTEGER {unavailable(0), emergencyElectronicBrake
Engaged
(1), preCrashSystem
Engag
ed(2), esp
Engag
ed(3), abs
Engag
ed(4), aeb
Engag
ed(5), brakeWarning
Engag
ed(6), collisionRiskWarning
Engag
ed(7) } (0..255)
VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8)} (0..255)
VehicleBreakdownSubCauseCode ::= INTEGER {unavailable(0), lackOfFuel (1), lackOfBatteryPower (2), engineProblem(3), transmissionProblem(4), engineCoolingProblem(5), brakingSystemProblem(6), steeringProblem(7), tyrePuncture(8)} (0..255)
...
@@ -316,7 +333,7 @@ PosCentMass ::= INTEGER { tenCentimeters(1), unavailable(63) } (0..63)
...
@@ -316,7 +333,7 @@ PosCentMass ::= INTEGER { tenCentimeters(1), unavailable(63) } (0..63)
RequestResponseIndication ::= ENUMERATED { request(0), response(1) }
RequestResponseIndication ::= ENUMERATED { request(0), response(1) }
SpeedLimit ::= INTEGER { oneKmPerHour(1) } (0..
150
)
SpeedLimit ::= INTEGER { oneKmPerHour(1) } (0..
255
)
StationarySince ::= ENUMERATED { lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), over15Minutes(3) }
StationarySince ::= ENUMERATED { lessThan1Minute(0), lessThan2Minutes(1), lessThan15Minutes(2), over15Minutes(3) }
...
@@ -371,8 +388,6 @@ VehicleLength ::= SEQUENCE {
...
@@ -371,8 +388,6 @@ VehicleLength ::= SEQUENCE {
vehicleLengthValue VehicleLengthValue,
vehicleLengthValue VehicleLengthValue,
vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication
vehicleLengthConfidenceIndication VehicleLengthConfidenceIndication
}
}
WMInumber ::= IA5String (SIZE(1..3))
VehicleLengthValue ::= INTEGER { tenCentimeters(1), outOfRange(1022), unavailable(1023) } (1..1023)
VehicleLengthValue ::= INTEGER { tenCentimeters(1), outOfRange(1022), unavailable(1023) } (1..1023)
...
@@ -383,11 +398,11 @@ VehicleWidth ::= INTEGER { tenCentimeters(1), outOfRange(61), unavailable(62) }
...
@@ -383,11 +398,11 @@ VehicleWidth ::= INTEGER { tenCentimeters(1), outOfRange(61), unavailable(62) }
PathHistory::= SEQUENCE (SIZE(0..23)) OF PathPoint
PathHistory::= SEQUENCE (SIZE(0..23)) OF PathPoint
EmergencyPriority ::=
INTEGER
{ requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1) } (
0..1
)
EmergencyPriority ::=
BIT STRING
{ requestForRightOfWay(0), requestForFreeCrossingAtATrafficLight(1) } (
SIZE(2)
)
InformationQuality ::= INTEGER { unavailable(0), lowest(1), highest(7) } (0..7)
InformationQuality ::= INTEGER { unavailable(0), lowest(1), highest(7) } (0..7)
Road
Class
::= ENUMERATED {
Road
Type
::= ENUMERATED {
urban-NoStructuralSeparationToOppositeLanes(0),
urban-NoStructuralSeparationToOppositeLanes(0),
urban-WithStructuralSeparationToOppositeLanes(1),
urban-WithStructuralSeparationToOppositeLanes(1),
nonUrban-NoStructuralSeparationToOppositeLanes(2),
nonUrban-NoStructuralSeparationToOppositeLanes(2),
...
@@ -415,16 +430,17 @@ YawRateValue ::= INTEGER { straight(0), degSec-000-01ToRight(-1), degSec-000-01T
...
@@ -415,16 +430,17 @@ YawRateValue ::= INTEGER { straight(0), degSec-000-01ToRight(-1), degSec-000-01T
-- LSB units of 0.01 degrees per second
-- LSB units of 0.01 degrees per second
YawRateConfidence ::= ENUMERATED {
YawRateConfidence ::= ENUMERATED {
unavailable
(0),
degSec-000-01
(0),
degSec-
1
00-0
0
(1),
-- within 100 deg/sec
degSec-
0
00-0
5
(1),
degSec-0
1
0-
0
0 (2),
-- within 10 deg/sec
degSec-0
0
0-
1
0 (2),
degSec-00
5
-00 (3),
-- within 5 deg/sec
degSec-00
1
-00 (3),
degSec-00
1
-00 (4),
-- within 1 deg/sec
degSec-00
5
-00 (4),
degSec-0
0
0-
1
0 (5),
-- within 0.1 deg/sec
degSec-0
1
0-
0
0 (5),
degSec-
0
00-0
5
(6),
-- within 0.05 deg/sec
degSec-
1
00-0
0
(6),
degSec-000-01 (7), -- within 0.01 deg/sec
outOfRange (7),
outOfRang
e (8)
unavailabl
e (8)
}
}
END
END
ttcn/BTP/LibItsBtp_TypesAndValues.ttcn
View file @
eabe914e
...
@@ -12,10 +12,10 @@ module LibItsBtp_TypesAndValues {
...
@@ -12,10 +12,10 @@ module LibItsBtp_TypesAndValues {
// LibIts
// LibIts
import
from
CAM_PDU_Descriptions
language
"ASN.1:1997"
{
import
from
CAM_PDU_Descriptions
language
"ASN.1:1997"
{
type
C
amPdu
type
C
AM
};
};
import
from
DENM_PDU_Descriptions
language
"ASN.1:1997"
{
import
from
DENM_PDU_Descriptions
language
"ASN.1:1997"
{
type
D
enmPdu
type
D
ENM
};
};
group
btpPdus
{
group
btpPdus
{
...
@@ -84,6 +84,8 @@ module LibItsBtp_TypesAndValues {
...
@@ -84,6 +84,8 @@ module LibItsBtp_TypesAndValues {
group
btpPayload
{
group
btpPayload
{
type
octetstring
BtpRawPayload
;
/**
/**
* @desc The payload of the BTP packet
* @desc The payload of the BTP packet
* @member decodedPayload The decoded payload
* @member decodedPayload The decoded payload
...
@@ -91,7 +93,7 @@ module LibItsBtp_TypesAndValues {
...
@@ -91,7 +93,7 @@ module LibItsBtp_TypesAndValues {
*/
*/
type
record
BtpPayload
{
type
record
BtpPayload
{
DecodedBtpPayload
decodedPayload
optional
,
DecodedBtpPayload
decodedPayload
optional
,
octetstring
rawPayload
BtpRawPayload
rawPayload
}
}
/**
/**
...
@@ -101,8 +103,8 @@ module LibItsBtp_TypesAndValues {
...
@@ -101,8 +103,8 @@ module LibItsBtp_TypesAndValues {
* @member
* @member
*/
*/
type
union
DecodedBtpPayload
{
type
union
DecodedBtpPayload
{
C
amPdu
camPacket
,
C
AM
camPacket
,
D
enmPdu
denmPacket
D
ENM
denmPacket
}
with
{
}
with
{
encode
(
camPacket
)
"LibItsCam_asn1"
;
encode
(
camPacket
)
"LibItsCam_asn1"
;
encode
(
denmPacket
)
"LibItsDenm_asn1"
encode
(
denmPacket
)
"LibItsDenm_asn1"
...
@@ -148,7 +150,7 @@ module LibItsBtp_TypesAndValues {
...
@@ -148,7 +150,7 @@ module LibItsBtp_TypesAndValues {
type
boolean
UtResult
;
type
boolean
UtResult
;
}
}
with
{
with
{
encode
"LibItsCommon
_TypesAndValues
"
encode
"LibItsCommon"
}
}
/**
/**
...
@@ -170,5 +172,5 @@ module LibItsBtp_TypesAndValues {
...
@@ -170,5 +172,5 @@ module LibItsBtp_TypesAndValues {
}
}
with
{
with
{
encode
"LibItsBtp
_TypesAndValues
"
encode
"LibItsBtp"
}
}
ttcn/CAM/LibItsCam_Functions.ttcn
View file @
eabe914e
/**
/**
* @author
ETSI / STF405
* @author ETSI / STF405
/ STF449
* @version
$URL$
* @version $URL$
*
$Id$
* $Id$
* @desc
Module containing common functions for ITS CAM
* @desc Module containing common functions for ITS CAM
*
*
*/
*/
module
LibItsCam_Functions
{
module
LibItsCam_Functions
{
...
@@ -14,9 +14,10 @@ module LibItsCam_Functions {
...
@@ -14,9 +14,10 @@ module LibItsCam_Functions {
// LibIts
// LibIts
import
from
LibItsCam_TestSystem
all
;
import
from
LibItsCam_TestSystem
all
;
import
from
LibItsCam_Templates
all
;
import
from
LibItsCam_Templates
all
;
import
from
LibItsCam_Pixits
all
;
import
from
LibItsCam_TypesAndValues
all
;
import
from
LibItsCam_TypesAndValues
all
;
import
from
LibItsCommon_Functions
all
;
import
from
LibItsCommon_Functions
all
;
import
from
LibItsCommon_TypesAndValues
all
;
import
from
ITS_Container
language
"ASN.1:1997"
all
;
import
from
CAM_PDU_Descriptions
language
"ASN.1:1997"
all
;
import
from
CAM_PDU_Descriptions
language
"ASN.1:1997"
all
;
import
from
DENM_PDU_Descriptions
language
"ASN.1:1997"
all
;
import
from
DENM_PDU_Descriptions
language
"ASN.1:1997"
all
;
...
@@ -31,7 +32,7 @@ module LibItsCam_Functions {
...
@@ -31,7 +32,7 @@ module LibItsCam_Functions {
utPort
.
send
(
p_init
);
utPort
.
send
(
p_init
);
tc_wait
.
start
;
tc_wait
.
start
;
alt
{
alt
{
[]
utPort
.
receive
(
UtResult
:
true
)
{
[]
utPort
.
receive
(
Ut
Initialize
Result
:
true
)
{
tc_wait
.
stop
;
tc_wait
.
stop
;
log
(
"*** f_utInitializeIut: INFO: IUT initialized ***"
);
log
(
"*** f_utInitializeIut: INFO: IUT initialized ***"
);
}
}
...
@@ -55,12 +56,12 @@ module LibItsCam_Functions {
...
@@ -55,12 +56,12 @@ module LibItsCam_Functions {
* @desc Triggers event from the application layer
* @desc Triggers event from the application layer
* @param p_event The event to trigger.
* @param p_event The event to trigger.
*/
*/
function
f_utTriggerEvent
(
template
(
value
)
Ut
Event
p_event
)
runs
on
ItsCam
{
function
f_utTriggerEvent
(
template
(
value
)
Ut
CamTrigger
p_event
)
runs
on
ItsCam
{
var
template
(
value
)
UtTrigger
v_utMsg
:=
{
p_event
};
utPort
.
send
(
p_event
);
utPort
.
send
(
v_utMsg
)
;
tc_wait
.
start
;
alt
{
alt
{
[]
utPort
.
receive
(
UtResult
:
true
)
{
[]
utPort
.
receive
(
Ut
CamTrigger
Result
:
true
)
{
tc_wait
.
stop
;
tc_wait
.
stop
;
}
}
[]
utPort
.
receive
{
[]
utPort
.
receive
{
...
@@ -79,13 +80,13 @@ module LibItsCam_Functions {
...
@@ -79,13 +80,13 @@ module LibItsCam_Functions {
* @param p_event The event to check.
* @param p_event The event to check.
* @param p_discard The event should not appear. Default value: FALSE.
* @param p_discard The event should not appear. Default value: FALSE.
*/
*/
function
f_utCheckEvent
(
template
(
value
)
Ut
Event
p_event
,
boolean
p_discard
)
runs
on
ItsCam
{
function
f_utCheckEvent
(
template
(
value
)
Ut
CamTrigger
p_event
,
boolean
p_discard
:=
false
)
runs
on
ItsCam
{
var
template
(
value
)
UtCheck
v_utMsg
:=
{
p_event
};
var
template
(
value
)
UtCheck
v_utMsg
:=
{
p_event
};
utPort
.
send
(
v_utMsg
);
utPort
.
send
(
v_utMsg
);
tc_wait
.
start
;
tc_wait
.
start
;
alt
{
alt
{
[]
utPort
.
receive
(
UtResult
:
true
)
{
[]
utPort
.
receive
(
Ut
CamTrigger
Result
:
true
)
{
tc_wait
.
stop
;
tc_wait
.
stop
;
if
(
p_discard
==
false
)
{
if
(
p_discard
==
false
)
{
log
(
"*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"
);
log
(
"*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"
);
...
@@ -95,7 +96,7 @@ module LibItsCam_Functions {
...
@@ -95,7 +96,7 @@ module LibItsCam_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
}
}
}
}
[]
utPort
.
receive
(
UtResult
:
false
)
{
[]
utPort
.
receive
(
Ut
CamTrigger
Result
:
false
)
{
tc_wait
.
stop
;
tc_wait
.
stop
;
if
(
p_discard
==
false
)
{
if
(
p_discard
==
false
)
{
log
(
"*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"
);
log
(
"*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"
);
...
@@ -107,7 +108,7 @@ module LibItsCam_Functions {
...
@@ -107,7 +108,7 @@ module LibItsCam_Functions {
}
}
[]
tc_wait
.
timeout
{
[]
tc_wait
.
timeout
{
log
(
"*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"
);
log
(
"*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
}
[
else
]
{
// Shortcut defaults
[
else
]
{
// Shortcut defaults
repeat
;
repeat
;
...
@@ -149,7 +150,7 @@ module LibItsCam_Functions {
...
@@ -149,7 +150,7 @@ module LibItsCam_Functions {
* @desc basic default behaviour handling
* @desc basic default behaviour handling
*/
*/
altstep
a_default
()
runs
on
ItsCam
{
altstep
a_default
()
runs
on
ItsCam
{
[]
camPort
.
receive
(
mw_camInd
(
mw_camMsg_any
)){
[]
camPort
.
receive
(
mw_camInd
(
mw_camMsg_any
)){
log
(
"*** a_default: INFO: CAM message received in default ***"
);
log
(
"*** a_default: INFO: CAM message received in default ***"
);
vc_camReceived
:=
true
;
vc_camReceived
:=
true
;
...
@@ -185,9 +186,22 @@ module LibItsCam_Functions {
...
@@ -185,9 +186,22 @@ module LibItsCam_Functions {
f_utInitializeIut
(
m_camInitialize
);
f_utInitializeIut
(
m_camInitialize
);
// basic default altstep
// basic default altstep
activate
(
a_default
());
activate
(
a_default
());
camPort
.
clear
;
tc_ac
.
start
;
alt
{
[]
camPort
.
receive
(
mw_camInd
(
mw_camMsg_any
)){
tc_ac
.
stop
;
log
(
"*** "
&
testcasename
()
&
": INFO: Received initial CAM ***"
);
}
[]
tc_ac
.
timeout
{
log
(
"*** "
&
testcasename
()
&
": INCONC: Initial CAM not received ***"
);
f_selfOrClientSyncAndVerdictPreamble
(
"error"
,
e_timeout
);
}
}
}
// end f_prInitialState
}
// end f_prInitialState
}
// end of preambles
}
// end of preambles
...
@@ -202,100 +216,33 @@ module LibItsCam_Functions {
...
@@ -202,100 +216,33 @@ module LibItsCam_Functions {
}
}
}
// end group postambles
}
// end group postambles
group
otherFunctions
{
/** @desc function to generate a random bitstring value
* corresponding to 1 bit position set to 1 (eg '00010000', '01000000', ...)
* @see f_random
* @param p_length bitstring length - max 15
* @return bitstring
*
*/
function
f_bitPositionRandom
(
in
integer
p_length
)
return
bitstring
{
//Variables
var
bitstring
v_random
:=
'1'
B
;
var
integer
i
:=
0
;
for
(
i
:=
0
;
i
<
(
p_length
-
1
);
i
:=
i
+
1
)
{
v_random
:=
'0'
B
&
v_random
;
}
v_random
:=
v_random
<<
f_random
(
0
,
(
p_length
-
1
));
log
(
"*** f_bitPositionRandom: INFO: OK - random value = "
&
bit2str
(
v_random
)
&
" ***"
);
return
v_random
;
}
// end function f_bitPositionRandom
}
// end group otherFunctions
group
camPositionFunctions
{
group
getIutFunctions
{
/**
* @desc Function to get the PT Line Description
* @see PX_PTLINE_COURSE, PX_PTLINE_REF, PX_PTLINE_ROUTE
*/
function
f_getIutPtLineDescription
()
return
PTLineDescription
{
var
PTLineDescription
v_ptLineDescription
:=
{
""
,
""
,
""
};
v_ptLineDescription
:=
{
PX_PTLINE_COURSE
,
PX_PTLINE_REF
,
PX_PTLINE_ROUTE
};
return
v_ptLineDescription
;
}
// end function f_getIutPtLineDescription
}
// end getIutFunctions
group
getTesterFunctions
{
/**
* @desc Gets tester's station characteristics
* @return Station characteristics
* @see PX_TESTER_IS_MOBILE, PX_TESTER_IS_PRIVATE, PX_TESTER_IS_PHYSICAL_RELEVANT
*/
function
f_getTesterStationCharacteristics
()
return
CoopAwareness
.
stationCharacteristics
{
var
CoopAwareness
.
stationCharacteristics
v_stationCharacteristics
:=
{
true
,
true
,
true
};
v_stationCharacteristics
:=
{
PX_TESTER_IS_MOBILE
,
PX_TESTER_IS_PRIVATE
,
PX_TESTER_IS_PHYSICAL_RELEVANT
};
return
v_stationCharacteristics
;
}
// end f_getTesterStationCharacteristics
/**
/**
* @desc Creates a valid CAM for tester
* @desc Compute a position using a reference position, a distance
* and an orientation
*
* @param p_referencePosition The base reference position.
* @param p_offSet Distance to the reference position (in meter).
*
* @return The new reference position.
*/
*/
function
f_getTesterValidCam
()
function
f_computePositionUsingDistance
(
in
ReferencePosition
p_referencePosition
,
in
integer
p_offSet
)
return
ReferencePosition
{
return
template
(
value
)
CamPdu
{
var
ReferencePosition
v_referencePosition
:=
p_referencePosition
;
var
CoopAwareness
.
stationCharacteristics
v_stationCharacteristics
;
log
(
"*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***"
);
fx_computePositionUsingDistance
(
if
(
PX_TESTER_IS_MOBILE
==
false
)
{
p_referencePosition
.
latitude
,
// basic IRS
p_referencePosition
.
longitude
,
v_stationCharacteristics
:=
{
false
,
PX_TESTER_IS_PRIVATE
,
PX_TESTER_IS_PHYSICAL_RELEVANT
};
p_offSet
,
return
m_camMsg_irs
(
p_referencePosition
.
positionConfidenceEllipse
.
semiMajorOrientation
.
headingValue
,
f_getCurrentTime
(),
v_referencePosition
.
latitude
,
f_getTsStationId
(),
v_referencePosition
.
longitude
v_stationCharacteristics
,
);
m_tsPosition
return
v_referencePosition
;
);
}
}
else
{
// Vehicle
v_stationCharacteristics
:=
{
true
,
PX_TESTER_IS_PRIVATE
,
PX_TESTER_IS_PHYSICAL_RELEVANT
};
return
m_camMsg_vehicle
(
f_getCurrentTime
(),
f_getTsStationId
(),
v_stationCharacteristics
,
m_tsPosition
);
}
}
// end f_getTesterValidCam
}
// end g
etTester
Functions
}
// end g
roup camPosition
Functions
}
// end LibItsCam_Functions
}
// end LibItsCam_Functions
\ No newline at end of file
ttcn/CAM/LibItsCam_Pics.ttcn
View file @
eabe914e
/**
/**
*
@author
ETSI / STF405
*
@author
ETSI / STF405
/ STF449
* @version
$URL$
*
@version
$URL$
*
$Id$
*
$Id$
*
@desc
CAM PICS
*
@desc
CAM PICS
*
*
*/
*/
module
LibItsCam_Pics
{
module
LibItsCam_Pics
{
...
@@ -13,110 +13,82 @@ module LibItsCam_Pics {
...
@@ -13,110 +13,82 @@ module LibItsCam_Pics {
group
camPics
{