Commit 178da1b0 authored by Bostjan Pintar's avatar Bostjan Pintar
Browse files

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

parents 74538a93 a5579b4e
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 */
......
......@@ -886,34 +886,99 @@ int ConfigRsuSimulatorLayer::process_ut_ivim_trigger(const OCTETSTRING& data, pa
LibItsIvim__TypesAndValues::UtIvimTrigger trigger; // See ETSI TR 103 34 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
......@@ -942,69 +1007,45 @@ int ConfigRsuSimulatorLayer::process_ut_ivim_update(const OCTETSTRING& data, par
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));
// 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 {
......@@ -1152,7 +1193,6 @@ int ConfigRsuSimulatorLayer::process_ut_rtcmem_trigger(const OCTETSTRING& data,
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 +1201,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 {
......
......@@ -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->second);
} else {
......
......@@ -28,7 +28,8 @@ public:
virtual ~ivim_layer() {};
void sendMsg(const LibItsIvim__TestSystem::IvimReq&, params& params);
void sendMsg(const LibItsIvim__TestSystem::IvimInd&, params& params);
virtual void send_data(OCTETSTRING& data, params& params);
virtual void receive_data(OCTETSTRING& data, params& info);
......
......@@ -61,8 +61,15 @@ void mapem_spatem_layer::receive_data(OCTETSTRING& data, params& params)
return;
} // 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 {
......@@ -137,8 +144,15 @@ void mapem_spatem_layer::receive_data(OCTETSTRING& data, params& params)
return;
} // 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 {
......
......@@ -219,11 +219,11 @@ void* pcap_layer::thread() {
std::time_t t = pkt_header->ts.tv_sec;
std::tm * pt = std::localtime( &t );
t = std::strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", pt);
std::sprintf(buf+t, ".%06ld", pkt_header->ts.tv_usec);
_o_params["timestamp"] = std::string(buf);
std::sprintf(buf+t, "%ld", pkt_header->ts.tv_sec * 1000 + static_cast<int>(pkt_header->ts.tv_usec / 1000)); // Use milliseconds
_o_params[params::timestamp] = std::string(buf);
}
#else
_o_params["timestamp"] = std::to_string(pkt_header->ts.tv_usec);
_o_params[params::timestamp] = std::to_string(pkt_header->ts.tv_sec * 1000 + static_cast<int>(pkt_header->ts.tv_usec / 1000)); // Use milliseconds
#endif
_o_data = OCTETSTRING(pkt_header->len, pkt_data);
write(_fd[1], &pkt_count, 1);pkt_count++;
......
......@@ -244,10 +244,10 @@ void pcap_layer::Handle_Fd_Event_Readable(int fd) {
int result = pcap_next_ex(_device, (struct pcap_pkthdr**)&pkt_header, &pkt_data);
if (result == 1) { // Succeed
if (pkt_header->caplen > 14) { // Reject too small packet
//loggers::get_instance().log("pcap_layer::Handle_Fd_Event_Readable: %.6d - %d", pkt_header->ts.tv_usec, pkt_header->len);
//loggers::get_instance().log("pcap_layer::Handle_Fd_Event_Readable: %ld - % ld - %d", pkt_header->ts.tv_sec, pkt_header->ts.tv_usec, pkt_header->len);
// Fill parameters from PCAP layer
params params;
params.insert(std::pair<std::string, std::string>(std::string("timestamp"), std::to_string(pkt_header->ts.tv_usec)));
params.insert(std::pair<std::string, std::string>(params::timestamp, std::to_string(pkt_header->ts.tv_sec * 1000 + static_cast<int>(pkt_header->ts.tv_usec / 1000)))); // Use milliseconds
// Process the packet at this layer
OCTETSTRING os(pkt_header->caplen, pkt_data);
//loggers::get_instance().log_to_hexa("pcap_layer::Handle_Fd_Event_Readable: ", os);
......
......@@ -178,10 +178,10 @@ void pcap_layer::Handle_Fd_Event_Readable(int fd) {
int result = pcap_next_ex(_device, &pkt_header, &pkt_data);
if (result == 1) { // Succeed
if (pkt_header->caplen > 14) { // Reject too small packet
//loggers::get_instance().log("pcap_layer::Handle_Fd_Event_Readable: %.6d - %d", pkt_header->ts.tv_usec, pkt_header->len);
loggers::get_instance().log("pcap_layer::Handle_Fd_Event_Readable: %ld - %ld - %ld - %d", pkt_header->ts.tv_sec, pkt_header->ts.tv_usec, pkt_header->ts.tv_sec * 1000 + static_cast<unsigned int>(pkt_header->ts.tv_usec / 1000), pkt_header->len);
// Fill parameters from PCAP layer
params params;
params.insert(std::pair<std::string, std::string>(std::string("timestamp"), std::to_string(pkt_header->ts.tv_usec)));
params.insert(std::pair<std::string, std::string>(params::timestamp, std::to_string(pkt_header->ts.tv_sec * 1000 + static_cast<unsigned int>(pkt_header->ts.tv_usec / 1000)))); // Use milliseconds
// Process the packet at this layer
OCTETSTRING os(pkt_header->caplen, pkt_data);
//loggers::get_instance().log_to_hexa("pcap_layer::Handle_Fd_Event_Readable: ", os);
......
......@@ -32,7 +32,6 @@ void RtcmemLayer::sendMsg(const LibItsRtcmem__TestSystem::RtcmemReq& p, params&
void RtcmemLayer::send_data(OCTETSTRING& data, params& params) {
loggers::get_instance().log_msg(">>> RtcmemLayer::send_data: ", data);
//params.log();
send_to_all_layers(data, params);
}
......@@ -49,8 +48,15 @@ void RtcmemLayer::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 {
......
......@@ -10,6 +10,9 @@ SremSsemLayer::SremSsemLayer(const std::string & p_type, const std::string & par
loggers::get_instance().log(">>> SremSsemLayer::SremSsemLayer: %s, %s", to_string().c_str(), param.c_str());
// Setup parameters
params::convert(_params, param);
_params.insert(std::make_pair<std::string, std::string>("its_aid", "140")); // ETSI TS 102 965 V1.2.1 (2015-06)
_params.insert(std::make_pair<std::string, std::string>("payload_type", "2"));
_params.insert(std::make_pair<std::string, std::string>("dst_port", "2007"));
// Register this object for AdapterControlPort
loggers::get_instance().log("SremSsemLayer::SremSsemLayer: Register %s/%p", p_type.c_str(), this);
......@@ -25,6 +28,8 @@ void SremSsemLayer::sendMsg(const LibItsSremSsem__TestSystem::SremReq& p, params
loggers::get_instance().warning("SremSsemLayer::sendMsg: Encoding failure");
return;
}
_params[params::btp_destination_port] = "2007";
send_data(data, _params);
}
......@@ -37,6 +42,7 @@ void SremSsemLayer::sendMsg(const LibItsSremSsem__TestSystem::SsemReq& p, params
loggers::get_instance().warning("SremSsemLayer::sendMsg: Encoding failure");
return;
}
_params[params::btp_destination_port] = "2008";
send_data(data, _params);
}
......@@ -60,8 +66,15 @@ void SremSsemLayer::receive_data(OCTETSTRING& data, params& params)
return;
} // 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 {
......@@ -136,8 +149,14 @@ void SremSsemLayer::receive_data(OCTETSTRING& data, params& params)
return;
} // else, continue