From c62378cd9c2cad2591066e94c72096983d447e28 Mon Sep 17 00:00:00 2001 From: reinaortega <miguelangel.reinaortega@etsi.org> Date: Mon, 28 Mar 2022 10:32:23 +0200 Subject: [PATCH] Restricted union type - to be reverted when supported Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org> --- LibOneM2M/OneM2M_Ports.ttcn | 4 ++-- LibOneM2M/OneM2M_Templates.ttcn | 32 +++++++++++----------------- LibOneM2M/OneM2M_TestSystem.ttcn | 8 +++---- LibOneM2M/OneM2M_TypesAndValues.ttcn | 31 ++++++++++++++------------- LibOneM2M/OneM2M_Types_3GPP_T8.ttcn | 14 +++++++++--- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/LibOneM2M/OneM2M_Ports.ttcn b/LibOneM2M/OneM2M_Ports.ttcn index e631865..520b7f7 100644 --- a/LibOneM2M/OneM2M_Ports.ttcn +++ b/LibOneM2M/OneM2M_Ports.ttcn @@ -54,9 +54,9 @@ module OneM2M_Ports { * @desc Input MsgIn * @desc this port is allowed to extend for futher usage */ - type port OneM2M_McnPort message { + type port OneM2M_McnPortT8 message { inout T8Primitive; - map param (in McnPortDesc p_mcnPortDesc); + map param (in McnPortDescT8Port p_mcnPortDesc); }; /** diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 9fc5291..9ac2459 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -8904,7 +8904,7 @@ module OneM2M_Templates { template (omit) T8Request m_t8_request_get( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, - in template (omit) RequestBody p_requestBody := omit + in template (omit) RequestBodyT8 p_requestBody := omit ) := { resourceMethod := GET, resourceUri := p_resourceUri, @@ -8915,7 +8915,7 @@ module OneM2M_Templates { template (omit) T8Request m_t8_request_post( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, - in template (omit) RequestBody p_requestBody := omit + in template (omit) RequestBodyT8 p_requestBody := omit ) modifies m_t8_request_get := { resourceMethod := POST } // End of template m_t8_request_post @@ -8923,7 +8923,7 @@ module OneM2M_Templates { template (present) T8Request mw_t8_request_post( template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, template (present) RequestHeaders p_requestHeaders := ?, - template (present) RequestBody p_requestBody := ? + template (present) RequestBodyT8 p_requestBody := ? ) := { resourceMethod := POST, resourceUri := p_resourceUri, @@ -8934,7 +8934,7 @@ module OneM2M_Templates { template (omit) T8Request m_t8_request_delete( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, - in template (omit) RequestBody p_requestBody := omit + in template (omit) RequestBodyT8 p_requestBody := omit ) modifies m_t8_request_get := { resourceMethod := DELETE } // End of template m_t8_request_delete @@ -8952,7 +8952,7 @@ module OneM2M_Templates { template (omit) T8Request m_t8_request_patch( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, - in template (omit) RequestBody p_requestBody := omit + in template (omit) RequestBodyT8 p_requestBody := omit ) modifies m_t8_request_get := { resourceMethod := PATCH } // End of template m_t8_request_patch @@ -8960,7 +8960,7 @@ module OneM2M_Templates { template (present) T8Request mw_t8_request_patch( template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, template (present) RequestHeaders p_requestHeaders := ?, - template (present) RequestBody p_requestBody := ? + template (present) RequestBodyT8 p_requestBody := ? ) := { resourceMethod := PATCH, resourceUri := p_resourceUri, @@ -8971,7 +8971,7 @@ module OneM2M_Templates { template (omit) T8Request m_t8_request_put( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, - in template (omit) RequestBody p_requestBody := omit + in template (omit) RequestBodyT8 p_requestBody := omit ) modifies m_t8_request_get := { resourceMethod := PUT } // End of template m_t8_request_put @@ -8979,7 +8979,7 @@ module OneM2M_Templates { template (present) T8Request mw_t8_request_put( template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, template (present) RequestHeaders p_requestHeaders := ?, - template (present) RequestBody p_requestBody := ? + template (present) RequestBodyT8 p_requestBody := ? ) := { resourceMethod := PUT, resourceUri := p_resourceUri, @@ -9080,9 +9080,7 @@ module OneM2M_Templates { group nidd { - template (value) RequestBody m_request_body_niddConfiguration( - in template (value) NiddConfiguration p_niddConfiguration - ) := { + template (value) RequestBodyT8 m_request_body_niddConfiguration(in template (value) NiddConfiguration p_niddConfiguration) := { individualNiddConfiguration := p_niddConfiguration } // End of template m_request_body_niddConfiguration @@ -9142,21 +9140,15 @@ module OneM2M_Templates { group deviceTriggering { - template (value) RequestBody m_request_body_deviceTriggering( - in template (value) DeviceTriggering p_deviceTriggeringTransaction - ) := { + template (value) RequestBodyT8 m_request_body_deviceTriggering(in template (value) DeviceTriggering p_deviceTriggeringTransaction) := { individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction } // End of template m_request_body_deviceTriggering - template (present) RequestBody mw_request_body_deviceTriggering( - template (present) DeviceTriggering p_deviceTriggeringTransaction := ? - ) := { + template (present) RequestBodyT8 mw_request_body_deviceTriggering(template (present) DeviceTriggering p_deviceTriggeringTransaction := ?) := { individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction } // End of template mw_request_body_deviceTriggering - template (present) RequestBody mw_request_body_deviceTriggeringDeliveryReportNotification( - template (present) DeviceTriggeringDeliveryReportNotification p_deviceTriggeringDeliveryReportNotification := ? - ) := { + template (present) RequestBodyT8 mw_request_body_deviceTriggeringDeliveryReportNotification(template (present) DeviceTriggeringDeliveryReportNotification p_deviceTriggeringDeliveryReportNotification := ?) := { deviceTriggeringDeliveryReportNotification := p_deviceTriggeringDeliveryReportNotification } // End of template mw_request_body_deviceTriggeringDeliveryReportNotification diff --git a/LibOneM2M/OneM2M_TestSystem.ttcn b/LibOneM2M/OneM2M_TestSystem.ttcn index e53d243..7b17688 100644 --- a/LibOneM2M/OneM2M_TestSystem.ttcn +++ b/LibOneM2M/OneM2M_TestSystem.ttcn @@ -118,8 +118,8 @@ module OneM2M_TestSystem { var CseSimu vc_cse1; //Attached components depending on config //Ports - port OneM2M_McnPort mcnPort; - port OneM2M_McnPort mcnPortIn; + port OneM2M_McnPortT8 mcnPort; + port OneM2M_McnPortT8 mcnPortIn; //global variables var AeSimuComponentDesc vc_aeSimuDesc; var CseSimuComponentDesc vc_cseSimuDesc; @@ -156,8 +156,8 @@ module OneM2M_TestSystem { } type component ScefSystem extends CseSystem { - port OneM2M_McnPort mcnPort; - port OneM2M_McnPort mcnPortIn; + port OneM2M_McnPortT8 mcnPort; + port OneM2M_McnPortT8 mcnPortIn; } }// end of module diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 679f1e5..1b3b51d 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -4472,10 +4472,11 @@ with { MqttBindingDesc mqttBindingDesc, WSBindingDesc wsBindingDesc } - - template BindingProtocolsSelect m_httpBindingDesc := { - httpBindingDesc := ? - } + + //TODO To be removed when restricted union type is supported in Titan + type union BindingProtocolsSelectT8Port { + HttpBindingDesc httpBindingDesc + }; /** * @desc @@ -4493,12 +4494,11 @@ with { * @member serialization */ type record T8PortDesc { - BindingProtocolsSelect binding ({httpBindingDesc := ?}), + //TODO To be replaced by BindingProtocolsSelect binding ({httpBindingDesc := ?}) when restricted union type is supported in Titan + BindingProtocolsSelectT8Port binding, SerializationRepresentations serialization ("json") } - type BindingProtocolsSelect MyInterface ({httpBindingDesc:=?}, {coapBindingDesc := ?}); - /** * @desc * @member binding @@ -4507,11 +4507,10 @@ with { type union McnPortDesc { T8PortDesc t8PortDesc } - - template McnPortDesc m_t8PortDesc := { - t8PortDesc := ? - } - + + //TODO To be removed when restricted union type is supported in Titan + type McnPortDesc McnPortDescT8Port; + /** * @desc UpperTester component settings * @member requestId @@ -4582,9 +4581,11 @@ with { /** * @desc Test System SCEF ID */ - XSD.ID scefId, - McnPortDesc mcnPort ({t8PortDesc := ?}), - McnPortDesc mcnPortIn ({t8PortDesc := ?}) + XSD.ID scefId, + //TODO To be replaced by McnPortDesc mcnPort ({t8PortDesc := ?}) when restricted union type is supported in Titan + McnPortDescT8Port mcnPort, + //TODO To be replaced by McnPortDesc mcnPortIn ({t8PortDesc := ?}) when restricted union type is supported in Titan + McnPortDescT8Port mcnPortIn } } diff --git a/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn b/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn index 15ba6c0..7c24d97 100644 --- a/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn +++ b/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn @@ -44,7 +44,7 @@ import from OneM2M_TypesAndValues {type Resource_2; type ResourceTypeList_1; typ ResourceMethod resourceMethod, URI resourceUri, RequestHeaders requestHeaders optional, - RequestBody requestBody optional + RequestBodyT8 requestBody optional } /** @@ -74,10 +74,18 @@ import from OneM2M_TypesAndValues {type Resource_2; type ResourceTypeList_1; typ charstring header_value optional } - type Body RequestBody ( {individualNiddConfiguration:=?}, + //TODO To be used instead of RequestBodyT8 + /*type Body RequestBody ( {individualNiddConfiguration:=?}, {individualNiddDownlinkDataDelivery:=?}, {individualDeviceTriggeringTransaction:=?}, - {deviceTriggeringDeliveryReportNotification:=?}); + {deviceTriggeringDeliveryReportNotification:=?});*/ + //TODO To be removed when restricted union type is supported in Titan + type union RequestBodyT8 { + NiddConfiguration individualNiddConfiguration, + NiddDownlinkDataTransfer individualNiddDownlinkDataDelivery, + DeviceTriggering individualDeviceTriggeringTransaction, + DeviceTriggeringDeliveryReportNotification deviceTriggeringDeliveryReportNotification + } type Body ResponseBody; -- GitLab