Commit 58456f67 authored by YannGarcia's avatar YannGarcia
Browse files

Fallback to one folder per ITS protocol for both Codecs & Layers

parent 60de7bdc
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -11,11 +11,13 @@ sources += LibItsBtp_Encdec.cc
endif
endif


ifeq (AtsCAM, $(ATS))
ifeq (AtsCAM, $(ATS))
sources += LibItsCam_Encdec.cc
sources += LibItsCam_Encdec.cc \
           LibItsBtp_Encdec.cc
endif
endif


ifeq (AtsDENM, $(ATS))
ifeq (AtsDENM, $(ATS))
sources += LibItsDenm_Encdec.cc
sources += LibItsDenm_Encdec.cc \
           LibItsBtp_Encdec.cc
endif
endif


ifeq (AtsRSUsSimulator, $(ATS))
ifeq (AtsRSUsSimulator, $(ATS))
@@ -40,7 +42,9 @@ sources += \
endif
endif


ifeq (AtsIS, $(ATS))
ifeq (AtsIS, $(ATS))
sources += LibItsIvim_Encdec.cc \
sources += \
           LibItsBtp_Encdec.cc \
           LibItsIvim_Encdec.cc \
           LibItsSremSsem_Encdec.cc \
           LibItsSremSsem_Encdec.cc \
           LibItsMapemSpatem_Encdec.cc \
           LibItsMapemSpatem_Encdec.cc \
           LibItsRtcmem_Encdec.cc
           LibItsRtcmem_Encdec.cc
@@ -48,10 +52,8 @@ endif


ifeq (AtsPki, $(ATS))
ifeq (AtsPki, $(ATS))
sources += \
sources += \
           LibItsBtp_Encdec.cc \
           LibItsPki_Encdec.cc \
           LibItsPki_Encdec.cc \
           LibItsCam_Encdec.cc \
           LibItsCam_Encdec.cc \
           LibItsHttp_Encdec.cc
           LibItsHttp_Encdec.cc
endif
endif

#           LibItsPki_Encdec.cc
#           LibItsEvcsn_Encdec.cc \
+9 −9
Original line number Original line Diff line number Diff line
@@ -14,19 +14,19 @@
#endif
#endif


#ifdef AtsCAM
#ifdef AtsCAM
//#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#endif
#endif


#ifdef AtsDENM
#ifdef AtsDENM
//#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#endif
#endif


#ifdef AtsSecurity
#ifdef AtsSecurity
//#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
@@ -42,7 +42,7 @@
#endif
#endif


#ifdef AtsIS
#ifdef AtsIS
//#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#include "IVIM_ports/UpperTesterPort_IVIM.hh"
#include "IVIM_ports/UpperTesterPort_IVIM.hh"
#include "MapemSpatem_ports/UpperTesterPort_MapemSpatem.hh"
#include "MapemSpatem_ports/UpperTesterPort_MapemSpatem.hh"
@@ -55,7 +55,7 @@
#endif
#endif


#ifdef AtsRSUsSimulator // This is not an Abstract Test Suit, but an helper tool to simulate basic RSU/OBU functionalities
#ifdef AtsRSUsSimulator // This is not an Abstract Test Suit, but an helper tool to simulate basic RSU/OBU functionalities
//#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "BTP_ports/UpperTesterPort_BTP.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "CAM_ports/UpperTesterPort_CAM.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "DENM_ports/UpperTesterPort_DENM.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
#include "GN_ports/UpperTesterPort_GN.hh"
@@ -77,19 +77,19 @@
#endif
#endif


#ifdef AtsCAM
#ifdef AtsCAM
//#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_CAM.hh"
#include "UpperTesterPort_CAM.hh"
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_GN.hh"
#endif
#endif


#ifdef AtsDENM
#ifdef AtsDENM
//#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_DENM.hh"
#include "UpperTesterPort_DENM.hh"
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_GN.hh"
#endif
#endif


#ifdef AtsSecurity
#ifdef AtsSecurity
//#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_CAM.hh"
#include "UpperTesterPort_CAM.hh"
#include "UpperTesterPort_DENM.hh"
#include "UpperTesterPort_DENM.hh"
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_GN.hh"
@@ -103,7 +103,7 @@
#endif
#endif


#ifdef AtsIS
#ifdef AtsIS
//#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_BTP.hh"
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_GN.hh"
#include "UpperTesterPort_IVIM.hh"
#include "UpperTesterPort_IVIM.hh"
#include "UpperTesterPort_MapemSpatem.hh"
#include "UpperTesterPort_MapemSpatem.hh"
+2 −2
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ cam_layer::cam_layer(const std::string &p_type, const std::string &param) : t_la
  registration<cam_layer>::get_instance().add_item(p_type, this);
  registration<cam_layer>::get_instance().add_item(p_type, this);
}
}


void cam_layer::sendMsg(const LibItsCam__TestSystem::CamReq &p, params &params) {
void cam_layer::sendMsg(const LibItsCam__TypesAndValues::CamReq &p, params &params) {
  loggers::get_instance().log_msg(">>> cam_layer::sendMsg: ", p);
  loggers::get_instance().log_msg(">>> cam_layer::sendMsg: ", p);


  // Encode CAM PDU
  // Encode CAM PDU
@@ -48,7 +48,7 @@ void cam_layer::receive_data(OCTETSTRING &data, params &params) {
  }
  }


  // Decode the payload
  // Decode the payload
  LibItsCam__TestSystem::CamInd p;
  LibItsCam__TypesAndValues::CamInd p;
  _codec.decode(data, p.msgIn());
  _codec.decode(data, p.msgIn());
  if (!p.msgIn().is_bound()) {
  if (!p.msgIn().is_bound()) {
    // Discard it
    // Discard it
+1 −1
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ public: //! \publicsection
   * \param[in] p_cam_req The CA message to be sent
   * \param[in] p_cam_req The CA message to be sent
   * \param[in] p_params Some parameters to overwrite default value of the lower layers parameters
   * \param[in] p_params Some parameters to overwrite default value of the lower layers parameters
   */
   */
  void sendMsg(const LibItsCam__TestSystem::CamReq &p_cam_req, params &p_params);
  void sendMsg(const LibItsCam__TypesAndValues::CamReq &p_cam_req, params &p_params);


  /*!
  /*!
   * \virtual
   * \virtual
+0 −28
Original line number Original line Diff line number Diff line
#include "LibItsCam_TypesAndValues.hh"

#include "cam_codec.hh"
#include "asn1/asn_application.h" // from asn1c
#include "loggers.hh"

int cam_codec::encode(const CAM__PDU__Descriptions::CAM &cam, OCTETSTRING &data) {
  loggers::get_instance().log(">>> cam_codec::encode");

  BITSTRING b;
  int       rc = asn_codec.encode(cam, b);
  if (rc) {
    data = bit2oct(b);
    loggers::get_instance().log_msg("cam_codec::encode: ", data);
  }
  return rc;
}

int cam_codec::decode(const OCTETSTRING &data, CAM__PDU__Descriptions::CAM &cam, params *params) {
  loggers::get_instance().log_msg(">>> cam_codec::decode: ", data);

  int rc = asn_codec.decode(oct2bit(data), cam);
  loggers::get_instance().log("cam_codec::decode: ASN.1 codec returned %d", rc);
  if (rc) {
    loggers::get_instance().log_msg("cam_codec::decode: ", cam);
  }
  return rc;
}
Loading