Commit 4830388e authored by ASN.1 Documenter's avatar ASN.1 Documenter
Browse files

Merge branch 'TTF0002' into cygwin

parents 52a2ddb1 6c51f64a
This diff is collapsed.
......@@ -31,6 +31,7 @@ public: //! \publicsection
static const std::string& mac_bc; //! Broadcast MAC address parameter name
static const std::string& eth_type; //! Ethernet type parameter name
static const std::string& beaconing; //! Beaconing mode parameter name
static const std::string& timestamp; //! Packet reception timestamp
static const std::string& station_type;
static const std::string& country;
static const std::string& type_of_address;
......@@ -46,8 +47,6 @@ public: //! \publicsection
static const std::string& btp_payload; //! BTP Payload parameter name
static const std::string& btp_destination_port; //! BTP DestinationPort parameter name
static const std::string& btp_info; //! BTP Info parameter name
static const std::string& ssem_destination_port; //! BTP Destination port for SSEM
static const std::string& spatem_destination_port;//! BTP Destination port for SPATEM
static const std::string& nic; //! Network Interface Card parameter name
static const std::string& ll_address; //! Test system GeoNetworking LL-Address parameter name
......
......@@ -23,6 +23,7 @@ const std::string& params::mac_dst = std::string("mac_dst");
const std::string& params::mac_bc = std::string("mac_bc");
const std::string& params::eth_type = std::string("eth_type");
const std::string& params::beaconing = std::string("beaconing");
const std::string& params::timestamp = std::string("timestamp");
const std::string& params::station_type = std::string("station_type");
const std::string& params::country = std::string("country");
const std::string& params::type_of_address = std::string("type_of_address");
......@@ -38,8 +39,6 @@ const std::string& params::btp_type = std::string("btp_type");
const std::string& params::btp_payload = std::string("btp_payload");
const std::string& params::btp_destination_port = std::string("dst_port");
const std::string& params::btp_info = std::string("btp_info");
const std::string& params::ssem_destination_port = std::string("ssem_port");
const std::string& params::spatem_destination_port = std::string("spatem_port");
const std::string& params::nic = std::string("nic");
const std::string& params::latitude = std::string("latitude");
......
......@@ -97,6 +97,17 @@ namespace LibItsIvim__TestSystem {
loggers::get_instance().set_stop_time(_time_key, duration);
}
void IvimPort::outgoing_send(const IvimInd& send_par)
{
loggers::get_instance().log_msg(">>> IvimPort::outgoing_send: payload=", send_par);
float duration;
loggers::get_instance().set_start_time(_time_key);
params params;
static_cast<ivim_layer *>(_layer)->sendMsg(send_par, params);
loggers::get_instance().set_stop_time(_time_key, duration);
}
void IvimPort::receiveMsg(const LibItsIvim__TestSystem::IvimInd& p_ind, const params& p_params) {
loggers::get_instance().log_msg(">>> IvimPort::receive_msg: ", p_ind);
......
......@@ -43,6 +43,7 @@ protected:
void user_stop();
void outgoing_send(const IvimReq& send_par);
void outgoing_send(const IvimInd& send_par);
};
} /* end of namespace */
......
......@@ -224,9 +224,12 @@ void ConfigRsuSimulatorLayer::sendMsg(const LibItsMapemSpatem__TypesAndValues::U
if (send_par.ischosen(LibItsMapemSpatem__TypesAndValues::UtMapemSpatemResults::ALT_utMapemSpatemInitializeResult)) {
encoding_buffer.put_c(static_cast<const unsigned char>(uppertester_mapem_spatem_codec::c_utMapemSpatemInitializeResult));
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utMapemSpatemInitializeResult()));
} else if (send_par.ischosen(LibItsMapemSpatem__TypesAndValues::UtMapemSpatemResults::ALT_utMapemSpatemTriggerResult)) {
encoding_buffer.put_c(static_cast<const unsigned char>(uppertester_mapem_spatem_codec::c_utMapemSpatemTriggerResult));
encoding_buffer.put_c((unsigned char)static_cast<const boolean>(send_par.utMapemSpatemTriggerResult()));
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::sendMsg: Unsupported UtMapemSpatemResults variant");
return;
return;
}
OCTETSTRING os(encoding_buffer.get_len(), encoding_buffer.get_data());
......@@ -380,6 +383,8 @@ void ConfigRsuSimulatorLayer::receive_data(OCTETSTRING& data, params& params)
process_ut_denm_update(data, params);
} else if (id == uppertester_denm_codec::c_utDenmTermination) {
process_ut_denm_termination(data, params);
} else if (id == uppertester_mapem_spatem_codec::c_utMapemSpatemTrigger) {
process_ut_mapem_spatem_trigger(data, params);
} else if (id == uppertester_ivim_codec::c_utIvimTrigger) {
process_ut_ivim_trigger(data, params);
} else if (id == uppertester_ivim_codec::c_utIvimUpdate) {
......@@ -571,7 +576,7 @@ int ConfigRsuSimulatorLayer::process_ut_denm_trigger(const OCTETSTRING& data, pa
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
LibItsDenm__TypesAndValues::UtDenmTrigger trigger; // See ETSI TR 103 099 Cause C.4.1 GenerateDenmEvent
// Decode detectionTime
trigger.detectionTime() = oct2int(OCTETSTRING(6, p));
p += 6;
......@@ -645,7 +650,7 @@ int ConfigRsuSimulatorLayer::process_ut_denm_update(const OCTETSTRING& data, par
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
LibItsDenm__TypesAndValues::UtDenmUpdate update; // See ETSI TR 103 099 Cause C.4.1 GenerateDenmEvent
// Statuion ID
update.actionId().originatingStationID() = oct2int(OCTETSTRING(4, p));
p += 4;
......@@ -868,6 +873,58 @@ int ConfigRsuSimulatorLayer::process_ut_pki_trigger(const OCTETSTRING& data, par
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger(const OCTETSTRING& data, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger", data);
params::const_iterator it = _params.find("ut");
if (it == _params.cend()) {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: CF layer's ut parameter is missing");
return -1;
}
if (_params[std::string("ut")].compare("mapemspatem") == 0) {
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: msg_id=%02x", msg_id);
unsigned char flag = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: flag=%02x", flag);
LibItsMapemSpatem__TypesAndValues::UtMapemSpatemTrigger trigger; // See ETSI TR 103 099 Cause C.4.1 GenerateMapemSpatemEvent
// Decode Event
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: event=%02x", *p);
trigger.event().int2enum(static_cast<int>(*p++));
// Decode IntersectionId
if ((flag & 0x80) == 0x80) {
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: intersectionID=%04x", (short)*p);
trigger.intersectionID() = OPTIONAL<INTEGER>(static_cast<int>((*p << 8) | *(p + 1)));
} else {
trigger.intersectionID().set_to_omit();
}
p += 2;
// Decode RegulatorySpeedLimit
if ((flag & 0x40) == 0x40) {
DSRC__REGION__noCircular::RegulatorySpeedLimit r;
r.type__().int2enum(static_cast<int>(*p++));
r.speed() = static_cast<int>((*p << 8) | *(p + 1));
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: RegulatorySpeedLimit: ", r);
trigger.regulatorySpeedLimit() = OPTIONAL<DSRC__REGION__noCircular::RegulatorySpeedLimit>(r);
} else {
trigger.regulatorySpeedLimit().set_to_omit();
}
p += 2;
// FIXME Add flags
trigger.latitude().set_to_omit();
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: ", trigger);
// Pass it to the ports if any
to_all_upper_ports(trigger, params);
} else {
loggers::get_instance().warning("ConfigRsuSimulatorLayer::process_ut_mapem_spatem_trigger: Unsupported protocol");
return -1;
}
return 0;
}
int ConfigRsuSimulatorLayer::process_ut_ivim_trigger(const OCTETSTRING& data, params& params) {
loggers::get_instance().log_msg(">>> ConfigRsuSimulatorLayer::process_ut_ivim_trigger", data);
......@@ -883,37 +940,102 @@ int ConfigRsuSimulatorLayer::process_ut_ivim_trigger(const OCTETSTRING& data, pa
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_ivim_trigger: msg_id=%02x", msg_id);
unsigned short flag = static_cast<unsigned short>((*p++) << 8 | (*p++));
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_ivim_trigger: flag=%02x", flag);
LibItsIvim__TypesAndValues::UtIvimTrigger trigger; // See ETSI TR 103 34 099 Cause C.4.1 GenerateIvimEvent
LibItsIvim__TypesAndValues::UtIvimTrigger trigger; // See ETSI TR 103 099 Cause C.4.1 GenerateIvimEvent
// Decode ValidityFrom
if ((flag & 0x8000) == 0x8000) {
trigger.validFrom() = oct2int(OCTETSTRING(6, p));
trigger.validFrom() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(6, p)));
} else {
trigger.validFrom().set_to_omit();
}
p += 6;
// Decode ValidityTo
if ((flag & 0x4000) == 0x4000) {
trigger.validTo() = oct2int(OCTETSTRING(6, p));
trigger.validTo() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(6, p)));
} else {
trigger.validTo().set_to_omit();
}
p += 6;
// Decode RepetitionInterval
if ((flag & 0x2000) == 0x2000) {
trigger.repetitionInterval() = oct2int(OCTETSTRING(6, p));
trigger.repetitionInterval() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(6, p)));
} else {
trigger.repetitionInterval().set_to_omit();
}
p += 6;
// Decode zoneIds
trigger.zoneIds().set_to_omit();
trigger.laneNumber().set_to_omit();
trigger.relavanceZoneIds().set_to_omit();
trigger.detectionZoneIds().set_to_omit();
trigger.driverAwarenesZoneIds().set_to_omit();
trigger.itsRrid().set_to_omit();
trigger.directionGic().set_to_omit();
trigger.layoutId().set_to_omit();
if ((flag & 0x1000) == 0x1000) {
PreGenRecordOf::PREGEN__RECORD__OF__INTEGER rov;
rov.set_size(*p++);
for (int i = 0; i < rov.size_of(); i++) {
rov[i] = oct2int(OCTETSTRING(1, p++));
}
trigger.zoneIds() = OPTIONAL<PreGenRecordOf::PREGEN__RECORD__OF__INTEGER>(rov);
} else {
trigger.zoneIds().set_to_omit();
p += 1;
}
// Decode laneNumber
if ((flag & 0x0800) == 0x0800) {
trigger.laneNumber() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(1, p)));
} else {
trigger.laneNumber().set_to_omit();
}
p += 1;
// Decode relavanceZoneIds
if ((flag & 0x0400) == 0x0400) {
PreGenRecordOf::PREGEN__RECORD__OF__INTEGER rov;
rov.set_size(*p++);
for (int i = 0; i < rov.size_of(); i++) {
rov[i] = oct2int(OCTETSTRING(1, p++));
}
trigger.relavanceZoneIds() = OPTIONAL<PreGenRecordOf::PREGEN__RECORD__OF__INTEGER>(rov);
} else {
trigger.relavanceZoneIds().set_to_omit();
p += 1;
}
// Decode detectionZoneIds
if ((flag & 0x0200) == 0x0200) {
PreGenRecordOf::PREGEN__RECORD__OF__INTEGER rov;
rov.set_size(*p++);
for (int i = 0; i < rov.size_of(); i++) {
rov[i] = oct2int(OCTETSTRING(1, p++));
}
trigger.detectionZoneIds() = OPTIONAL<PreGenRecordOf::PREGEN__RECORD__OF__INTEGER>(rov);
} else {
trigger.detectionZoneIds().set_to_omit();
p += 1;
}
// Decode driverAwarenesZoneIds
if ((flag & 0x0100) == 0x0100) {
PreGenRecordOf::PREGEN__RECORD__OF__INTEGER rov;
rov.set_size(*p++);
for (int i = 0; i < rov.size_of(); i++) {
rov[i] = oct2int(OCTETSTRING(1, p++));
}
trigger.driverAwarenesZoneIds() = OPTIONAL<PreGenRecordOf::PREGEN__RECORD__OF__INTEGER>(rov);
} else {
trigger.driverAwarenesZoneIds().set_to_omit();
p += 1;
}
if ((flag & 0x0080) == 0x0080) {
CITSapplMgmtIDs::VarLengthNumber v;
v.content() = oct2int(OCTETSTRING(1, p));
trigger.itsRrid() = OPTIONAL<CITSapplMgmtIDs::VarLengthNumber>(v);
} else {
trigger.itsRrid().set_to_omit();
}
p += 1;
if ((flag & 0x0040) == 0x0040) {
trigger.directionGic() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(1, p)));
} else {
trigger.directionGic().set_to_omit();
}
p += 1;
if ((flag & 0x0020) == 0x0020) {
trigger.layoutId() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(1, p)));
} else {
trigger.layoutId().set_to_omit();
}
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_ivim_trigger: ", trigger);
// Pass it to the ports if any
......@@ -941,70 +1063,46 @@ int ConfigRsuSimulatorLayer::process_ut_ivim_update(const OCTETSTRING& data, par
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_ivim_update: msg_id=%02x", msg_id);
unsigned char flag = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_ivim_update: flag=%02x", flag);
LibItsIvim__TypesAndValues::UtIvimUpdate update; // See ETSI TR 103 34 099 Cause C.4.1 GenerateIvimEvent
/* // Statuion ID
update.actionId().originatingStationID() = oct2int(OCTETSTRING(4, p));
p += 4;
// SequenceNumber
update.actionId().sequenceNumber() = oct2int(OCTETSTRING(2, p));
LibItsIvim__TypesAndValues::UtIvimUpdate update; // See ETSI TR 103 099 Cause C.4.1 GenerateIvimEvent
// IviIdentificationNumber
update.iviIdentificationNumber() = oct2int(OCTETSTRING(2, p));
p += 2;
// Decode detectionTime
update.detectionTime() = oct2int(OCTETSTRING(6, p));
p += 6;
// validFrom
if ((flag & 0x80) == 0x80) {
update.validityDuration() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
update.validFrom() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(6, p)));
} else {
update.validityDuration().set_to_omit();
update.validFrom().set_to_omit();
}
p += 3;
// Situation
p += 6;
// validTo
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);
update.validTo() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(6, p)));
} else {
update.situation().set_to_omit();
update.validTo().set_to_omit();
}
// Location
update.location().set_to_omit();
// RelevanceDistance
p += 6;
// timeStamp
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)));
update.timeStamp() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(6, p)));
} else {
update.transmissionInterval().set_to_omit();
update.timeStamp().set_to_omit();
}
p += 2;
if ((flag & 0x04) == 0x04) {
update.repetitionInterval() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(2, p)));
p += 6;
// connectedIviStructures
if ((flag & 0x01) == 0x01) {
PreGenRecordOf::PREGEN__RECORD__OF__INTEGER rov;
rov.set_size(*p++);
for (int i = 0; i < rov.size_of(); i++) {
rov[i] = oct2int(OCTETSTRING(4, p));
p += 4;
}
update.connectedIviStructures() = OPTIONAL<PreGenRecordOf::PREGEN__RECORD__OF__INTEGER>(rov);
} else {
update.repetitionInterval().set_to_omit();
}
p += 2;
// alacarteLength
INTEGER alacarte_length = oct2int(OCTETSTRING(1, p));
if (static_cast<int>(alacarte_length) != 0) {
update.connectedIviStructures().set_to_omit();
p += 1;
// FIXME AlacarteContainer alacarte optional
} else {
update.alacarte().set_to_omit();
}
loggers::get_instance().log_msg("ConfigRsuSimulatorLayer::process_ut_ivim_update: ", update);
*/
// Pass it to the ports if any
to_all_upper_ports(update, params);
} else {
......@@ -1054,7 +1152,7 @@ int ConfigRsuSimulatorLayer::process_ut_srem_trigger(const OCTETSTRING& data, pa
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_geonetworking_trigger: msg_id=%02x", msg_id);
LibItsSremSsem__TypesAndValues::UtSremTrigger trigger; // See ETSI TR 103 34 099
LibItsSremSsem__TypesAndValues::UtSremTrigger trigger; // See ETSI TR 103 099
// BasicVehicleRole
trigger.basicVehicleRole() = oct2int(OCTETSTRING(1, p++));
// Request Importance Level
......@@ -1085,7 +1183,7 @@ int ConfigRsuSimulatorLayer::process_ut_srem_update(const OCTETSTRING& data, par
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_geonetworking_update: msg_id=%02x", msg_id);
LibItsSremSsem__TypesAndValues::UtSremUpdate update; // See ETSI TR 103 34 099
LibItsSremSsem__TypesAndValues::UtSremUpdate update; // See ETSI TR 103 099
// RequestID
update.requestID() = oct2int(OCTETSTRING(1, p++));
// BasicVehicleRole
......@@ -1116,7 +1214,7 @@ int ConfigRsuSimulatorLayer::process_ut_srem_termination(const OCTETSTRING& data
unsigned char* p = (unsigned char*)static_cast<const unsigned char*>(data);
unsigned char msg_id = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_geonetworking_termination: msg_id=%02x", msg_id);
LibItsSremSsem__TypesAndValues::UtSremCancelation termination; // See ETSI TR 103 34 099
LibItsSremSsem__TypesAndValues::UtSremCancelation termination; // See ETSI TR 103 099
// RequestID
termination.requestID() = oct2int(OCTETSTRING(1, p++));
......@@ -1145,14 +1243,13 @@ int ConfigRsuSimulatorLayer::process_ut_rtcmem_trigger(const OCTETSTRING& data,
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_rtcmem_trigger: msg_id=%02x", msg_id);
unsigned char flag = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_rtcmem_trigger: flag=%02x", flag);
LibItsRtcmem__TypesAndValues::UtRtcmemTrigger trigger; // See ETSI TR 103 34 099 Cause C.10.1 GenerateRtcmemEvent
LibItsRtcmem__TypesAndValues::UtRtcmemTrigger trigger; // See ETSI TR 103 099 Cause C.10.1 GenerateRtcmemEvent
// Decode msgCnt
trigger.msgCnt() = *p++;
// Decode rev
trigger.rev() = DSRC::RTCM__Revision(static_cast<int>(*p++));
// Decode msgs
DSRC::RTCMmessageList msgs;
p += 1; // Skip COER flag
unsigned char num_items = *p++; // Number of items
msgs.set_size(num_items);
for (unsigned char i = 0; i < num_items; i++) {
......@@ -1161,19 +1258,21 @@ int ConfigRsuSimulatorLayer::process_ut_rtcmem_trigger(const OCTETSTRING& data,
p += len;
} // End of 'for' statement
trigger.msgs() = msgs;
// ValidityDuration
// timeStamp
if ((flag & 0x80) == 0x80) {
// TODO trigger.timeStamp() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
} else {
trigger.timeStamp().set_to_omit();
}
// TODO p += 3;
// anchorPoint
if ((flag & 0x40) == 0x40) {
// TODO trigger.anchorPoint() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
} else {
trigger.anchorPoint().set_to_omit();
}
// TODO p += 3;
// rtcmHeader
if ((flag & 0x20) == 0x20) {
// TODO trigger.rtcmHeader() = OPTIONAL<INTEGER>(oct2int(OCTETSTRING(3, p)));
} else {
......@@ -1206,7 +1305,7 @@ int ConfigRsuSimulatorLayer::process_ut_rtcmem_update(const OCTETSTRING& data, p
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_rtcmem_update: msg_id=%02x", msg_id);
unsigned char flag = *p++;
loggers::get_instance().log("ConfigRsuSimulatorLayer::process_ut_rtcmem_update: flag=%02x", flag);
LibItsRtcmem__TypesAndValues::UtRtcmemUpdate update; // See ETSI TR 103 34 099 Cause C.10.2 GenerateRtcmemUpdate
LibItsRtcmem__TypesAndValues::UtRtcmemUpdate update; // See ETSI TR 103 099 Cause C.10.2 GenerateRtcmemUpdate
// Decode msgs
DSRC::RTCMmessageList msgs;
p += 1; // Skip COER flag
......
......@@ -72,7 +72,7 @@ private:
int process_ut_ivim_trigger(const OCTETSTRING& data, params& params);
int process_ut_ivim_update(const OCTETSTRING& data, params& params);
int process_ut_ivim_termination(const OCTETSTRING& data, params& params);
int process_ut_mapemspatem_trigger(const OCTETSTRING& data, params& params);
int process_ut_mapem_spatem_trigger(const OCTETSTRING& data, params& params);
int process_ut_srem_trigger(const OCTETSTRING& data, params& params);
int process_ut_srem_update(const OCTETSTRING& data, params& params);
int process_ut_srem_termination(const OCTETSTRING& data, params& params);
......
......@@ -54,15 +54,11 @@ void btp_layer::send_data(OCTETSTRING& data, params& params) {
} else {
btp_type = _params[params::btp_type];
}
int btp_destination_port = std::stoi(_params[params::btp_destination_port]);
it = _params.find(params::ssem_destination_port);
if (it != _params.cend()) {
btp_destination_port = std::stoi(_params[params::ssem_destination_port]);
} else {
it = _params.find(params::spatem_destination_port);
if (it != _params.cend()) {
btp_destination_port = std::stoi(_params[params::spatem_destination_port]);
}
loggers::get_instance().log("btp_layer::send_data: btp_type=%s", btp_type.c_str());
int btp_destination_port = std::stoi(_params[params::btp_destination_port]); // Default value
it = params.find(params::btp_destination_port);
if (it != params.cend()) {
btp_destination_port = std::stoi(params[params::btp_destination_port]); // Overwritting default value
}
loggers::get_instance().log("btp_layer::send_data: btp_destination_port=%d", btp_destination_port);
if (btp_type.compare("btpA") == 0) {
......@@ -94,7 +90,7 @@ void btp_layer::send_data(OCTETSTRING& data, params& params) {
void btp_layer::receive_data(OCTETSTRING& data, params& params)
{
loggers::get_instance().log_msg(">>> btp_layer::receive_data: ", data);
params.log();
params.log();
// Decode the payload
LibItsBtp__TestSystem::BtpInd p;
loggers::get_instance().log("btp_layer::receive_data: Looking for %s", params::gn_next_header.c_str());
......@@ -104,7 +100,7 @@ void btp_layer::receive_data(OCTETSTRING& data, params& params)
_codec.set_btp_type((it->second.compare("2") == 0) ? btp_codec::btpB : btp_codec::btpA);
}
_codec.decode(data, p.msgIn(), &params);
// Pass the BTP raw payload to the upper layers if any
it = params.find(params::btp_payload);
if (it != params.cend()) {
......
......@@ -57,8 +57,15 @@ void cam_layer::receive_data(OCTETSTRING& data, params& params)
} // else, continue
// Process lower layer data
// recvTime
params::const_iterator it = params.find(params::timestamp);
if (it != params.cend()) {
p.recvTime().set_long_long_val(std::stoll(it->second));
} else {
p.recvTime().set_to_omit();
}
// gnNextHeader
params::const_iterator it = params.find(params::gn_next_header);
it = params.find(params::gn_next_header);
if (it != params.cend()) {
p.gnNextHeader() = std::stoi(it->second);
} else {
......
......@@ -57,8 +57,15 @@ void denm_layer::receive_data(OCTETSTRING& data, params& params)
} // else, continue
// Process lower layer data
// recvTime
params::const_iterator it = params.find(params::timestamp);
if (it != params.cend()) {
p.recvTime().set_long_long_val(std::stoll(it->second));
} else {
p.recvTime().set_to_omit();
}
// gnNextHeader
params::const_iterator it = params.find(params::gn_next_header);
it = params.find(params::gn_next_header);
if (it != params.cend()) {
p.gnNextHeader() = std::stoi(it->second);
} else {
......
......@@ -30,6 +30,18 @@ void ivim_layer::sendMsg(const LibItsIvim__TestSystem::IvimReq& p, params& param
send_data(data, _params);
}
void ivim_layer::sendMsg(const LibItsIvim__TestSystem::IvimInd& p, params& params){
loggers::get_instance().log_msg(">>> ivim_layer::sendMsg: ", p);
// Encode IVIM PDU
OCTETSTRING data;
if (_codec.encode(p.msgIn(), data) == -1) {
loggers::get_instance().warning("ivim_layer::sendMsg: Encoding failure");
return;
}
send_data(data, _params);
}
void ivim_layer::send_data(OCTETSTRING& data, params& params) {
loggers::get_instance().log_msg(">>> ivim_layer::send_data: ", data);
//params.log();
......@@ -57,8 +69,15 @@ void ivim_layer::receive_data(OCTETSTRING& data, params& params)
} // else, continue
// Process lower layer data
// recvTime
params::const_iterator it = params.find(params::timestamp);
if (it != params.cend()) {
p.recvTime().set_long_long_val(std::stoll(it->second));
} else {
p.recvTime().set_to_omit();
}
// gnNextHeader
params::const_iterator it = params.find(params::gn_next_header);
it = params.find(params::gn_next_header);
if (it != params.cend()) {
p.gnNextHeader() = std::stoi(it