Commit 4b41b857 authored by Yann Garcia's avatar Yann Garcia
Browse files

Big fixed on MEC-011

parent 1cdfe60d
...@@ -159,8 +159,8 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy ...@@ -159,8 +159,8 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
service_info.decode(AppEnablementAPI__TypesAndValues::ServiceInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); service_info.decode(AppEnablementAPI__TypesAndValues::ServiceInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.serviceInfo() = service_info; msg.serviceInfo() = service_info;
} }
} else if (it->second.find("\"transportInfoList\"") != std::string::npos) { // Be careful to the order } else if (it->second.find("\"security\"") != std::string::npos) { // Be careful to the order
// TODO To be refined, find("\"accessPointList\"") is not optimal // TODO To be refined, find("\"accessPointList\"") is not optimal
AppEnablementAPI__TypesAndValues::TransportInfoList transport_info_list; AppEnablementAPI__TypesAndValues::TransportInfoList transport_info_list;
transport_info_list.decode(AppEnablementAPI__TypesAndValues::TransportInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); transport_info_list.decode(AppEnablementAPI__TypesAndValues::TransportInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.transportInfoList() = transport_info_list; msg.transportInfoList() = transport_info_list;
...@@ -188,6 +188,10 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy ...@@ -188,6 +188,10 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription app_term; AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription app_term;
app_term.decode(AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); app_term.decode(AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.appTerminationNotificationSubscription() = app_term; msg.appTerminationNotificationSubscription() = app_term;
} else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("\"subscriptions\"") != std::string::npos)) {
AppEnablementAPI__TypesAndValues::SubscriptionLinkList sub_link_list;
sub_link_list.decode(AppEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.subscriptionLinkList__app__ens() = sub_link_list;
} else if (it->second.find("\"subscriptionType\"") != std::string::npos) { } else if (it->second.find("\"subscriptionType\"") != std::string::npos) {
AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription ser_av; AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription ser_av;
ser_av.decode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); ser_av.decode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
...@@ -196,6 +200,10 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy ...@@ -196,6 +200,10 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
AppEnablementAPI__TypesAndValues::TimingCaps timing_caps; AppEnablementAPI__TypesAndValues::TimingCaps timing_caps;
timing_caps.decode(AppEnablementAPI__TypesAndValues::TimingCaps_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); timing_caps.decode(AppEnablementAPI__TypesAndValues::TimingCaps_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.timingCaps() = timing_caps; msg.timingCaps() = timing_caps;
} else if (it->second.find("\"timeSourceStatus\"") != std::string::npos) {
AppEnablementAPI__TypesAndValues::CurrentTime current_time;
current_time.decode(AppEnablementAPI__TypesAndValues::CurrentTime_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.currentTime() = current_time;
} else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) { } else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) {
// // Replace "type": "1" by type": "EU_IPV4_ADDRESS", "type": "2"... // // Replace "type": "1" by type": "EU_IPV4_ADDRESS", "type": "2"...
// // TODO Create a method instead of copy/past // // TODO Create a method instead of copy/past
......
...@@ -92,20 +92,16 @@ module AppEnablementAPI_Templates { ...@@ -92,20 +92,16 @@ module AppEnablementAPI_Templates {
isLocal := * isLocal := *
} // End of template mw_service_info } // End of template mw_service_info
template (omit) SubscriptionLinkList m_subscription_link_list( template (value) SubscriptionLinkList m_subscription_link_list(
in template (value) Links p_links, in template (value) Links p_links
in template (omit) Subscriptions p_subscription := omit
) := { ) := {
links := p_links, links := p_links
subscription := p_subscription
} // End of template m_subscription_link_list } // End of template m_subscription_link_list
template SubscriptionLinkList mw_subscription_link_list( template (present) SubscriptionLinkList mw_subscription_link_list(
template (present) Links p_links := ?, template (present) Links p_links := ?
template Subscriptions p_subscription := *
) := { ) := {
links := p_links, links := p_links
subscription := p_subscription
} // End of template mw_subscription_link_list } // End of template mw_subscription_link_list
template (value) Self m_self( template (value) Self m_self(
......
...@@ -70,7 +70,7 @@ module AppEnablementAPI_TypesAndValues { ...@@ -70,7 +70,7 @@ module AppEnablementAPI_TypesAndValues {
type JSON.String CategoryRef_Id; type JSON.String CategoryRef_Id;
/** /**
SerAvailabilityNotificationSubscription * @desc Name of the category. * @desc Name of the category.
*/ */
type JSON.String Name; type JSON.String Name;
...@@ -291,7 +291,8 @@ SerAvailabilityNotificationSubscription * @desc Name of the category. ...@@ -291,7 +291,8 @@ SerAvailabilityNotificationSubscription * @desc Name of the category.
} }
type record Links { type record Links {
LinkType self_ LinkType self_,
Subscriptions subscriptions
} with { } with {
variant (self_) "name as 'self'"; variant (self_) "name as 'self'";
} }
...@@ -300,16 +301,15 @@ SerAvailabilityNotificationSubscription * @desc Name of the category. ...@@ -300,16 +301,15 @@ SerAvailabilityNotificationSubscription * @desc Name of the category.
* @desc This type represents a list of links related to currently existing subscriptions for a MEC application instance. * @desc This type represents a list of links related to currently existing subscriptions for a MEC application instance.
*/ */
type record SubscriptionLinkList { type record SubscriptionLinkList {
Links links, Links links
Subscriptions subscription optional
} with { } with {
variant (links) "name as '_links'"; variant (links) "name as '_links'";
} }
/** /**
* @desc A link to a subscription * @desc The MEC application instance's subscriptions
* @member * @member href URI referring to the subscription
* @member * @member subscriptionType Type of the subscription
*/ */
type record Subscription_ { type record Subscription_ {
JSON.AnyURI href, JSON.AnyURI href,
...@@ -548,7 +548,6 @@ SerAvailabilityNotificationSubscription * @desc Name of the category. ...@@ -548,7 +548,6 @@ SerAvailabilityNotificationSubscription * @desc Name of the category.
* @desc Time. * @desc Time.
* @member seconds The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC. * @member seconds The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.
* @member nanoSeconds The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC. * @member nanoSeconds The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.
* @member timeSourceStatus Platform Time Source status. 1 = TRACEABLE - time source is locked to the UTC time source. 2 = NONTRACEABLE - time source is not locked to the UTC time source.
*/ */
type record TimeStamp { type record TimeStamp {
Seconds seconds, Seconds seconds,
...@@ -579,6 +578,7 @@ SerAvailabilityNotificationSubscription * @desc Name of the category. ...@@ -579,6 +578,7 @@ SerAvailabilityNotificationSubscription * @desc Name of the category.
* @desc Identify the traffic ip address. * @desc Identify the traffic ip address.
*/ */
type JSON.String TrafficFilter_Port; type JSON.String TrafficFilter_Port;
type record length(0..infinity) of TrafficFilter_Port TrafficFilter_PortList;
/** /**
* @desc Protocol of the traffic filter. * @desc Protocol of the traffic filter.
...@@ -618,19 +618,19 @@ SerAvailabilityNotificationSubscription * @desc Name of the category. ...@@ -618,19 +618,19 @@ SerAvailabilityNotificationSubscription * @desc Name of the category.
* @desc This type represents the traffic filter. * @desc This type represents the traffic filter.
*/ */
type record TrafficFilter { type record TrafficFilter {
TrafficFilter_Address srcAddress, TrafficFilter_AddressList srcAddress,
TrafficFilter_AddressList dstAddress, TrafficFilter_AddressList dstAddress,
TrafficFilter_Port srcPort, TrafficFilter_PortList srcPort,
TrafficFilter_Port dstPort, TrafficFilter_PortList dstPort,
TrafficFilter_ProtocolList protocol, TrafficFilter_ProtocolList protocol,
TrafficFilter_TokenList token, TrafficFilter_TokenList token,
TrafficFilter_TunnelAddressList srcTunnelAddress, TrafficFilter_TunnelAddressList srcTunnelAddress,
TrafficFilter_TunnelAddressList tgtTunnelAddress, TrafficFilter_TunnelAddressList tgtTunnelAddress,
TrafficFilter_TunnelPortList srcTunnelPort, TrafficFilter_TunnelPortList srcTunnelPort,
TrafficFilter_TunnelPortList dstTunnelPort, TrafficFilter_TunnelPortList dstTunnelPort,
TrafficFilter_QCI qCI, TrafficFilter_QCI qCI optional,
TrafficFilter_DSCP dSCP, TrafficFilter_DSCP dSCP optional,
TrafficFilter_TC tC TrafficFilter_TC tC optional
} }
type record of TrafficFilter TrafficFilterList; type record of TrafficFilter TrafficFilterList;
......
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