1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /* This file contains the C interface for ODU to access the Performance
20 Management functions */
22 #include "PmInterface.h"
23 #include "VesEventHandler.hpp"
24 #include "SliceMetrics.hpp"
26 #include "GlobalDefs.hpp"
29 /*******************************************************************
31 * @brief Send the Slice metrics to SMO as a VES message
35 * Function : sendSliceMetric
38 * - Takes the Slice metrics list and sends it to SMO
41 * @params[in] pointer to SliceMetricList
42 * @return O1::SUCCESS - success
43 * O1::FAILURE - failure
44 ******************************************************************/
45 int sendSliceMetric(SliceMetricList* sliceMetricList) {
47 O1_LOG("\n PmInterfce : Call received from the the du_app code !!");
51 for(int i = 0; i < sliceMetricList->nRecords; i++)
52 metrics.addMetric(sliceMetricList->sliceRecord[i]);
54 VesEventHandler vesEventHandler;
55 if (!vesEventHandler.prepare(VesEventType::PM_SLICE, &metrics))
58 O1_LOG("\n PmInterface : Sending slice PM Data");
59 if ( !vesEventHandler.send() )
65 /**********************************************************************
67 **********************************************************************/