Commit 1328993c authored by berge's avatar berge
Browse files

Aligned DENM test suite to latest TB-approved base spec

parent fedb5c29
......@@ -29,5 +29,9 @@ module LibItsCommon_Pixits {
*/
modulepar integer PX_TS_LONGITUDE := 70546480;
/**
* @desc Tolerance to be applied when checking timestamps (ms)
*/
modulepar integer PX_TIME_DELTA := 1000;
} // end LibItsCommon_Pixits
\ No newline at end of file
......@@ -295,8 +295,7 @@ module LibItsDenm_Functions {
log("*** " & __SCOPE__ & ": INFO: Timeout while awaiting the reception of a message ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
}
}
}
} // end receiveFunctions
......@@ -314,18 +313,6 @@ module LibItsDenm_Functions {
return ((p_sequenceNumber + 1) mod 65536);
}
/**
* @desc Increases the data version and handles the special case where the
* data version reaches the limit of 254(255 is the special cancellation value)
* and will be reset to 0.
* @param p_dataVersion The data version to increase.
* @return The increased data version.
*/
function f_increaseDataVersion(in DataVersion p_dataVersion) return DataVersion {
// if maximum number of 254 reached, reset it to 0
return ((p_dataVersion + 1) mod 255);
}
} // end group miscellaneousFunctions
} // end LibItsDenm_Functions
\ No newline at end of file
......@@ -10,6 +10,7 @@ module LibItsDenm_Templates {
//LibIts
import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Functions all;
import from LibItsCommon_Pixits all;
import from LibItsDenm_TestSystem all;
import from LibItsDenm_TypesAndValues all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
......@@ -232,6 +233,18 @@ module LibItsDenm_Templates {
} // end headerTemplates
group timeTemplates {
/**
* @desc Receive template for TimestampIts check with delta
* @param p_time The expected timestamp
*/
template TimestampIts mw_timestampIts_withDelta(
in template (value) TimestampIts p_time
) := (p_time-PX_TIME_DELTA .. p_time+PX_TIME_DELTA);
} // end timeTemplates
group positionTemplates {
/**
......@@ -348,7 +361,7 @@ module LibItsDenm_Templates {
template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation(
template (value) ActionID p_actionID
) := {
management := m_denmMgmtCon(p_actionID, c_dataVersionCancellation),
management := m_denmMgmtCon(p_actionID, -, true),
situation := omit,
location := omit,
alacarte := omit
......@@ -361,24 +374,27 @@ module LibItsDenm_Templates {
/**
* @desc Send template for Management Container
* @param p_actionID The action id
* @param p_dataVersion The data version
* @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_detectionTime The detection time (Default: current time)
* @param p_referenceTime The reference time (Default: current time)
*/
template (value) ManagementContainer m_denmMgmtCon(
template (value) ActionID p_actionID,
template (value) DataVersion p_dataVersion,
template (value) boolean p_isNegation := false,
template (value) boolean p_isCancellation := false,
template (omit) ValidityDuration p_validityDuration := omit,
template (omit) TransmissionInterval p_transmissionInterval := omit,
template (value) TimestampIts p_detectionTime := f_getCurrentTime()
template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
template (value) TimestampIts p_referenceTime := f_getCurrentTime()
) := {
actionID := p_actionID,
dataVersion := p_dataVersion,
detectionTime := p_detectionTime,
referenceTime := p_referenceTime,
isNegation := p_isNegation,
isCancellation := p_isCancellation,
eventPosition := m_tsPosition,
relevanceDistance := lessThan50m,
relevanceTrafficDirection := allTrafficDirection,
......@@ -389,22 +405,25 @@ module LibItsDenm_Templates {
/**
* @desc Receive template for Management Container
* @param p_actionID The expected action id
* @param p_dataVersion The expected data version (Default: any)
* @param p_isNegation The expected negation flag (Default: false)
* @param p_referenceTime The reference time (Default: any)
* @param p_isNegation The expected negation flag (Default: false)
* @param p_isCancellation The expected cancellation flag (Default: false)
* @param p_validityDuration The expected validity duration (Default: any or omit)
* @param p_transmissionInterval The expected transmission interval (Default: any or omit)
*/
template (present) ManagementContainer mw_denmMgmtCon(
template (present) ActionID p_actionID,
template (present) DataVersion p_dataVersion := ?,
template (present) TimestampIts p_referenceTime := ?,
template (present) boolean p_isNegation := false,
template (present) boolean p_isCancellation := false,
template ValidityDuration p_validityDuration := *,
template TransmissionInterval p_transmissionInterval := *
) := {
actionID := p_actionID,
dataVersion := p_dataVersion,
detectionTime := ?,
referenceTime := p_referenceTime,
isNegation := p_isNegation,
isCancellation := p_isCancellation,
eventPosition := ?,
relevanceDistance := ?,
relevanceTrafficDirection := allTrafficDirection,
......@@ -428,9 +447,10 @@ module LibItsDenm_Templates {
*/
template (present) ManagementContainer mw_anyDenmMgmtCon := {
actionID := ?,
dataVersion := ?,
detectionTime := ?,
referenceTime := ?,
isNegation := ?,
isCancellation := ?,
eventPosition := ?,
relevanceDistance := ?,
relevanceTrafficDirection := ?,
......@@ -450,12 +470,12 @@ module LibItsDenm_Templates {
/**
* @desc Receive template for Management Container with the given data version
* @param p_dataVersion The expected data version (Default: any)
* @param p_referenceTime The expected reference time (Default: any)
*/
template (present) ManagementContainer mw_denmMgmtConWithDataVersion(
template (present) DataVersion p_dataVersion := ?
template (present) ManagementContainer mw_denmMgmtConWithReferenceTime(
template (present) TimestampIts p_referenceTime := ?
) modifies mw_anyDenmMgmtCon := {
dataVersion := p_dataVersion
referenceTime := p_referenceTime
}
/**
......@@ -590,16 +610,13 @@ module LibItsDenm_Templates {
} // end group decentralizedLocationTemplates
group alacateTemplates {
group alacarteTemplates {
/**
* @desc Send template for Alacarte Container including lane count
*/
template (value) AlacarteContainer m_alacarteConLaneCount := {
laneCount := {
laneNumber := 2,
laneNumberConfidence := 100
},
laneNumber := 2,
impactReduction := omit,
externalTemperature := omit,
roadWorks := omit,
......@@ -607,6 +624,6 @@ module LibItsDenm_Templates {
stationaryVehicle := omit
}
} // end alacateTemplates
} // end alacarteTemplates
} // end LibItsDenmTemplates
\ No newline at end of file
......@@ -42,9 +42,6 @@ module LibItsDenm_TypesAndValues {
const ItsPduHeader.messageID c_messageId := 1;
const DataVersion c_dataVersionFirst := 0;
const DataVersion c_dataVersionCancellation := 255;
const ValidityDuration c_validityDuration_10sec := 10;
const ValidityDuration c_defaultValidity := 600;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment