From 0609ee42bd524dd57965ec754373bca020856974 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Thu, 21 Nov 2019 10:29:26 +0100 Subject: [PATCH] Move float2str in an external function as it is not defined in ETSI ES 201 873-1 V4.11.1 (2019-04) --- ccsrc/externals/LibMec_ExternalFunctions.cc | 11 +++++++++-- scripts/update_mec_project.bash | 13 +++++++------ .../AtsMec_RadioNodeLocationAPI_TestCases.ttcn | 4 ++-- ttcn/LibMec/Grant/ttcn/Grant_Pixits.ttcn | 2 +- ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn | 2 +- ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Pixits.ttcn | 2 +- ttcn/LibMec/ttcn/LibMec_Functions.ttcn | 6 ++++++ 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/ccsrc/externals/LibMec_ExternalFunctions.cc b/ccsrc/externals/LibMec_ExternalFunctions.cc index b3ea2f6..90bcb28 100644 --- a/ccsrc/externals/LibMec_ExternalFunctions.cc +++ b/ccsrc/externals/LibMec_ExternalFunctions.cc @@ -17,8 +17,7 @@ namespace LibMec__Functions { * @return Timestamp - current time since 01/01/2004 in milliseconds * @see fx_getCurrentTime() return TimestampIts */ - INTEGER fx__getCurrentTime( -) { + INTEGER fx__getCurrentTime() { INTEGER i; i.set_long_long_val(base_time::get_instance().get_its_current_time_ms()); loggers::get_instance().log_msg("<<< fx__getCurrentTime: ", i); @@ -35,4 +34,12 @@ namespace LibMec__Functions { return i; } + /** + * @desc Convert a float value into a string + * @return The string formated value + */ + CHARSTRING fx__float2str(const FLOAT& p_value) { + return float2str(p_value); + } + } // end of Namespace diff --git a/scripts/update_mec_project.bash b/scripts/update_mec_project.bash index f1442eb..f92c5dd 100755 --- a/scripts/update_mec_project.bash +++ b/scripts/update_mec_project.bash @@ -125,7 +125,7 @@ do done # Update libraries & CC files -TTCN_3_LIB_LIST='LibMec LibMec/LocationAPI LibMec/UEidentityAPI LibMec/RnisAPI LibMec/BwManagementAPI LibMec/Ams LibMec/AppEna LibMec/ApplCM LibMec/FixedAccessInformationAPI LibMec/MeoPkgm LibMec/MepmPkgm LibHttp LibCommon' +TTCN_3_LIB_LIST='LibMec LibMec/Ams LibMec/AppEna LibMec/AppLCM LibMec/BwManagementAPI LibMec/FixedAccessInformationAPI LibMec/Grant LibMec/LocationAPI LibMec/MeoPkgm LibMec/MepmPkgm LibMec/RnisAPI LibMec/UEidentityAPI LibHttp LibCommon' for i in ${TTCN_3_LIB_LIST} do if [ ! -d ${TTCN_3_DST_PATH}/$i ] @@ -134,11 +134,7 @@ do fi cp ${TTCN_3_ORG_PATH}/$i/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn # Update files - if [ "$i" == "LibMec" ] - then - cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn - cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json - elif [ "$i" == "LibHttp" ] + if [ "$i" == "LibHttp" ] then cp ${TTCN_3_ORG_PATH}/LibIts/ttcn/Http/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn cp ${CC_SRC_PATH}/EncDec/$i/*_Encdec.cc ${TTCN_3_DST_PATH}/$i/src @@ -153,6 +149,11 @@ do cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn # Patch TITAN due to TTCN-3 compiler issues cp ${SRC_MEC_PATH}/ttcn/patch_lib_common_titan/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn + elif [ "$i" == "LibMec/Ams" ] + then + cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn + cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json + rm -f ${TTCN_3_DST_PATH}/$i/ttcn/Ams_sEncdecDeclarations.ttcn else cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json diff --git a/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn index 6749a08..8245781 100644 --- a/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn @@ -446,7 +446,7 @@ module AtsMec_RadioNodeLocationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - "/" & PICS_ROOT_API & PX_UE_LOC_QRY_URI & "?address=" & oct2char(unichar2oct(PX_IP_ADDRESS, "UTF-8")) & "&latitude=" & float2str(PX_UE_COORD_LAT) & "&longitude=" & float2str(PX_UE_COORD_LONG), + "/" & PICS_ROOT_API & PX_UE_LOC_QRY_URI & "?address=" & oct2char(unichar2oct(PX_IP_ADDRESS, "UTF-8")) & "&latitude=" & fx_float2str(PX_UE_COORD_LAT) & "&longitude=" & fx_float2str(PX_UE_COORD_LONG), v_headers ) ) @@ -503,7 +503,7 @@ module AtsMec_RadioNodeLocationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - "/" & PICS_ROOT_API & PX_UE_LOC_QRY_URI & "?address=" & oct2char(unichar2oct(PX_IP_ADDRESS, "UTF-8")) & "&lat=" & float2str(PX_UE_COORD_LAT) & "&longitude=" & float2str(PX_UE_COORD_LONG), + "/" & PICS_ROOT_API & PX_UE_LOC_QRY_URI & "?address=" & oct2char(unichar2oct(PX_IP_ADDRESS, "UTF-8")) & "&lat=" & fx_float2str(PX_UE_COORD_LAT) & "&longitude=" & fx_float2str(PX_UE_COORD_LONG), v_headers ) ) diff --git a/ttcn/LibMec/Grant/ttcn/Grant_Pixits.ttcn b/ttcn/LibMec/Grant/ttcn/Grant_Pixits.ttcn index 0b679bc..7cc6469 100644 --- a/ttcn/LibMec/Grant/ttcn/Grant_Pixits.ttcn +++ b/ttcn/LibMec/Grant/ttcn/Grant_Pixits.ttcn @@ -16,4 +16,4 @@ module Grant_Pixits { modulepar JSON.String PX_NON_EXISTANT_GRANTING_ID := "PX_NON_EXISTANT_GRANTING_ID"; -} +} // End of module Grant_Pixits diff --git a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn index f775a51..3c8a4bd 100644 --- a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn +++ b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn @@ -34,4 +34,4 @@ module MeoPkgm_Pixits { modulepar NotificationType PX_NOTIFICATION_TYPE := ON_BOARDING; -} // End of module LocationAPI_Pixits +} // End of module MeoPkgm_Pixits diff --git a/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Pixits.ttcn b/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Pixits.ttcn index 3c6d34f..eb49ef5 100644 --- a/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Pixits.ttcn +++ b/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Pixits.ttcn @@ -36,4 +36,4 @@ module MepmPkgm_Pixits { modulepar JSON.String PX_APP_D_ID := "5lkj4782-2c70-4e47-9a4e-0ee3a1a0fd1f"; -} // End of module LocationAPI_Pixits +} // End of module MepmPkgm_Pixits diff --git a/ttcn/LibMec/ttcn/LibMec_Functions.ttcn b/ttcn/LibMec/ttcn/LibMec_Functions.ttcn index 8d38786..7f587c1 100644 --- a/ttcn/LibMec/ttcn/LibMec_Functions.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Functions.ttcn @@ -122,6 +122,12 @@ module LibMec_Functions { */ external function fx_get_current_time_utc() return UInt64; + /** + * @desc Convert a float value into a string + * @return The string formated value + */ + external function fx_float2str(in float p_value) return charstring; + } // End of group external_functions group helpers { -- GitLab