Commit 98835431 authored by garciay's avatar garciay
Browse files

Validate AtsRSUSimulator for CAM & DENM

parent f48a7963
......@@ -52,7 +52,7 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
OCTETSTRING is = bit2oct(b);
// Calculate the size of the lower layers information
int s = (
unsigned int s = (
LibItsGeoNetworking__TestSystem::GeoNetworkingInd_macDestinationAddress_raw_.fieldlength +
LibItsGeoNetworking__TestSystem::GeoNetworkingInd_its__aid_raw_.fieldlength
) / 8;
......@@ -118,7 +118,7 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
OCTETSTRING is = bit2oct(b);
// Calculate the size of the lower layers information
int s = (
unsigned int s = (
LibItsGeoNetworking__TestSystem::GeoNetworkingInd_macDestinationAddress_raw_.fieldlength +
LibItsGeoNetworking__TestSystem::GeoNetworkingInd_ssp_raw_.fieldlength +
LibItsGeoNetworking__TestSystem::GeoNetworkingInd_its__aid_raw_.fieldlength
......@@ -135,7 +135,7 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
if (p_geoNetworkingInd.get_at(i)->is_optional()) {
loggers::get_instance().log("fx__dec__GeoNetworkingInd: Bytes remaining: %d - field lenth: %d", decoding_buffer.get_len() - decoding_buffer.get_pos(), p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8);
if (std::string(p_geoNetworkingInd.fld_name(i)).compare("ssp") == 0) {
if ((decoding_buffer.get_len() - decoding_buffer.get_pos()) >= (int)p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8) {
if ((decoding_buffer.get_len() - decoding_buffer.get_pos()) >= (unsigned int)p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8) {
loggers::get_instance().log("fx__dec__GeoNetworkingInd: decoding %s", p_geoNetworkingInd.fld_descr(i)->name);
BITSTRING ssp;
ssp.decode(*p_geoNetworkingInd.fld_descr(i), decoding_buffer, TTCN_EncDec::CT_RAW);
......@@ -147,7 +147,7 @@ namespace LibItsGeoNetworking__EncdecDeclarations {
}
} else if (std::string(p_geoNetworkingInd.fld_name(i)).compare("its_aid") == 0) {
loggers::get_instance().log("fx__dec__GeoNetworkingInd: Bytes remaining: %d - its_aid lenth: %d", decoding_buffer.get_len() - decoding_buffer.get_pos(), p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8);
if ((decoding_buffer.get_len() - decoding_buffer.get_pos()) >= (int)p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8) {
if ((decoding_buffer.get_len() - decoding_buffer.get_pos()) >= (unsigned int)p_geoNetworkingInd.fld_descr(i)->raw->fieldlength / 8) {
INTEGER its_aid;
its_aid.decode(*p_geoNetworkingInd.fld_descr(i), decoding_buffer, TTCN_EncDec::CT_RAW);
loggers::get_instance().log_msg("fx__dec__GeoNetworkingInd: its_aid=", its_aid);
......
......@@ -13,7 +13,7 @@ int EtsiTs103097Codec_Data::encode (const IEEE1609dot2::Ieee1609Dot2Data& p_ieee
BITSTRING b;
TTCN_EncDec::clear_error();
TTCN_Buffer buffer;
p_ieee1609Dot2Data.encode(*p_ieee1609Dot2Data.get_descriptor(), buffer, TTCN_EncDec::CT_RAW);
p_ieee1609Dot2Data.encode(*p_ieee1609Dot2Data.get_descriptor(), buffer, TTCN_EncDec::CT_OER);
p_data = OCTETSTRING(buffer.get_len(), buffer.get_data());
loggers::get_instance().log_msg("EtsiTs103097Codec_Data::encode: ", p_data);
......@@ -27,7 +27,7 @@ int EtsiTs103097Codec_Data::decode (const OCTETSTRING& p_data, IEEE1609dot2::Iee
TTCN_EncDec::clear_error();
TTCN_Buffer decoding_buffer(p_data);
_params = p_params;
p_ieee1609Dot2Data.decode(*p_ieee1609Dot2Data.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_RAW);
p_ieee1609Dot2Data.decode(*p_ieee1609Dot2Data.get_descriptor(), decoding_buffer, TTCN_EncDec::CT_OER);
loggers::get_instance().log_msg("<<< EtsiTs103097Codec_Data::decode: ", (const Base_Type&)p_ieee1609Dot2Data);
return 0;
......
Markdown is supported
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