[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / SS-RSSI-Measurement.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "../../../rrc_15.3_asn.asn1"
5  *      `asn1c -D ./25_02_2022_RRC/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "SS-RSSI-Measurement.h"
9
10 static int
11 memb_measurementSlots_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
14         size_t size;
15         
16         if(!sptr) {
17                 ASN__CTFAIL(app_key, td, sptr,
18                         "%s: value not given (%s:%d)",
19                         td->name, __FILE__, __LINE__);
20                 return -1;
21         }
22         
23         if(st->size > 0) {
24                 /* Size in bits */
25                 size = 8 * st->size - (st->bits_unused & 0x07);
26         } else {
27                 size = 0;
28         }
29         
30         if((size >= 1 && size <= 80)) {
31                 /* Constraint check succeeded */
32                 return 0;
33         } else {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: constraint failed (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39 }
40
41 static int
42 memb_endSymbol_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
43                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44         long value;
45         
46         if(!sptr) {
47                 ASN__CTFAIL(app_key, td, sptr,
48                         "%s: value not given (%s:%d)",
49                         td->name, __FILE__, __LINE__);
50                 return -1;
51         }
52         
53         value = *(const long *)sptr;
54         
55         if((value >= 0 && value <= 3)) {
56                 /* Constraint check succeeded */
57                 return 0;
58         } else {
59                 ASN__CTFAIL(app_key, td, sptr,
60                         "%s: constraint failed (%s:%d)",
61                         td->name, __FILE__, __LINE__);
62                 return -1;
63         }
64 }
65
66 static asn_oer_constraints_t asn_OER_memb_measurementSlots_constr_2 CC_NOTUSED = {
67         { 0, 0 },
68         -1      /* (SIZE(1..80)) */};
69 static asn_per_constraints_t asn_PER_memb_measurementSlots_constr_2 CC_NOTUSED = {
70         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
71         { APC_CONSTRAINED,       7,  7,  1,  80 }       /* (SIZE(1..80)) */,
72         0, 0    /* No PER value map */
73 };
74 static asn_oer_constraints_t asn_OER_memb_endSymbol_constr_3 CC_NOTUSED = {
75         { 1, 1 }        /* (0..3) */,
76         -1};
77 static asn_per_constraints_t asn_PER_memb_endSymbol_constr_3 CC_NOTUSED = {
78         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (0..3) */,
79         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
80         0, 0    /* No PER value map */
81 };
82 asn_TYPE_member_t asn_MBR_SS_RSSI_Measurement_1[] = {
83         { ATF_NOFLAGS, 0, offsetof(struct SS_RSSI_Measurement, measurementSlots),
84                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
85                 -1,     /* IMPLICIT tag at current level */
86                 &asn_DEF_BIT_STRING,
87                 0,
88                 { &asn_OER_memb_measurementSlots_constr_2, &asn_PER_memb_measurementSlots_constr_2,  memb_measurementSlots_constraint_1 },
89                 0, 0, /* No default value */
90                 "measurementSlots"
91                 },
92         { ATF_NOFLAGS, 0, offsetof(struct SS_RSSI_Measurement, endSymbol),
93                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
94                 -1,     /* IMPLICIT tag at current level */
95                 &asn_DEF_NativeInteger,
96                 0,
97                 { &asn_OER_memb_endSymbol_constr_3, &asn_PER_memb_endSymbol_constr_3,  memb_endSymbol_constraint_1 },
98                 0, 0, /* No default value */
99                 "endSymbol"
100                 },
101 };
102 static const ber_tlv_tag_t asn_DEF_SS_RSSI_Measurement_tags_1[] = {
103         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
104 };
105 static const asn_TYPE_tag2member_t asn_MAP_SS_RSSI_Measurement_tag2el_1[] = {
106     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* measurementSlots */
107     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endSymbol */
108 };
109 asn_SEQUENCE_specifics_t asn_SPC_SS_RSSI_Measurement_specs_1 = {
110         sizeof(struct SS_RSSI_Measurement),
111         offsetof(struct SS_RSSI_Measurement, _asn_ctx),
112         asn_MAP_SS_RSSI_Measurement_tag2el_1,
113         2,      /* Count of tags in the map */
114         0, 0, 0,        /* Optional elements (not needed) */
115         -1,     /* First extension addition */
116 };
117 asn_TYPE_descriptor_t asn_DEF_SS_RSSI_Measurement = {
118         "SS-RSSI-Measurement",
119         "SS-RSSI-Measurement",
120         &asn_OP_SEQUENCE,
121         asn_DEF_SS_RSSI_Measurement_tags_1,
122         sizeof(asn_DEF_SS_RSSI_Measurement_tags_1)
123                 /sizeof(asn_DEF_SS_RSSI_Measurement_tags_1[0]), /* 1 */
124         asn_DEF_SS_RSSI_Measurement_tags_1,     /* Same as above */
125         sizeof(asn_DEF_SS_RSSI_Measurement_tags_1)
126                 /sizeof(asn_DEF_SS_RSSI_Measurement_tags_1[0]), /* 1 */
127         { 0, 0, SEQUENCE_constraint },
128         asn_MBR_SS_RSSI_Measurement_1,
129         2,      /* Elements count */
130         &asn_SPC_SS_RSSI_Measurement_specs_1    /* Additional specs */
131 };
132