Commit 790f2281 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed on DENM UpperTester codec

parent eeb81561
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,9 +15,6 @@
		{
			"path": "../../frameworks/fsmsggen"
		},
		{
			"path": "../itscertgen"
		},
		{
			"path": "../../tmp/titan_etsi_its_per_issue"
		},
@@ -29,6 +26,9 @@
		},
		{
			"path": "../TS.ITS.pipeline-scripts"
		},
		{
			"path": "../itscertgen-r2"
		}
	],
	"settings": {
+6 −9
Original line number Diff line number Diff line
@@ -1712,18 +1712,15 @@ int ConfigRsuSimulatorLayer::set_cause_code_choice(const int p_cause, ETSI__ITS_
    case ETSI__ITS__CDD::CauseCodeChoice::ALT_wrongWayDriving14:
      p_causeCodeChoice.wrongWayDriving14() = ETSI__ITS__CDD::CauseCodeChoice::ALT_wrongWayDriving14;
      break;
    case ETSI__ITS__CDD::CauseCodeChoice::ALT_slowVehicle26:
      p_causeCodeChoice.slowVehicle26() = ETSI__ITS__CDD::CauseCodeChoice::ALT_slowVehicle26;
      break;
    case ETSI__ITS__CDD::CauseCodeChoice::ALT_rescueAndRecoveryWorkInProgress15:
      p_causeCodeChoice.rescueAndRecoveryWorkInProgress15() = ETSI__ITS__CDD::CauseCodeChoice::ALT_rescueAndRecoveryWorkInProgress15;
      break;









    case ETSI__ITS__CDD::CauseCodeChoice::ALT_vehicleBreakdown91:
      p_causeCodeChoice.vehicleBreakdown91() = ETSI__ITS__CDD::CauseCodeChoice::ALT_vehicleBreakdown91;
      break;
    default:
      loggers::get_instance().error("ConfigRsuSimulatorLayer::set_cause_code_choice: Unsupported cause: %d", p_cause);
      return -1;
+310 −300
Original line number Diff line number Diff line
@@ -172,6 +172,16 @@ int uppertester_denm_codec::encode_(const Base_Type &type, const TTCN_Typedescri
      const INTEGER &i = static_cast<const INTEGER &>(type);
      loggers::get_instance().log("uppertester_denm_codec::encode_: o=%02x", *static_cast<const uint8_t *>(int2oct(i, 1)));
      encoding_buffer.put_c(*static_cast<const uint8_t *>(int2oct(i, 1)));
    } else if (s.rfind(".ccAndScc") != string::npos) {
      const ETSI__ITS__CDD::CauseCodeChoice& causeCodeChoice = static_cast<const ETSI__ITS__CDD::CauseCodeChoice&>(type);
      const INTEGER &i = static_cast<const INTEGER &>(static_cast<int>(causeCodeChoice.get_selection()));
      loggers::get_instance().log("uppertester_denm_codec::encode_: o=%02x", *static_cast<const uint8_t *>(int2oct(i, 1)));
      encoding_buffer.put_c(*static_cast<const uint8_t *>(int2oct(i, 1)));
    } else if (s.rfind(".awarenessDistance") != string::npos) {
      const ETSI__ITS__CDD::RelevanceDistance& awarenessDistance = static_cast<const ETSI__ITS__CDD::RelevanceDistance&>(type);
      const INTEGER &i = static_cast<const INTEGER &>(ETSI__ITS__CDD::RelevanceDistance::enum2int(awarenessDistance));
      loggers::get_instance().log("uppertester_denm_codec::encode_: o=%02x", *static_cast<const uint8_t *>(int2oct(i, 1)));
      encoding_buffer.put_c(*static_cast<const uint8_t *>(int2oct(i, 1)));
    } else if ((s.rfind(".linkedCause") != string::npos) || (s.rfind(".eventHistory") != string::npos)) {
      // Skip them
    } else if ((s.rfind(".transmissionInterval") != string::npos) || (s.rfind(".repetitionInterval") != string::npos)) {
+2 −2
Original line number Diff line number Diff line
@@ -85,10 +85,10 @@ LogEventTypes:= Yes
#     time_offset : Time offset, used to skip packets with time offset < time_offset
#     save_mode   : Set to 1 to save sent packet, 0 otherwise

system.denmPort.params := "DENM(next_header=btpB,header_type=tsb)/BTP(dst_port=2002)/GN(ll_address=4C5E0C14D2EA,latitude=367470519,longitude=-455595023,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=1,sec_db_path=../data/certificates/certificates)/ETH(mac_src=8c554ac1eee0)/PCAP(mac_src=8c554ac1eee0,nic=wlp0s20f3,filter=and ether proto 0x8947)"
system.denmPort.params := "DENM(next_header=btpB,header_type=tsb)/BTP(dst_port=2002)/GN(ll_address=4C5E0C14D2EA,latitude=367470519,longitude=-455595023,distanceA=1500,distanceB=1500,angle=0,device_mode=1,secured_mode=1,sec_db_path=../data/certificates/certificates)/ETH(mac_src=181dea7eb7d3)/PCAP(mac_src=181dea7eb7d3,nic=wlo1,filter=and ether proto 0x8947)"

# DENM UpperTester port based on UDP
system.utPort.params := "UT_DENM/UDP(dst_ip=192.168.1.43,dst_port=12345,src_port=12346)"
system.utPort.params := "UT_DENM/UDP(dst_ip=192.168.1.21,dst_port=12345,src_port=12346)"

[EXECUTE]
# Check that protocolVersion is set to 2 and messageID is set to 1