Support for additional NR metrics
[ric-app/mc.git] / mc-core / mc / local / serv_cell_beam_csi.h
1 #ifndef _SERV_CELL_BEAM_CSI_H__INCLUDED_
2 #define _SERV_CELL_BEAM_CSI_H__INCLUDED_
3
4 /*
5 ==============================================================================
6
7         Copyright (c) 2018-2019 AT&T Intellectual Property.
8
9    Licensed under the Apache License, Version 2.0 (the "License");
10    you may not use this file except in compliance with the License.
11    You may obtain a copy of the License at
12
13        http://www.apache.org/licenses/LICENSE-2.0
14
15    Unless required by applicable law or agreed to in writing, software
16    distributed under the License is distributed on an "AS IS" BASIS,
17    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18    See the License for the specific language governing permissions and
19    limitations under the License.
20 =============================================================================
21 */
22
23
24 #include "packet.h"
25
26
27 #include "/usr/local/include/protobuf-c/protobuf-c.h"
28
29 struct _serv_cell_beam_csi {
30         gs_uint64_t timestamp_ms;
31         gs_sp_t gnb_id;
32         gs_int64_t id_MeNB_UE_X2AP_ID;
33         gs_int64_t id_SgNB_UE_X2AP_ID;
34         gs_int64_t servCellID;
35         gs_uint32_t physCellId;
36         gs_int8_t physCellId_exists;
37         gs_int64_t csi_rs_index;
38         gs_uint32_t rsrq;
39         gs_int8_t rsrq_exists;
40         gs_uint32_t rsrp;
41         gs_int8_t rsrp_exists;
42         gs_uint32_t sinr;
43         gs_int8_t sinr_exists;
44 };
45
46 static inline void init__serv_cell_beam_csi(struct _serv_cell_beam_csi *m){
47         m->physCellId_exists=0;
48         m->rsrq_exists=0;
49         m->rsrp_exists=0;
50         m->sinr_exists=0;
51 }
52
53 static inline gs_retval_t get_serv_cell_beam_csi__timestamp_ms(struct packet *p, gs_uint64_t *t){
54         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->timestamp_ms;
55         return 0;
56 }
57
58 static inline gs_retval_t get_serv_cell_beam_csi__gnb_id(struct packet *p, struct gs_string *t){
59         t->owner=0;
60         t->data = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->gnb_id;
61         if( t->data == NULL){
62                 t->length=0;
63                 return 0;
64         }
65         t->length = strlen(t->data);
66 }
67
68 static inline gs_retval_t get_serv_cell_beam_csi__id_MeNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
69         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->id_MeNB_UE_X2AP_ID;
70         return 0;
71 }
72
73 static inline gs_retval_t get_serv_cell_beam_csi__id_SgNB_UE_X2AP_ID(struct packet *p, gs_int64_t *t){
74         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->id_SgNB_UE_X2AP_ID;
75         return 0;
76 }
77
78 static inline gs_retval_t get_serv_cell_beam_csi__servCellID(struct packet *p, gs_int64_t *t){
79         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->servCellID;
80         return 0;
81 }
82
83 static inline gs_retval_t get_serv_cell_beam_csi__physCellId(struct packet *p, gs_uint32_t *t){
84         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->physCellId;
85         return (((struct _serv_cell_beam_csi *)(p->record.packed.values))->physCellId==0);
86 }
87
88 static inline gs_retval_t get_serv_cell_beam_csi__csi_rs_index(struct packet *p, gs_int64_t *t){
89         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->csi_rs_index;
90         return 0;
91 }
92
93 static inline gs_retval_t get_serv_cell_beam_csi__rsrq(struct packet *p, gs_uint32_t *t){
94         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->rsrq;
95         return (((struct _serv_cell_beam_csi *)(p->record.packed.values))->rsrq==0);
96 }
97
98 static inline gs_retval_t get_serv_cell_beam_csi__rsrp(struct packet *p, gs_uint32_t *t){
99         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->rsrp;
100         return (((struct _serv_cell_beam_csi *)(p->record.packed.values))->rsrp==0);
101 }
102
103 static inline gs_retval_t get_serv_cell_beam_csi__sinr(struct packet *p, gs_uint32_t *t){
104         *t = ((struct _serv_cell_beam_csi *)(p->record.packed.values))->sinr;
105         return (((struct _serv_cell_beam_csi *)(p->record.packed.values))->sinr==0);
106 }
107
108 #endif