Commit 0386f5bf authored by Yann Garcia's avatar Yann Garcia
Browse files

Merge branch 'STF525' of https://forge.etsi.org/gitlab/ITS/ITS into STF525

parents 8c809dc8 8513dd85
......@@ -7,9 +7,11 @@
#include "LibCommon_BasicTypesAndValues.hh"
#include "uppertester_cam_codec.hh"
#include "uppertester_denm_codec.hh"
#include "uppertester_geonetworking_codec.hh"
#include "LibItsCam_EncdecDeclarations.hh"
#include "LibItsDenm_EncdecDeclarations.hh"
ConfigRsuSimulatorLayer::ConfigRsuSimulatorLayer(const std::string & p_type, const std::string & param) : t_layer<ItsRSUsSimulator__TestSystem::ConfigRsuSimulatorPort>(p_type), _params(), _codec(), _codec_cam() {
loggers::get_instance().log(">>> ConfigRsuSimulatorLayer::ConfigRsuSimulatorLayer: %s, %s", to_string().c_str(), param.c_str());
......@@ -19,7 +21,7 @@ ConfigRsuSimulatorLayer::ConfigRsuSimulatorLayer(const std::string & p_type, con
void ConfigRsuSimulatorLayer::sendMsg(const ItsRSUsSimulator__TestSystem::CfInitialize& send_par, params& params){
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::sendMsg: ", send_par);
// Encode ConfigRsuSimulator PDU
OCTETSTRING data;
if (_codec.encode(static_cast<const Record_Type&>(send_par), data) == -1) {
......@@ -49,6 +51,18 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsGeoNetworking__TypesAndValues:
send_data(os, _params);
}
void ConfigRsuSimulatorLayer::sendMsg(const LibItsGeoNetworking__TypesAndValues::UtGnEventInd& send_par, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::sendMsg: ", send_par);
TTCN_Buffer encoding_buffer;
encoding_buffer.put_c(0x55/*static_cast<const unsigned char>(uppertester_geonetworking_codec::c_utGnEventInd)*/);
OCTETSTRING l = int2oct(send_par.rawPayload().lengthof(), 2);
encoding_buffer.put_s(l.lengthof(), static_cast<const unsigned char*>(l));
encoding_buffer.put_s(send_par.rawPayload().lengthof(), static_cast<const unsigned char*>(send_par.rawPayload()));
OCTETSTRING data(encoding_buffer.get_len(), encoding_buffer.get_data());
send_data(data, _params);
}
void ConfigRsuSimulatorLayer::sendMsg(const LibItsCam__TypesAndValues::UtCamResults& send_par, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::sendMsg: ", send_par);
......@@ -74,9 +88,12 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsCam__TypesAndValues::UtCamEven
TTCN_Buffer encoding_buffer;
encoding_buffer.put_c(0x23/*static_cast<const unsigned char>(uppertester_cam_codec::c_utCamEventInd)*/);
BITSTRING bs = LibItsCam__EncdecDeclarations::fx__enc__CAM(send_par.camMsg());
encoding_buffer.put_s(bs.lengthof(), static_cast<const unsigned char*>(bs));
OCTETSTRING os(encoding_buffer.get_len(), encoding_buffer.get_data());
send_data(os, _params);
OCTETSTRING os = bit2oct(bs);
OCTETSTRING l = int2oct(os.lengthof(), 2);
encoding_buffer.put_s(l.lengthof(), static_cast<const unsigned char*>(l));
encoding_buffer.put_s(os.lengthof(), static_cast<const unsigned char*>(os));
OCTETSTRING data(encoding_buffer.get_len(), encoding_buffer.get_data());
send_data(data, _params);
}
void ConfigRsuSimulatorLayer::sendMsg(const LibItsDenm__TypesAndValues::UtDenmResults& send_par, params& params) {
......@@ -86,6 +103,25 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsDenm__TypesAndValues::UtDenmRe
if (send_par.ischosen(LibItsDenm__TypesAndValues::UtDenmResults::ALT_utDenmInitializeResult)) {
encoding_buffer.put_c(0x01/*static_cast<const unsigned char>(uppertester_denm_codec::c_utDenmInitializeResult)*/);
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utDenmInitializeResult()));
} else if (send_par.ischosen(LibItsDenm__TypesAndValues::UtDenmResults::ALT_utDenmTriggerResult)) {
encoding_buffer.put_c(0x11/*static_cast<const unsigned char>(uppertester_denm_codec::c_utDenmTriggerResult)*/);
const LibItsDenm__TypesAndValues::UtDenmTriggerResult& r = send_par.utDenmTriggerResult();
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(r.result()));
OCTETSTRING os = int2oct(r.actionId().originatingStationID(), 4);
encoding_buffer.put_s(os.lengthof(), static_cast<const unsigned char*>(os));
os = int2oct(r.actionId().sequenceNumber(), 2);
encoding_buffer.put_s(os.lengthof(), static_cast<const unsigned char*>(os));
} else if (send_par.ischosen(LibItsDenm__TypesAndValues::UtDenmResults::ALT_utDenmUpdateResult)) {
encoding_buffer.put_c(0x13/*static_cast<const unsigned char>(uppertester_denm_codec::c_utDenmUpdateResult)*/);
const LibItsDenm__TypesAndValues::UtDenmUpdateResult& r = send_par.utDenmUpdateResult();
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(r.result()));
OCTETSTRING os = int2oct(r.actionId().originatingStationID(), 4);
encoding_buffer.put_s(os.lengthof(), static_cast<const unsigned char*>(os));
os = int2oct(r.actionId().sequenceNumber(), 2);
encoding_buffer.put_s(os.lengthof(), static_cast<const unsigned char*>(os));
} else if (send_par.ischosen(LibItsDenm__TypesAndValues::UtDenmResults::ALT_utDenmTerminationResult)) {
encoding_buffer.put_c(0x15/*static_cast<const unsigned char>(uppertester_denm_codec::c_utDenmInitializeResult)*/);
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utDenmTerminationResult()));
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::sendMsg: Unsupported UtDenmResults variant");
return;
......@@ -95,6 +131,20 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsDenm__TypesAndValues::UtDenmRe
send_data(os, _params);
}
void ConfigRsuSimulatorLayer::sendMsg(const LibItsDenm__TypesAndValues::UtDenmEventInd& send_par, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::sendMsg: ", send_par);
TTCN_Buffer encoding_buffer;
encoding_buffer.put_c(0x17/*static_cast<const unsigned char>(uppertester_cam_codec::c_utDenmEventInd)*/);
BITSTRING bs = LibItsDenm__EncdecDeclarations::fx__enc__DENM(send_par.denMsg());
OCTETSTRING os = bit2oct(bs);
OCTETSTRING l = int2oct(os.lengthof(), 2);
encoding_buffer.put_s(l.lengthof(), static_cast<const unsigned char*>(l));
encoding_buffer.put_s(os.lengthof(), static_cast<const unsigned char*>(os));
OCTETSTRING data(encoding_buffer.get_len(), encoding_buffer.get_data());
send_data(data, _params);
}
void ConfigRsuSimulatorLayer::sendMsg(const LibItsPki__TypesAndValues::UtPkiResults& send_par, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::sendMsg: ", send_par);
......@@ -133,6 +183,14 @@ void ConfigRsuSimulatorLayer::receive_data(OCTETSTRING& data, params& params)
process_ut_cam_changespeed_data(data, params);
} else if (id == 0x34/*uppertester_cam_codec::c_utCamChangeHeading*/) {
process_ut_cam_changeheading_data(data, params);
} else if (id == 0x3a/*uppertester_cam_codec::c_utCamSetVehicleRole*/) {
process_ut_cam_setvehiclerole_data(data, params);
} else if (id == 0x10/*uppertester_denm_codec::c_utDenmTrigger*/) {
process_ut_denm_trigger(data, params);
} else if (id == 0x12/*uppertester_denm_codec::c_utDenmUpdate*/) {
process_ut_denm_update(data, params);
} else if (id == 0x14/*uppertester_denm_codec::c_utDenmTermination*/) {
process_ut_denm_termination(data, params);
} else if ((id >= 0x50) && (id <= 0x54)) { // Receive an UtGnTrigger
process_ut_geonetworking_trigger(data, params);
} else if ((id >= 0xBB) && (id <= 0xBF)) { // Receive an UtPkiTrigger
......@@ -140,12 +198,12 @@ void ConfigRsuSimulatorLayer::receive_data(OCTETSTRING& data, params& params)
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::receive_data: Unsupported tag %02x", id);
}
}
int ConfigRsuSimulatorLayer::process_utinitialize_data(const OCTETSTRING& data, params& params) {
loggers::get_instance().log(">>> ConfigRsuSimulatorLayer::process_utinitialize_data");
params::const_iterator it = _params.find("ut");
if (it == _params.cend()) {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_utinitialize_data: CF layer's ut parameter is missing");
......@@ -249,6 +307,220 @@ int ConfigRsuSimulatorLayer::process_ut_cam_changeheading_data(const OCTETSTRING
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_cam_setvehiclerole_data(const OCTETSTRING& data, params& params) {
loggers::get_instance().log(">>> ConfigRsuSimulatorLayer::process_ut_cam_setvehiclerole_data");
params::const_iterator it = _params.find("ut");
if (it == _params.cend()) {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_cam_setvehiclerole_data: CF layer's ut parameter is missing");
return -1;
}
if (_params[std::string("ut")].compare("cam") == 0) {
OCTETSTRING vehicle_role(data.lengthof() - 1, 1 + static_cast<const unsigned char*>(data));
LibItsCam__TypesAndValues::UtCamTrigger p;
p.setVehicleRole() = oct2int(vehicle_role);
// Pass it to the ports if any
to_all_upper_ports(p, params);
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_cam_setvehiclerole_data: Unsupported protocol");
return -1;
}
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_denm_trigger(const OCTETSTRING& data, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::process_ut_denm_trigger", data);
params::const_iterator it = _params.find("ut");
if (it == _params.cend()) {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_denm_trigger: CF layer's ut parameter is missing");
return -1;
}
if (_params[std::string("ut")].compare("denm") == 0) {
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_denm_trigger: msg_id=%02x", msg_id);
unsigned char flag = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_denm_trigger: flag=%02x", flag);
LibItsDenm__TypesAndValues::UtDenmTrigger trigger; // See ETSI TR 103 34 099 Cause C.4.1 GenerateDenmEvent
// Decode detectionTime
trigger.detectionTime() = oct2int(OCTETSTRING(6, p));
p += 6;
// ValidityDuration
if ((flag & 0x80) == 0x80) {
trigger.validityDuration() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
} else {
trigger.validityDuration().set_to_omit();
}
p += 3;
if ((flag & 0x40) == 0x40) {
trigger.repetitionDuration() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
} else {
trigger.repetitionDuration().set_to_omit();
}
p += 3;
// Situation
trigger.situation().informationQuality() = oct2int(OCTETSTRING(1, p++));
trigger.situation().eventType().causeCode() = oct2int(OCTETSTRING(1, p++));
trigger.situation().eventType().subCauseCode() = oct2int(OCTETSTRING(1, p++));
trigger.situation().linkedCause().set_to_omit();
trigger.situation().eventHistory().set_to_omit();
// RelevanceDistance
trigger.relevanceDistance() = oct2int(OCTETSTRING(1, p++));
// RelevanceTrafficDirection
trigger.relevanceTrafficDirection() = oct2int(OCTETSTRING(1, p++));
if ((flag & 0x04) == 0x04) {
trigger.transmissionInterval() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(2, p)));
} else {
trigger.transmissionInterval().set_to_omit();
}
p += 2;
if ((flag & 0x02) == 0x02) {
trigger.repetitionInterval() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(2, p)));
} else {
trigger.repetitionInterval().set_to_omit();
}
p += 2;
// alacarteLength
INTEGER alacarte_length = oct2int(OCTETSTRING(1, p));
if (static_cast<int>(alacarte_length) != 0) {
p += 1;
// FIXME AlacarteContainer alacarte optional
} else {
trigger.alacarte().set_to_omit();
}
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_denm_trigger: ", trigger);
// Pass it to the ports if any
to_all_upper_ports(trigger, params);
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_denm_trigger: Unsupported protocol");
return -1;
}
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_denm_update(const OCTETSTRING& data, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::process_ut_denm_update", data);
params::const_iterator it = _params.find("ut");
if (it == _params.cend()) {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_denm_update: CF layer's ut parameter is missing");
return -1;
}
if (_params[std::string("ut")].compare("denm") == 0) {
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_denm_update: msg_id=%02x", msg_id);
unsigned char flag = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_denm_update: flag=%02x", flag);
LibItsDenm__TypesAndValues::UtDenmUpdate update; // See ETSI TR 103 34 099 Cause C.4.1 GenerateDenmEvent
// Statuion ID
update.actionId().originatingStationID() = oct2int(OCTETSTRING(4, p));
p += 4;
// SequenceNumber
update.actionId().sequenceNumber() = oct2int(OCTETSTRING(2, p));
p += 2;
// Decode detectionTime
update.detectionTime() = oct2int(OCTETSTRING(6, p));
p += 6;
if ((flag & 0x80) == 0x80) {
update.validityDuration() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
} else {
update.validityDuration().set_to_omit();
}
p += 3;
// Situation
if ((flag & 0x40) == 0x40) {
DENM__PDU__Descriptions::SituationContainer& s = static_cast<DENM__PDU__Descriptions::SituationContainer &>(*update.get_opt_value());
s.informationQuality() = oct2int(OCTETSTRING(1, p++));
s.eventType().causeCode() = oct2int(OCTETSTRING(1, p++));
s.eventType().subCauseCode() = oct2int(OCTETSTRING(1, p++));
s.linkedCause().set_to_omit();
s.eventHistory().set_to_omit();
update.situation() = OPTIONAL<DENM__PDU__Descriptions::SituationContainer>(s);
} else {
update.situation().set_to_omit();
}
// Location
update.location().set_to_omit();
// RelevanceDistance
if ((flag & 0x20) == 0x20) {
update.relevanceDistance() = oct2int(OCTETSTRING(1, p++));
} else {
update.relevanceDistance().set_to_omit();
}
// RelevanceTrafficDirection
if ((flag & 0x10) == 0x10) {
update.relevanceTrafficDirection() = oct2int(OCTETSTRING(1, p++));
} else {
update.relevanceTrafficDirection().set_to_omit();
}
if ((flag & 0x08) == 0x08) {
update.transmissionInterval() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(2, p)));
} else {
update.transmissionInterval().set_to_omit();
}
p += 2;
if ((flag & 0x04) == 0x04) {
update.repetitionInterval() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(2, p)));
} else {
update.repetitionInterval().set_to_omit();
}
p += 2;
// alacarteLength
INTEGER alacarte_length = oct2int(OCTETSTRING(1, p));
if (static_cast<int>(alacarte_length) != 0) {
p += 1;
// FIXME AlacarteContainer alacarte optional
} else {
update.alacarte().set_to_omit();
}
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_denm_update: ", update);
// Pass it to the ports if any
to_all_upper_ports(update, params);
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_denm_update: Unsupported protocol");
return -1;
}
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_denm_termination(const OCTETSTRING& data, params& params) {
loggers::get_instance().log(">>> ConfigRsuSimulatorLayer::process_ut_denm_termination");
params::const_iterator it = _params.find("ut");
if (it == _params.cend()) {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_denm_termination: CF layer's ut parameter is missing");
return -1;
}
if (_params[std::string("ut")].compare("denm") == 0) {
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_denm_termination: msg_id=%02x", msg_id);
LibItsDenm__TypesAndValues::UtDenmTermination termination;
termination.actionId().originatingStationID() = oct2int(OCTETSTRING(4, p));
p += 4;
termination.actionId().sequenceNumber() = oct2int(OCTETSTRING(2, p));
// Pass it to the ports if any
to_all_upper_ports(termination, params);
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_denm_termination: Unsupported protocol");
return -1;
}
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger(const OCTETSTRING& data, params& params) {
loggers::get_instance().log(">>> ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger");
......@@ -270,13 +542,48 @@ int ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger(const OCTETSTRING&
if (msg_id == 0x50/*uppertester_geonetworking_codec::c_utGnTrigger_GeoUnicast*/) {
LibItsGeoNetworking__TypesAndValues::GenerateGeoUnicastMessage g;
g.decode(*g.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
if(g.payload().lengthof() > 2) {
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
} else {
g.payload() = OCTETSTRING(0, nullptr);
}
p.geoUnicast() = g;
} else if (msg_id == 0x51/*uppertester_geonetworking_codec::c_utGnTrigger_GeoBroadcast*/) {
LibItsGeoNetworking__TypesAndValues::GenerateGeoBroadcastMessage g;
g.decode(*g.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
if(g.payload().lengthof() > 2) {
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
} else {
g.payload() = OCTETSTRING(0, nullptr);
}
p.geoBroadcast() = g;
} else if (msg_id == 0x52/*uppertester_geonetworking_codec::c_utGnTrigger_GeoAnycast*/) {
LibItsGeoNetworking__TypesAndValues::GenerateGeoAnycastMessage g;
g.decode(*g.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
if(g.payload().lengthof() > 2) {
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
} else {
g.payload() = OCTETSTRING(0, nullptr);
}
p.geoAnycast() = g;
} else if (msg_id == 0x53/*uppertester_geonetworking_codec::c_utGnTrigger_Shb*/) {
LibItsGeoNetworking__TypesAndValues::GenerateSHBMessage g;
g.decode(*g.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
if(g.payload().lengthof() > 2) {
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
} else {
g.payload() = OCTETSTRING(0, nullptr);
}
p.shb() = g;
} else if (msg_id == 0x54/*uppertester_geonetworking_codec::c_utGnTrigger_Tsb*/) {
LibItsGeoNetworking__TypesAndValues::GenerateTSBMessage g;
g.decode(*g.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
if(g.payload().lengthof() > 2) {
g.payload() = OCTETSTRING(g.payload().lengthof() - 2, static_cast<const unsigned char*>(g.payload()));
} else {
g.payload() = OCTETSTRING(0, nullptr);
}
p.tsb() = g;
}
// Pass it to the ports if any
to_all_upper_ports(p, params);
......
......@@ -34,11 +34,13 @@ public:
void sendMsg(const ItsRSUsSimulator__TestSystem::CfInitialize&, params& params);
void sendMsg(const LibItsGeoNetworking__TypesAndValues::UtGnResults& send_par, params& params);
void sendMsg(const LibItsGeoNetworking__TypesAndValues::UtGnEventInd& send_par, params& params);
void sendMsg(const LibItsCam__TypesAndValues::UtCamResults& send_par, params& params);
void sendMsg(const LibItsCam__TypesAndValues::UtCamEventInd& send_par, params& params);
void sendMsg(const LibItsDenm__TypesAndValues::UtDenmResults& send_par, params& params);
void sendMsg(const LibItsDenm__TypesAndValues::UtDenmEventInd& send_par, params& params);
void sendMsg(const LibItsPki__TypesAndValues::UtPkiResults& send_par, params& params);
virtual void send_data(OCTETSTRING& data, params& params);
virtual void receive_data(OCTETSTRING& data, params& params);
......@@ -47,6 +49,10 @@ private:
int process_ut_cam_changespeed_data(const OCTETSTRING& data, params& params);
int process_ut_cam_changecurvature_data(const OCTETSTRING& data, params& params);
int process_ut_cam_changeheading_data(const OCTETSTRING& data, params& params);
int process_ut_cam_setvehiclerole_data(const OCTETSTRING& data, params& params);
int process_ut_denm_trigger(const OCTETSTRING& data, params& params);
int process_ut_denm_update(const OCTETSTRING& data, params& params);
int process_ut_denm_termination(const OCTETSTRING& data, params& params);
int process_ut_geonetworking_trigger(const OCTETSTRING& data, params& params);
int process_ut_pki_trigger(const OCTETSTRING& data, params& params);
......
......@@ -124,6 +124,15 @@ namespace ItsRSUsSimulator__TestSystem {
loggers::get_instance().set_stop_time(_time_key, duration);
}
void ConfigRsuSimulatorPort::outgoing_send(const LibItsGeoNetworking__TypesAndValues::UtGnEventInd& send_par) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::outgoing_send: payload=", send_par);
float duration;
loggers::get_instance().set_start_time(_time_key);
static_cast<ConfigRsuSimulatorLayer *>(_layer)->sendMsg(send_par, _layer_params);
loggers::get_instance().set_stop_time(_time_key, duration);
}
void ConfigRsuSimulatorPort::outgoing_send(const LibItsCam__TypesAndValues::UtCamEventInd& send_par) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::outgoing_send: payload=", send_par);
......@@ -142,6 +151,16 @@ namespace ItsRSUsSimulator__TestSystem {
loggers::get_instance().set_stop_time(_time_key, duration);
}
void ConfigRsuSimulatorPort::outgoing_send(const LibItsDenm__TypesAndValues::UtDenmEventInd& send_par) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::outgoing_send: payload=", send_par);
float duration;
loggers::get_instance().set_start_time(_time_key);
static_cast<ConfigRsuSimulatorLayer *>(_layer)->sendMsg(send_par, _layer_params);
loggers::get_instance().set_stop_time(_time_key, duration);
}
void ConfigRsuSimulatorPort::outgoing_send(const LibItsPki__TypesAndValues::UtPkiResults& send_par) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::outgoing_send: payload=", send_par);
......@@ -190,7 +209,7 @@ namespace ItsRSUsSimulator__TestSystem {
incoming_message(p_ind);
}
void ConfigRsuSimulatorPort::receiveMsg (const LibItsCam__TypesAndValues::UtCamTrigger& p_ind, const params& p_params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::receive_msg: ", p_ind);
// Sanity check
......@@ -210,7 +229,37 @@ namespace ItsRSUsSimulator__TestSystem {
incoming_message(p_ind);
}
void ConfigRsuSimulatorPort::receiveMsg (const LibItsDenm__TypesAndValues::UtDenmTrigger& p_ind, const params& p_params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::receive_msg: ", p_ind);
// Sanity check
if (!p_ind.is_bound()) {
return;
}
incoming_message(p_ind);
}
void ConfigRsuSimulatorPort::receiveMsg (const LibItsDenm__TypesAndValues::UtDenmUpdate& p_ind, const params& p_params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::receive_msg: ", p_ind);
// Sanity check
if (!p_ind.is_bound()) {
return;
}
incoming_message(p_ind);
}
void ConfigRsuSimulatorPort::receiveMsg (const LibItsDenm__TypesAndValues::UtDenmTermination& p_ind, const params& p_params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::receive_msg: ", p_ind);
// Sanity check
if (!p_ind.is_bound()) {
return;
}
incoming_message(p_ind);
}
void ConfigRsuSimulatorPort::receiveMsg (const LibItsPki__TypesAndValues::UtPkiInitialize& p_ind, const params& p_params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorPort::receive_msg: ", p_ind);
// Sanity check
......
......@@ -24,6 +24,9 @@ namespace ItsRSUsSimulator__TestSystem {
void receiveMsg (const LibItsCam__TypesAndValues::UtCamInitialize& p_ind, const params& p_params);
void receiveMsg (const LibItsCam__TypesAndValues::UtCamTrigger& p_ind, const params& p_params);
void receiveMsg (const LibItsDenm__TypesAndValues::UtDenmInitialize& p_ind, const params& p_params);
void receiveMsg (const LibItsDenm__TypesAndValues::UtDenmTrigger& p_ind, const params& p_params);
void receiveMsg (const LibItsDenm__TypesAndValues::UtDenmUpdate& p_ind, const params& p_params);
void receiveMsg (const LibItsDenm__TypesAndValues::UtDenmTermination& p_ind, const params& p_params);
void receiveMsg (const LibItsPki__TypesAndValues::UtPkiInitialize& p_ind, const params& p_params);
void receiveMsg (const LibItsPki__TypesAndValues::UtPkiTrigger& p_ind, const params& p_params);
......@@ -58,9 +61,11 @@ namespace ItsRSUsSimulator__TestSystem {
void outgoing_send(const CfInitialize& send_par);
void outgoing_send(const BOOLEAN& send_par);
void outgoing_send(const LibItsGeoNetworking__TypesAndValues::UtGnResults& send_par);
void outgoing_send(const LibItsGeoNetworking__TypesAndValues::UtGnEventInd& send_par);
void outgoing_send(const LibItsCam__TypesAndValues::UtCamResults& send_par);
void outgoing_send(const LibItsCam__TypesAndValues::UtCamEventInd& send_par);
void outgoing_send(const LibItsDenm__TypesAndValues::UtDenmResults& send_par);
void outgoing_send(const LibItsDenm__TypesAndValues::UtDenmEventInd& send_par);
void outgoing_send(const LibItsPki__TypesAndValues::UtPkiResults& send_par);
}; // End of class ConfigRsuSimulatorPort
......
......@@ -377,7 +377,7 @@ int geonetworking_codec::decode_extendedHeader(LibItsGeoNetworking__TypesAndValu
} else if (_dc.get_header_sub_type() == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeTSB::e__singleHop) {
decode_(u.shbHeader(), *u.shbHeader().get_descriptor(), decoding_buffer);
} else {
TTCN_error("geonetworking_codec::decode_headerTST: TSB subtype not processed");
TTCN_error("geonetworking_codec::decode_headerTST: TSB subtype not processed, See ETSI EN 302 636-4-1 Clause 9.7.4 Encoding of the HT and HST fields");
}
break;
case LibItsGeoNetworking__TypesAndValues::HeaderType::e__geoBroadcast:
......@@ -395,7 +395,7 @@ int geonetworking_codec::decode_extendedHeader(LibItsGeoNetworking__TypesAndValu
} else if (_dc.get_header_sub_type() == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeLs::e__lsReply) {
decode_(u.lsReplyHeader(), *u.lsReplyHeader().get_descriptor(), decoding_buffer);
} else {
TTCN_error("geonetworking_codec::decode_headerTST: Location service subtype not processed");
TTCN_error("geonetworking_codec::decode_headerTST: Location service subtype not processed, See ETSI EN 302 636-4-1 Clause 9.7.4 Encoding of the HT and HST fields");
}
break;
case LibItsGeoNetworking__TypesAndValues::HeaderType::e__any:
......@@ -408,11 +408,11 @@ int geonetworking_codec::decode_extendedHeader(LibItsGeoNetworking__TypesAndValu
} else if (_dc.get_header_sub_type() == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeSa::e__saEos) {
decode_(u.saEosHeader(), *u.saEosHeader().get_descriptor(), decoding_buffer);
} else {