Commit 46f95873 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in UEDISTSUB

parent 14bc6d3d
Loading
Loading
Loading
Loading
+0 −214
Original line number Diff line number Diff line
@@ -28,38 +28,6 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE
    const UEAppInterfaceAPI__TypesAndValues::AppContext& app_context = msg.appContext();
    app_context.encode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = char2oct(CHARSTRING("{\"AppContext\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}"));
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_serviceInfo)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo();
    service_info.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"ServiceInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appInfo__regapps)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo& app_info = msg.appInfo__regapps();
    app_info.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"AppInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription();
    app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationConfirmation)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationConfirmation& app = msg.appTerminationConfirmation();
    app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationConfirmation_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"AppTerminationConfirmation\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appReadyConfirmation)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::AppReadyConfirmation& app = msg.appReadyConfirmation();
    app.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppReadyConfirmation_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"AppTerminationConfirmation\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule();
    dns_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"DnsRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_serAvailabilityNotificationSubscription)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription& ser = msg.serAvailabilityNotificationSubscription();
    ser.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = /*char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule();
    traffic_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) {
    const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo();
    bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
@@ -68,32 +36,6 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE
    const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo();
    mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_predictedQos)) {
    const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos();
    predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgDistributionServerInfo)) {
    const V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo& v2x_msg_distribution_server_info = msg.v2xMsgDistributionServerInfo();
    v2x_msg_distribution_server_info.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuUniSubscription)) {
    const V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription& prov_chg_uu_uni_subscription = msg.provChgUuUniSubscription();
    prov_chg_uu_uni_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuMbmsSubscription)) {
    const V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription& prov_chg_uu_mbms_subscription = msg.provChgUuMbmsSubscription();
    prov_chg_uu_mbms_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgPc5Subscription)) {
    const V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription& prov_chg_pc5_subscription = msg.provChgPc5Subscription();
    prov_chg_pc5_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgSubscription)) {
    const V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription& v2x_msg_subscription = msg.v2xMsgSubscription();
    v2x_msg_subscription.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;


  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_assocStaSubscription)) {
    const WlanInformationAPI__TypesAndValues::AssocStaSubscription& assoc_sta_subscription = msg.assocStaSubscription();
    assoc_sta_subscription.encode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
@@ -147,90 +89,6 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
    UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info;
    ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.ueIdentityTagInfo() = ue_identity_tag_info;
  } else if (it->second.find("\"serName\"") != std::string::npos) { // Be careful to the order
                                                                    // TODO To be refined, find("\"accessPointList\"") is not optimal
    if (it->second[0] == '[') {
      std::size_t it_start;
      while ((it_start = str.find("null")) != std::string::npos) {
        loggers::get_instance().log("json_codec::decode: id_start=%d", it_start);
        loggers::get_instance().log("json_codec::decode: Before, str=%s", str.c_str());
        std::size_t it_stop = it_start + 4;
        loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop);
        loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str());
        if ((str[it_start - 3] == 'n') || (str[it_start - 3] == 's')) { // fqdn or uris or addresses
          str = str.substr(0, it_start) + "[]" + str.substr(it_stop);
        } else {
          str = str.substr(0, it_start) + "{}" + str.substr(it_stop);
        }
        loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str());
      } // End of 'while' statement
      decoding_buffer.clear();
      decoding_buffer.put_os(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
      EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfoList service_info_list;
      service_info_list.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.serviceInfoList() = service_info_list;
    } else {
      EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo service_info;
      service_info.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.serviceInfo() = service_info;
    }
  } else if (it->second.find("\"security\"") != std::string::npos) { // Be careful to the order
                                                                     // TODO To be refined, find("\"accessPointList\"") is not optimal
    std::size_t it_start;
    while ((it_start = str.find("null")) != std::string::npos) {
      loggers::get_instance().log("json_codec::decode: id_start=%d", it_start);
      loggers::get_instance().log("json_codec::decode: Before, str=%s", str.c_str());
      std::size_t it_stop = it_start + 4;
      loggers::get_instance().log("json_codec::decode: id_stop=%d", it_stop);
      loggers::get_instance().log("json_codec::decode: segment=%s", str.substr(it_start, it_stop - it_start).c_str());
      str = str.substr(0, it_start) + "{}" + str.substr(it_stop);
      loggers::get_instance().log("json_codec::decode: After, str=%s", str.c_str());
    } // End of 'while' statement
    decoding_buffer.clear();
    decoding_buffer.put_os(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    EdgePlatformApplicationEnablementAPI__TypesAndValues::TransportInfoList transport_info_list;
    transport_info_list.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TransportInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.transportInfoList() = transport_info_list;
  } else if (it->second.find("\"trafficRuleId\"") != std::string::npos) {
    if (it->second[0] == '[') {
      EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRuleList traffic_rule_list;
      traffic_rule_list.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRuleList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.trafficRuleList() = traffic_rule_list;
    } else {
      EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule traffic_rule;
      traffic_rule.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.trafficRule() = traffic_rule;
    }
  } else if (it->second.find("\"dnsRuleId\"") != std::string::npos) {
    if (it->second[0] == '[') {
      EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRuleList dns_rule_list;
      dns_rule_list.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRuleList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.dnsRuleList() = dns_rule_list;
    } else {
      EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule dns_rule;
      dns_rule.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.dnsRule() = dns_rule;
    }
  } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("\"subscriptions\"") != std::string::npos)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::SubscriptionLinkList sub_link_list;
    sub_link_list.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.subscriptionLinkList__app__ens() = sub_link_list;
  } else if (it->second.find("\"AppTerminationNotificationSubscription\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription app_term;
    app_term.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appTerminationNotificationSubscription() = app_term;
  } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SerAvailabilityNotificationSubscription\"") != std::string::npos)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription ser_av;
    ser_av.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.serAvailabilityNotificationSubscription() = ser_av;
  } else if ((it->second.find("\"ntpServers\"") != std::string::npos) || (it->second.find("{\"timeStamp\"") == 0)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::TimingCaps timing_caps;
    timing_caps.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TimingCaps_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.timingCaps() = timing_caps;
  } else if (it->second.find("\"timeSourceStatus\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::CurrentTime current_time;
    current_time.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::CurrentTime_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.currentTime() = current_time;
  } else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) {
    RnisAPI__TypesAndValues::CellChangeSubscription cell_change_subscription;
    cell_change_subscription.decode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
@@ -317,69 +175,6 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.mtsSessionInfo() = mts_session_info;
  } else if ((it->second.find("\"uuUnicastProvisioningInfo\"") != std::string::npos) || (it->second.find("\"proInfoUuUnicast\"") != std::string::npos)) {
    V2XInformationServiceAPI__TypesAndValues::UuUnicastProvisioningInfo uu_unicast_provisioning_info;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    uu_unicast_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::UuUnicastProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.uuUnicastProvisioningInfo() = uu_unicast_provisioning_info;
  } else if ((it->second.find("\"uuMbmsProvisioningInfo\"") != std::string::npos) || (it->second.find("\"proInfoUuMbms\"") != std::string::npos)) {
    V2XInformationServiceAPI__TypesAndValues::UuMbmsProvisioningInfo uu_mbms_provisioning_info;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    uu_mbms_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::UuMbmsProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.uuMbmsProvisioningInfo() = uu_mbms_provisioning_info;
  } else if ((it->second.find("\"pc5ProvisioningInfo\"") != std::string::npos) || (it->second.find("\"proInfoPc5\"") != std::string::npos)) {
    V2XInformationServiceAPI__TypesAndValues::Pc5ProvisioningInfo pc5_provisioning_info;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    pc5_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::Pc5ProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.pc5ProvisioningInfo() = pc5_provisioning_info;
  } else if ((it->second.find("\"predictedQos\"") != std::string::npos) || (it->second.find("\"locationGranularity\"") != std::string::npos)) {
    V2XInformationServiceAPI__TypesAndValues::PredictedQos predicted_qos;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    predicted_qos.decode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.predictedQos() = predicted_qos;
  } else if (it->second.find("\"ProvChgUuUniSubscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription prov_chg_uu_uni_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_uni_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuUniSubscription() = prov_chg_uu_uni_subscription;
  } else if (it->second.find("\"ProvChgUuMbmsSubscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription prov_chg_uu_mbms_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_mbms_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuMbmsSubscription() = prov_chg_uu_mbms_subscription;
  } else if (it->second.find("\"ProvChgPc5Subscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription prov_chg_pc5_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_pc5_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgPc5Subscription() = prov_chg_pc5_subscription;
  } else if (it->second.find("\"V2xMsgSubscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription v2x_msg_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    v2x_msg_subscription.decode(V2XInformationServiceAPI__TypesAndValues::V2xMsgSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.v2xMsgSubscription() = v2x_msg_subscription;


  } else if (it->second.find("\"ProvChgUuUniNotification\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniNotification prov_chg_uu_uni_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_uni_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuUniNotification() = prov_chg_uu_uni_notification;
  } else if (it->second.find("\"ProvChgUuMbmsNotification\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsNotification prov_chg_uu_mbms_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_mbms_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuMbmsNotification() = prov_chg_uu_mbms_notification;
  } else if (it->second.find("\"provChgPc5Notification\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Notification prov_chg_pc5_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_pc5_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Notification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgPc5Notification() = prov_chg_pc5_notification;
  } else if (it->second.find("\"v2xMsgDistributionServer\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo v2x_msg_distribution_server_info;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    v2x_msg_distribution_server_info.decode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.v2xMsgDistributionServerInfo() = v2x_msg_distribution_server_info;

  } else if (it->second.find("\"AssocStaSubscription\"") != std::string::npos) {
    if (it->second.find("\"subscription\"") != std::string::npos) { // SubscriptionLinkList
      WlanInformationAPI__TypesAndValues::SubscriptionLinkList subscription_link_list;
@@ -419,15 +214,6 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    assoc_sta_notification.decode(WlanInformationAPI__TypesAndValues::AssocStaNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.assocStaNotification() = assoc_sta_notification;









  } else if (it->second.find("\"detail\"") != std::string::npos) {
    LibMec__TypesAndValues::ProblemDetails problem_details;
    problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
+46 −0
Original line number Diff line number Diff line
/*!
 * \file      json_codec_factory_mec011.hh
 * \brief     Header file for ITS JSON/IP protocol codec factory.
 * \author    ETSI STF569 / TTF T027
 * \copyright ETSI Copyright Notification
 *            No part may be reproduced except as authorized by written permission.
 *            The copyright and the foregoing restriction extend to reproduction in all media.
 *            All rights reserved.
 * \version   0.1
 */
#pragma once

#include "codec_stack_builder.hh"

#include "json_codec_mec011.hh"

class Record_Type; //! TITAN forward declaration

/*!
 * \class json_codec_factory_mec011
 * \brief  This class provides a factory class to create an json_codec class instance
 */
class json_codec_factory_mec011: public codec_factory {
  static json_codec_factory_mec011 _f; //! Reference to the unique instance of this class
public: //! \publicsection
  /*!
   * \brief Default constructor
   *        Create a new instance of the json_codec_factory_mec011 class
   * \remark The HELD/IP codec identifier is HELD
   */
  json_codec_factory_mec011() {
    // register factory
    codec_stack_builder::register_codec_factory("json_codec_mec011", this);
  };
  /*!
   * \fn codec* create_codec(const std::string & type, const std::string & param);
   * \brief  Create the codecs stack based on the provided codecs stack description
   * \param[in] p_type The provided codecs stack description
   * \param[in] p_params Optional parameters
   * \return 0 on success, -1 otherwise
   * \inline
   */
  inline virtual codec_gen<Record_Type, Record_Type>* create_codec() {
    return (codec_gen<Record_Type, Record_Type>*)new json_codec_mec011();
  };
}; // End of class json_codec_factory_mec011
+185 −0

File added.

Preview size limit exceeded, changes collapsed.

+25 −0
Original line number Diff line number Diff line
#pragma once

#include "codec_gen.hh"
#include "params.hh"

#include "json_codec.hh"

class Base_Type;
class TTCN_Typedescriptor_t;
class TTCN_Buffer;

namespace LibHttp__JsonMessageBodyTypes {
  class JsonBody;
}

class json_codec_mec011: public json_codec
{
public:
  explicit json_codec_mec011() : json_codec() { };
  virtual ~json_codec_mec011() { };

  int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data);
  int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL);

}; // End of class json_codec_mec011
+16 −0

File changed.

Preview size limit exceeded, changes collapsed.

Loading