X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_e2_conversions.c;fp=src%2Fdu_app%2Fdu_e2_conversions.c;h=3ee6ca0cdaff4eae1e72197d5832bfc668015c22;hb=cdf2274ce07f8a5e066f1a49e92db156f1a92c66;hp=0000000000000000000000000000000000000000;hpb=a50cee433ee06d6a8a4215c274432ab4ad8fdb26;p=o-du%2Fl2.git diff --git a/src/du_app/du_e2_conversions.c b/src/du_app/du_e2_conversions.c new file mode 100644 index 000000000..3ee6ca0cd --- /dev/null +++ b/src/du_app/du_e2_conversions.c @@ -0,0 +1,70 @@ +/******************************************************************************* +################################################################################ +# Copyright (c) [2017-2019] [Radisys] # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ +*******************************************************************************/ + +/* This file contains functions that maps values received in F1AP message with + * its corresponding values used in DU and vice-versa */ + +#include "common_def.h" +#include "TimeToWaitE2.h" + +/************************************************************************ + * + * @brief Converts enum values into actual value of E2 wait timer + * + * @details + * + * Function : covertE2WaitTimerEnumToValue + * + * Functionality: Converts enum values into actual value of E2 wait timer + * + * @params[in] Enum value of e2 wait timer + * @return Actual value of e2 wait timer + * + * **********************************************************************/ + +uint8_t covertE2WaitTimerEnumToValue(uint8_t timerToWait) +{ + switch(timerToWait) + { + case TimeToWaitE2_v1s: + return 1; + + case TimeToWaitE2_v2s: + return 2; + + case TimeToWaitE2_v5s: + return 5; + + case TimeToWaitE2_v10s: + return 10; + + case TimeToWaitE2_v20s: + return 20; + + case TimeToWaitE2_v60s: + return 60; + + default: + DU_LOG("\nERROR --> F1AP: Invalid value of E2 Wait timer"); + } + return RFAILED; +} + +/********************************************************************** + End of file + **********************************************************************/