[Epic-ID: ODUHIGH-510][Task-ID: ODUHIGH-512] Implementation of E2 setup failure
[o-du/l2.git] / src / du_app / du_e2_conversions.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /* This file contains functions that maps values received in F1AP message with
20  * its corresponding values used in DU and vice-versa */
21
22 #include "common_def.h"
23 #include "TimeToWaitE2.h"
24
25 /************************************************************************
26  *
27  * @brief Converts enum values into actual value of E2 wait timer
28  *
29  * @details
30  *
31  *    Function : covertE2WaitTimerEnumToValue
32  *
33  *    Functionality: Converts enum values into actual value of E2 wait timer 
34  *
35  * @params[in] Enum value of e2 wait timer 
36  * @return Actual value of e2 wait timer
37  *
38  * **********************************************************************/
39
40 uint8_t covertE2WaitTimerEnumToValue(uint8_t timerToWait)
41 {
42    switch(timerToWait)
43    {
44       case TimeToWaitE2_v1s:
45          return 1;
46          
47       case TimeToWaitE2_v2s:
48          return 2;
49          
50       case TimeToWaitE2_v5s:
51          return 5;
52          
53       case TimeToWaitE2_v10s:
54          return 10;
55          
56       case TimeToWaitE2_v20s:
57          return 20;
58          
59       case TimeToWaitE2_v60s:
60          return 60;
61          
62       default:
63          DU_LOG("\nERROR  -->  F1AP: Invalid value of E2 Wait timer");
64    }
65    return RFAILED;
66 }
67
68 /**********************************************************************
69   End of file
70  **********************************************************************/