Newer
Older
/**
* @author ETSI / STF405
* @version $URL$
* $Id$
* @desc Module containing functions for GeoNetworking
*
*/
module LibItsGeoNetworking_Functions {
// Libcommon
import from LibCommon_BasicTypesAndValues all;
// LibIts
import from LibIts_TestSystem all;
import from LibIts_Interface all;
/**
* @desc Create Facility component and connects GeoNetworking port
* @param p_ptcDenm returned Facility component variable
*/
function f_ptcGeoNetworkingUp(out ItsNt p_ptcGeoNetworking) {
p_ptcGeoNetworking := ItsNt.create("GeoNetworking Tester");
// map ports
map(p_ptcGeoNetworking:geoNetworkingPort, system:geoNetworkingPort);
/**
* @desc Wait for component to finish and unmap GeoNetworking ports
function f_ptcGeoNetworkingDown(in ItsNt p_ptcGeoNetworking) runs on ItsMtc {
tc_guard.start;
alt {
[] p_ptcGeoNetworking.done {
tc_guard.stop;
}
[] tc_guard.timeout {
log("*** f_ptcGeoNetworkingDown: ERROR: Timeout while waiting for component ***");
setverdict(inconc);
}
}
unmap(p_ptcGeoNetworking:geoNetworkingPort);
* @desc The base default.
*/
altstep a_default() runs on ItsNt {
[] geoNetworkingPort.receive {
setverdict (inconc, "Received an unexpected message");
//TODO shall stop be called here?
stop;
}
[] tc_wait.timeout {
setverdict (inconc, "Timeout while awaiting reaction of the IUT prior to Upper Tester action");
//TODO shall stop be called here?
stop;
}
[] tc_ac.timeout {
setverdict (inconc, "Timeout while awaiting the reception of a message");
//TODO shall stop be called here?
stop;
}
}
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
group geoGeoUnicastAltsteps {
/**
* @desc Receive GeoUnicast packet
*/
altstep a_receiveGeoUnicast(
in template (present) LongPosVector p_senderLongPosVec,
in template (present) ShortPosVector p_destinationLongPosVec,
in template (present) StationTypeIdentifier p_stationType,
in template (present) UInt16 p_seqNumber
) runs on ItsNt {
[] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoUnicastHeader(
p_senderLongPosVec,
p_destinationLongPosVec,
p_stationType,
p_seqNumber)))) {}
}
/**
* @desc Receive GeoUnicast packet for specific destination
*/
altstep a_receiveGeoUnicastWithDestination(in template (present) ShortPosVector p_destinationLongPosVec) runs on ItsNt {
[] a_receiveGeoUnicast(?, p_destinationLongPosVec, ?, ?) {}
}
/**
* @desc Receive any GeoUnicast packet
*/
altstep a_receiveAnyGeoUnicast() runs on ItsNt {
[] a_receiveGeoUnicast(?, ?, ?, ?) {}
}
} // end geoGeoUnicastAltsteps
group geoLocationServiceAltsteps {
/**
* @desc Receive Location Service Request
*/
altstep a_receiveLsRequest(
in template (present) StationTypeIdentifier p_stationType,
in template (present) UInt16 p_seqNumber,
in template (present) GN_Address p_gnAddress
) runs on ItsNt {
[] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(
mw_lsRequestHeader(
p_stationType,
p_seqNumber,
p_gnAddress)))) {}
}
/**
* @desc Receive any Location Service Request
*/
altstep a_receiveAnyLsRequest() runs on ItsNt {
[] a_receiveLsRequest(?, ?, ?) {}
}
/**
* @desc Receive Location Service Request and send Location Service Reply
*/
altstep a_receiveLsRequestAndReply(
in template (present) StationTypeIdentifier p_reqStationType,
in template (present) UInt16 p_reqSeqNumber,
in template (value) GN_Address p_gnAddress,
in template (value) LongPosVector p_repSrcPosVector,
in template (value) LongPosVector p_repSenderPosVector,
in template (value) StationTypeIdentifier p_repStationType,
in template (value) UInt16 p_repSeqNumber
) runs on ItsNt {
[] a_receiveLsRequest(p_reqStationType, p_reqSeqNumber, p_gnAddress) {
geoNetworkingPort.send(m_geoNwReq(m_geoNwPdu(
m_lsRequestHeader(
p_repSrcPosVector,
p_repSenderPosVector,
p_repStationType,
p_repSeqNumber,
p_gnAddress
))))
}
}
} // end geoLocationServiceAltsteps
} // end geoAltsteps
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
group preambles {
/**
* @desc The default preamble.
*/
function f_prDefault() runs on ItsNt {
activate(a_default());
}
/**
* @desc Brings the IUT into an initial state.
* @return
*/
function f_prInitialState() runs on ItsNt {
f_prDefault();
// TODO: any specific action ?
setverdict(pass);
}
} // end preambles
group postambles {
/**
* @desc The default postamble.
*/
function f_poDefault() runs on ItsNt {
setverdict(pass);
}
} // end postambles
group upperTester {
function f_utGenerateIpv6Message() runs on ItsNt {
}
} // end upperTester
group testAdapter {
function f_taStartBeaconing(in template (value) Header p_beaconHeader) {
}
function f_taStopBeaconing() {
}
group testerFunctions {
function f_getTesterLongPosVector() return LongPosVector {
var LongPosVector v_longPosVector;
return v_longPosVector;
}
function f_getTesterGnAddress() return GN_Address {
var GN_Address v_gnAddress;
return v_gnAddress;
}
} // end testerFunctions
group posVectorFunctions {
function f_longPosVector2ShortPosVector(in LongPosVector p_longPosVector) return ShortPosVector {
var ShortPosVector v_shortPosVector;
return v_shortPosVector;
}
function f_getIutShortPosVector() return ShortPosVector {
var ShortPosVector v_shortPosVector;
return v_shortPosVector;
}